OSDN Git Service

Switch sources over to use the GPL version 3
[pf3gnuchains/pf3gnuchains4x.git] / bfd / elf32-mt.c
index 0b2bb26..9896a20 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,
 
    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., 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA.  */
 
-#include "bfd.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "libbfd.h"
 #include "elf-bfd.h"
 #include "elf/mt.h"
@@ -187,6 +188,22 @@ mt_reloc_type_lookup
   return NULL;
 }
 
+static reloc_howto_type *
+mt_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+                     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (mt_elf_howto_table) / sizeof (mt_elf_howto_table[0]);
+       i++)
+    if (mt_elf_howto_table[i].name != NULL
+       && strcasecmp (mt_elf_howto_table[i].name, r_name) == 0)
+      return &mt_elf_howto_table[i];
+
+  return NULL;
+}
+
 bfd_reloc_status_type
 mt_elf_relocate_hi16
     (bfd *               input_bfd,
@@ -499,6 +516,10 @@ mt_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;
 }
 
@@ -592,6 +613,7 @@ mt_elf_print_private_bfd_data (bfd * abfd, void * ptr)
 #define elf_backend_relocate_section           mt_elf_relocate_section
 
 #define bfd_elf32_bfd_reloc_type_lookup                mt_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup   mt_reloc_name_lookup
 
 #define elf_backend_check_relocs                mt_elf_check_relocs
 #define elf_backend_object_p                   mt_elf_object_p