diff options
Diffstat (limited to 'strip_and_check_elf_files')
-rwxr-xr-x | strip_and_check_elf_files | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/strip_and_check_elf_files b/strip_and_check_elf_files index 18a571f..4cc7e23 100755 --- a/strip_and_check_elf_files +++ b/strip_and_check_elf_files @@ -27,29 +27,29 @@ sub strip_files { my @to_strip = (@shared_libs, @executables); if ($ENV{EXCLUDE_FROM_STRIP}) { - my $exclude_pattern = join('|', split(/\s+/, $ENV{EXCLUDE_FROM_STRIP})); - my $compiled_pattern = qr/($exclude_pattern)/; - @to_strip = grep { !/$compiled_pattern/ } @to_strip; + my $exclude_pattern = join('|', split(/\s+/, $ENV{EXCLUDE_FROM_STRIP})); + my $compiled_pattern = qr/($exclude_pattern)/; + @to_strip = grep { !/$compiled_pattern/ } @to_strip; } system( - "strip", - "--remove-section=.comment", - "--remove-section=.note", - $_) foreach @to_strip; + "strip", + "--remove-section=.comment", + "--remove-section=.note", + $_) foreach @to_strip; } sub check_missing_or_unused_libs { foreach my $f (@shared_libs, @executables) { - my (undef, undef, @l) = `ldd -u -r $f 2>/dev/null`; - @l or next; - my $f_ = substr($f, length($buildroot)); - print STDERR "Warning: unused libraries in $f_: ", join(' ', map { basename($_) } @l), "\n"; + my (undef, undef, @l) = `ldd -u -r $f 2>/dev/null`; + @l or next; + my $f_ = substr($f, length($buildroot)); + print STDERR "Warning: unused libraries in $f_: ", join(' ', map { basename($_) } @l), "\n"; } foreach my $f (@shared_libs) { - my @l = `ldd -r $f 2>&1 >/dev/null` or next; - my $f_ = substr($f, length($buildroot)); - print STDERR "Warning: undefined symbols in $f_: ", join(' ', map { /undefined symbol: (\S+)/ ? $1 : () } @l), "\n"; + my @l = `ldd -r $f 2>&1 >/dev/null` or next; + my $f_ = substr($f, length($buildroot)); + print STDERR "Warning: undefined symbols in $f_: ", join(' ', map { /undefined symbol: (\S+)/ ? $1 : () } @l), "\n"; } } @@ -95,4 +95,8 @@ sub keep_wanted() { } } -sub basename { local $_ = shift; s|/*\s*$||; s|.*/||; $_ } +sub basename { + local $_ = shift; + s|/*\s*$||; s|.*/||; + $_ +} |