diff options
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r-- | binutils/objdump.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c index 7cc9640648..af04b70377 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -2564,9 +2564,19 @@ dump_bfd (bfd *abfd) if (dump_dynamic_symtab || dump_dynamic_reloc_info || (disassemble && bfd_get_dynamic_symtab_upper_bound (abfd) > 0)) dynsyms = slurp_dynamic_symtab (abfd); - if (disassemble && dynsymcount > 0) + if (disassemble) { - synthcount = bfd_get_synthetic_symtab (abfd, dynsyms, &synthsyms); + synthcount = 0; + if (bfd_get_file_flags (abfd) & (DYNAMIC | EXEC_P)) + { + if (dynsymcount > 0) + synthcount = bfd_get_synthetic_symtab (abfd, dynsyms, &synthsyms); + } + else + { + if (symcount > 0) + synthcount = bfd_get_synthetic_symtab (abfd, syms, &synthsyms); + } if (synthcount < 0) synthcount = 0; } |