PR binutils/13894
authorAlan Modra <amodra@gmail.com>
Fri, 23 Mar 2012 06:41:21 +0000 (06:41 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 23 Mar 2012 06:41:21 +0000 (06:41 +0000)
* elf64-ppc.c (opd_entry_value): Read full symbol table when
sym hashes unavailable.

bfd/ChangeLog
bfd/elf64-ppc.c

index da9f409dc83a0c02f48aa65bddf0ac00328306b5..854beee0a54c43216964ecd3a8be43df4f1087f1 100644 (file)
@@ -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
index f4f5d0b0f647b26f550cbb808a838464a777f022..e7a01c2215e6a319c7a6c1a72a52537ac801d7b0 100644 (file)
@@ -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;