From e625980d0c4138477193fa40e22078c35a954e0c Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Fri, 25 Sep 2009 21:07:26 +0000 Subject: code cleanup --- strip_and_check_elf_files | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/strip_and_check_elf_files b/strip_and_check_elf_files index 88d25b6..5f7e84d 100755 --- a/strip_and_check_elf_files +++ b/strip_and_check_elf_files @@ -41,19 +41,21 @@ sub strip_files { } 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)); + my $shift = length($buildroot); + foreach my $file (@shared_libs, @executables) { + my (undef, undef, @l) = `ldd -u -r $file 2>/dev/null`; + next unless @l; + my $file_ = substr($file, $shift); print STDERR - "Warning: unused libraries in $f_: ", + "Warning: unused libraries in $file_: ", 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)); + foreach my $file (@shared_libs) { + my @l = `ldd -r $file 2>&1 >/dev/null`; + next unless @l; + my $file_ = substr($file, $shift); print STDERR - "Warning: undefined symbols in $f_: ", + "Warning: undefined symbols in $file_: ", join(' ', map { /undefined symbol: (\S+)/ ? $1 : () } @l), "\n"; } } -- cgit v1.2.1