daily update
[deliverable/binutils-gdb.git] / bfd / elf32-iq2000.c
index 5dc781de33a7bef3d27e95c98f81a2badabbb125..146dcaaecaf42a0d94719340dcc52e6e38da1e34 100644 (file)
@@ -1,5 +1,5 @@
 /* IQ2000-specific support for 32-bit ELF.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include "bfd.h"
 #include "sysdep.h"
@@ -234,30 +234,6 @@ static reloc_howto_type iq2000_elf_vtentry_howto =
         FALSE);                   /* pcrel_offset */
 
 \f
-/* Map BFD reloc types to IQ2000 ELF reloc types.  */
-
-struct iq2000_reloc_map
-{
-  bfd_reloc_code_real_type bfd_reloc_val;
-  unsigned int iq2000_reloc_val;
-};
-
-static const struct iq2000_reloc_map iq2000_reloc_map [] =
-{
-  { BFD_RELOC_NONE,           R_IQ2000_NONE },
-  { BFD_RELOC_16,             R_IQ2000_16 },
-  { BFD_RELOC_32,             R_IQ2000_32 },
-  { BFD_RELOC_MIPS_JMP,               R_IQ2000_26 },
-  { BFD_RELOC_16_PCREL_S2,     R_IQ2000_PC16 },
-  { BFD_RELOC_HI16,           R_IQ2000_HI16 },
-  { BFD_RELOC_LO16,           R_IQ2000_LO16 },
-  { BFD_RELOC_IQ2000_OFFSET_16,R_IQ2000_OFFSET_16 },
-  { BFD_RELOC_IQ2000_OFFSET_21,R_IQ2000_OFFSET_21 },
-  { BFD_RELOC_IQ2000_UHI16,    R_IQ2000_UHI16 },
-  { BFD_RELOC_VTABLE_INHERIT,  R_IQ2000_GNU_VTINHERIT },
-  { BFD_RELOC_VTABLE_ENTRY,    R_IQ2000_GNU_VTENTRY },
-};
-
 static bfd_reloc_status_type
 iq2000_elf_howto_hi16_reloc (bfd *abfd ATTRIBUTE_UNUSED,
                             arelent *reloc_entry,
@@ -329,10 +305,11 @@ iq2000_elf_relocate_hi16 (bfd *input_bfd,
   return bfd_reloc_ok;
 }
 
+/* Map BFD reloc types to IQ2000 ELF reloc types.  */
+
 static reloc_howto_type *
-iq2000_reloc_type_lookup (abfd, code)
-     bfd * abfd ATTRIBUTE_UNUSED;
-     bfd_reloc_code_real_type code;
+iq2000_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+                         bfd_reloc_code_real_type code)
 {
   /* Note that the iq2000_elf_howto_table is indxed by the R_
      constants.         Thus, the order that the howto records appear in the
@@ -450,7 +427,12 @@ iq2000_elf_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;
+       }
       
       switch (ELF32_R_TYPE (rel->r_info))
        {
This page took 0.037968 seconds and 4 git commands to generate.