Initialize count_ field, tweak parameters testing.
[deliverable/binutils-gdb.git] / bfd / elf32-iq2000.c
index 1ca96a02ba0ba0bb22fc78465f7de04be4ad0666..566bebded9cd173834cf22dbb8bb292a68e19b85 100644 (file)
@@ -6,7 +6,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -18,8 +18,8 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#include "bfd.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "libbfd.h"
 #include "elf-bfd.h"
 #include "elf/iq2000.h"
@@ -350,6 +350,26 @@ iq2000_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
   return NULL;
 }
 
+static reloc_howto_type *
+iq2000_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (iq2000_elf_howto_table)
+           / sizeof (iq2000_elf_howto_table[0]));
+       i++)
+    if (iq2000_elf_howto_table[i].name != NULL
+       && strcasecmp (iq2000_elf_howto_table[i].name, r_name) == 0)
+      return &iq2000_elf_howto_table[i];
+
+  if (strcasecmp (iq2000_elf_vtinherit_howto.name, r_name) == 0)
+    return &iq2000_elf_vtinherit_howto;
+  if (strcasecmp (iq2000_elf_vtentry_howto.name, r_name) == 0)
+    return &iq2000_elf_vtentry_howto;
+
+  return NULL;
+}
 \f
 /* Perform a single relocation.         By default we use the standard BFD
    routines.  */
@@ -716,6 +736,10 @@ iq2000_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
 
   elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
   elf_flags_init (obfd) = TRUE;
+
+  /* Copy object attributes.  */
+  _bfd_elf_copy_obj_attributes (ibfd, obfd);
+
   return TRUE;
 }
 
@@ -864,6 +888,7 @@ iq2000_elf_object_p (bfd *abfd)
 #define elf_backend_can_gc_sections            1
 
 #define bfd_elf32_bfd_reloc_type_lookup                iq2000_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup        iq2000_reloc_name_lookup
 #define bfd_elf32_bfd_set_private_flags                iq2000_elf_set_private_flags
 #define bfd_elf32_bfd_copy_private_bfd_data    iq2000_elf_copy_private_bfd_data
 #define bfd_elf32_bfd_merge_private_bfd_data   iq2000_elf_merge_private_bfd_data
This page took 0.025804 seconds and 4 git commands to generate.