aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-03-03 00:08:35 -0500
committerJesse Luehrs <doy@tozt.net>2021-03-03 00:08:35 -0500
commit3f740f29fb808fc22ad7db12ac2eac1ab56ec2b6 (patch)
tree45018579112530ce81ebd8525ceee9a83c275c9d
parent24364d4206890410cc9abb2889cee0636d5823b5 (diff)
downloadrbw-3f740f29fb808fc22ad7db12ac2eac1ab56ec2b6.tar.gz
rbw-3f740f29fb808fc22ad7db12ac2eac1ab56ec2b6.zip
only fix up .dynsym symbols
-rwxr-xr-xbuild/fix-glibc-function-versions19
1 files changed, 13 insertions, 6 deletions
diff --git a/build/fix-glibc-function-versions b/build/fix-glibc-function-versions
index 213687a..ed1ca2a 100755
--- a/build/fix-glibc-function-versions
+++ b/build/fix-glibc-function-versions
@@ -91,18 +91,25 @@ open my $fh, '>', "$bin.new" or die "couldn't open $bin.new: $!";
print $fh $bin_contents;
chmod 0755, "$bin.new";
-my $remaining = `readelf -sW $bin.new | grep 'GLIBC_2.\\(29\\|32\\)'`;
-if (!$?) {
- die "additional symbols from GLIBC_2.29 or GLIBC_2.32 found:\n$remaining\n";
+my %new = parse_readelf_s("$bin.new");
+my @found;
+for my $name (keys %new) {
+ if ($name =~ /\@GLIBC_2\.(?:29|32)$/) {
+ push @found, $name;
+ }
+}
+if (@found) {
+ die "additional symbols from GLIBC_2.29 or GLIBC_2.32 found:\n@found\n";
}
sub parse_readelf_s($bin) {
my $readelf = `readelf -sW $bin`;
my %ret;
- for my $line (split "\n", $readelf) {
- if ($line =~ /^ *[0-9]+:/) {
- my ($num, $value, $size, $type, $bind, $vis, $ndx, $name, $ver) = split ' ', $line;
+ for (split "\n", $readelf) {
+ next unless /Symbol table '\.dynsym'/../^$/;
+ if (/^ *[0-9]+:/) {
+ my ($num, $value, $size, $type, $bind, $vis, $ndx, $name, $ver) = split ' ';
if (defined $ver) {
($ver) = $ver =~ /\((.*)\)/;
}