From 90e3cdf2a90318ccd4b5612d1e9fbd56ada53d84 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 17 Aug 2004 09:07:35 +0000 Subject: bfd/ * elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Only define if not yet defined. * elf64-ppc.c (bfd_elf64_get_synthetic_symtab): Define. (synthetic_opd, synthetic_relocatable): New variables. (compare_symbols, compare_relocs): New helper routines. (ppc64_elf_get_synthetic_symtab): New function. * bfd.c (bfd_get_synthetic_symtab): Rename dynsyms argument to relsyms. * bfd-in2.h: Regenerated. * elf.c (_bfd_elf_get_synthetic_symtab): Rename dynsyms argument to relsyms. Return 0 if abfd is relocatable. binutils/ * objdump.c (dump_bfd): For relocatable objects, pass syms instead of dynsyms to bfd_get_synthetic_symtab. --- binutils/ChangeLog | 5 +++++ binutils/objdump.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'binutils') diff --git a/binutils/ChangeLog b/binutils/ChangeLog index e00ad96..958a26a 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2004-08-17 Jakub Jelinek + + * objdump.c (dump_bfd): For relocatable objects, pass syms instead + of dynsyms to bfd_get_synthetic_symtab. + 2004-08-16 Alan Modra * readelf.c (debug_apply_rela_addends): New function, extracted from.. diff --git a/binutils/objdump.c b/binutils/objdump.c index 7cc9640..af04b70 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; } -- cgit v1.1