$self->{file} = $file;
local $ENV{LC_ALL} = 'C';
- open(my $objdump, "-|", "objdump", "-w", "-p", "-T", $file)
+ open(my $objdump, "-|", "objdump", "-w", "-f", "-p", "-T", $file)
|| syserr(sprintf(_g("Can't execute objdump: %s"), $!));
my $ret = $self->_parse($objdump);
close($objdump);
} elsif ($section eq "none") {
if (/^\s*\S+:\s*file\s+format\s+(\S+)\s*$/) {
$self->{format} = $1;
+ } elsif (/^architecture:\s*\S+,\s*flags:\s*\S+\s*$/) {
+ # Parse 2 lines of "-f"
+ # architecture: i386, flags 0x00000112:
+ # EXEC_P, HAS_SYMS, D_PAGED
+ # start address 0x08049b50
+ $self->{flags}{$_} = 1 foreach (split(/,\s*/, <$fh>));
}
}
}
return @{$self->{NEEDED}};
}
+sub is_executable {
+ my $self = shift;
+ return exists $self->{flags}{EXEC_P} and $self->{flags}{EXEC_P};
+}
+
+sub is_public_library {
+ my $self = shift;
+ return exists $self->{flags}{DYNAMIC} and $self->{flags}{DYNAMIC}
+ and exists $self->{SONAME} and $self->{SONAME};
+}
+
1;
} else {
my $syminfo = $dumplibs_wo_symfile->locate_symbol($name);
if (not defined($syminfo)) {
- my $print_name = $name;
- # Drop the default suffix for readability
- $print_name =~ s/\@Base$//;
- warning(sprintf(
- _g("symbol %s used by %s found in none of the libraries."),
- $print_name, $file)) unless $sym->{weak};
+ # Complain about missing symbols only for executables
+ # and public libraries
+ if ($obj->is_executable() or $obj->is_public_library()) {
+ my $print_name = $name;
+ # Drop the default suffix for readability
+ $print_name =~ s/\@Base$//;
+ warning(sprintf(
+ _g("symbol %s used by %s found in none of the libraries."),
+ $print_name, $file)) unless $sym->{weak};
+ }
} else {
$used_sonames{$syminfo->{soname}}++;
}
/usr/lib/libglib-2.0.so.0: file format elf64-little
+architecture: ia64-elf64, flags 0x00000150:
+HAS_SYMS, DYNAMIC, D_PAGED
+start address 0x000000000002dc40
Program Header:
LOAD off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**16
/lib/libc.so.6: file format elf32-i386
+architecture: i386, flags 0x00000150:
+HAS_SYMS, DYNAMIC, D_PAGED
+start address 0x000161b0
Program Header:
PHDR off 0x00000034 vaddr 0x00000034 paddr 0x00000034 align 2**2
/lib/libc.so.6: file format elf32-i386
+architecture: i386, flags 0x00000150:
+HAS_SYMS, DYNAMIC, D_PAGED
+start address 0x000161b0
Program Header:
PHDR off 0x00000034 vaddr 0x00000034 paddr 0x00000034 align 2**2