summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-03-23 06:41:20 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-03-23 06:41:20 +0000
commit20a90f314c776b2f708361bbacee0ad0ab7dcbb1 (patch)
tree9013da53076831e8d47922c0428caa332d718146
parentd022b26da5a60657de6f2d83278129e958b53224 (diff)
downloadbinutils-redhat-20a90f314c776b2f708361bbacee0ad0ab7dcbb1.tar.gz
PR binutils/13894
* elf64-ppc.c (opd_entry_value): Read full symbol table when sym hashes unavailable.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf64-ppc.c9
2 files changed, 12 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index da9f409dc8..854beee0a5 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-23 Alan Modra <amodra@gmail.com>
+
+ PR binutils/13894
+ * elf64-ppc.c (opd_entry_value): Read full symbol table when
+ sym hashes unavailable.
+
2012-03-21 Eliot Dresselhaus <eliot@sonic.net>
* elf32-tic6x.c (elf32_tic6x_merge_private_bfd_data): Return TRUE
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index f4f5d0b0f6..e7a01c2215 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;