diff options
author | Sheldon Lobo <sheldon.lobo@oracle.com> | 2017-02-07 06:05:59 -0800 |
---|---|---|
committer | Jose E. Marchesi <jose.marchesi@oracle.com> | 2017-02-07 06:05:59 -0800 |
commit | 3d044c0c78c11968b4fe3c5c019523e3177b1710 (patch) | |
tree | 018bf1dc5aba09dc5a25267b990f667afec1a2fa | |
parent | 8a78ba5cf798d878b6551ae6986a648d19570a91 (diff) | |
download | gdb-3d044c0c78c11968b4fe3c5c019523e3177b1710.zip gdb-3d044c0c78c11968b4fe3c5c019523e3177b1710.tar.gz gdb-3d044c0c78c11968b4fe3c5c019523e3177b1710.tar.bz2 |
bfd: Fix objdump --dynamic-reloc for SPARC 64-bit to show symbol names.
Fixes ld/testsuite/ld-elf/shared.exp "Build libpr16496b.so".
The root cause is in bfd/elf64-sparc.c, elf64_sparc_slurp_one_reloc_table(),
bfd_get_symcount() was used for dynamic mode as well. The fix is to use
bfd_get_dynamic_symcount().
This has been tested with sparc64-linux-gnu, and it does not introduce any
regressions.
bfd/ChangeLog:
2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
Fix sparc64 dynamic relocation processing to use the dynamic
symbol count.
* elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
should be used.
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/elf64-sparc.c | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3f9bbd1..8d21e04 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com> + + Fix sparc64 dynamic relocation processing to use the dynamic + symbol count. + * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic' + to determine if bfd_get_symcount() or bfd_get_dynamic_symcount() + should be used. + 2017-02-03 Nick Clifton <nickc@redhat.com> PR 21096 diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index ac66ab1..0190bd2 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -99,7 +99,9 @@ elf64_sparc_slurp_one_reloc_table (bfd *abfd, asection *asect, if (ELF64_R_SYM (rela.r_info) == STN_UNDEF /* PR 17512: file: 996185f8. */ - || ELF64_R_SYM (rela.r_info) > bfd_get_symcount (abfd)) + || (!dynamic && ELF64_R_SYM(rela.r_info) > bfd_get_symcount(abfd)) + || (dynamic + && ELF64_R_SYM(rela.r_info) > bfd_get_dynamic_symcount(abfd))) relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; else { |