aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-03-23 06:41:21 +0000
committerAlan Modra <amodra@gmail.com>2012-03-23 06:41:21 +0000
commit62599110be4d6baae772ce8022801f06137495b9 (patch)
tree59b9b440f984f57d753854740cec790eba5b421d /bfd/elf64-ppc.c
parent8fe8b60120a48c2b516c60a7929bcee694235bd6 (diff)
downloadgdb-62599110be4d6baae772ce8022801f06137495b9.zip
gdb-62599110be4d6baae772ce8022801f06137495b9.tar.gz
gdb-62599110be4d6baae772ce8022801f06137495b9.tar.bz2
PR binutils/13894
* elf64-ppc.c (opd_entry_value): Read full symbol table when sym hashes unavailable.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index f4f5d0b..e7a01c2 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -5585,15 +5585,18 @@ opd_entry_value (asection *opd_sec,
unsigned long symndx = ELF64_R_SYM (look->r_info);
asection *sec;
- if (symndx < symtab_hdr->sh_info)
+ if (symndx < symtab_hdr->sh_info
+ || elf_sym_hashes (opd_bfd) == NULL)
{
Elf_Internal_Sym *sym;
sym = (Elf_Internal_Sym *) symtab_hdr->contents;
if (sym == NULL)
{
- sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr,
- symtab_hdr->sh_info,
+ size_t symcnt = symtab_hdr->sh_info;
+ if (elf_sym_hashes (opd_bfd) == NULL)
+ symcnt = symtab_hdr->sh_size / symtab_hdr->sh_entsize;
+ sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr, symcnt,
0, NULL, NULL, NULL);
if (sym == NULL)
break;