2005-06-20 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 20 Jun 2005 12:59:49 +0000 (12:59 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 20 Jun 2005 12:59:49 +0000 (12:59 +0000)
PR 1025:
* elf32-i386.c (elf_i386_check_relocs): Handle indirect symbol.
* elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.

bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf64-x86-64.c

index 33073835a119bd5595b1afdbcfa2b165542a6fdc..0f4a949122f7940fb9b95f9b3d98c9b25025b340 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-20  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR 1025:
+       * elf32-i386.c (elf_i386_check_relocs): Handle indirect symbol.
+       * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
+
 2005-06-18  H.J. Lu  <hongjiu.lu@intel.com>
 
        * reloc.c: Add BFD_RELOC_X86_64_GOTOFF64 and
index 30270d3003e9bb2c84954faad7b67b6a26c83dd0..ce2f229d4c54574afb2823cf81652496e629156b 100644 (file)
@@ -911,7 +911,12 @@ elf_i386_check_relocs (bfd *abfd,
       if (r_symndx < symtab_hdr->sh_info)
        h = NULL;
       else
-       h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+       {
+         h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+         while (h->root.type == bfd_link_hash_indirect
+                || h->root.type == bfd_link_hash_warning)
+           h = (struct elf_link_hash_entry *) h->root.u.i.link;
+       }
 
       r_type = elf_i386_tls_transition (info, r_type, h == NULL);
 
index f63fd03ea4496a32e83338d7c39f5dbc18704029..aaf13083bdf82566a909f70a4862c21af1ded0dd 100644 (file)
@@ -664,7 +664,12 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
       if (r_symndx < symtab_hdr->sh_info)
        h = NULL;
       else
-       h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+       {
+         h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+         while (h->root.type == bfd_link_hash_indirect
+                || h->root.type == bfd_link_hash_warning)
+           h = (struct elf_link_hash_entry *) h->root.u.i.link;
+       }
 
       r_type = elf64_x86_64_tls_transition (info, r_type, h == NULL);
       switch (r_type)