From 3f740f29fb808fc22ad7db12ac2eac1ab56ec2b6 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 3 Mar 2021 00:08:35 -0500 Subject: only fix up .dynsym symbols --- build/fix-glibc-function-versions | 19 +++++++++++++------ 1 file 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 =~ /\((.*)\)/; } -- cgit v1.2.3-54-g00ecf