* elf-m10300.c (mn10300_elf_check_relocs): Delete dead code.
[deliverable/binutils-gdb.git] / bfd / elf32-mep.c
index aec3f66bac7a98064ae11b1b1871e42d75c6f7f6..d1ee6a96952c81024bccad8c54aee7120b4d9027 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   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/mep.h"
@@ -168,6 +169,20 @@ mep_reloc_type_lookup
 
 #undef MAP
 
+static reloc_howto_type *
+mep_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (mep_elf_howto_table) / sizeof (mep_elf_howto_table[0]);
+       i++)
+    if (mep_elf_howto_table[i].name != NULL
+       && strcasecmp (mep_elf_howto_table[i].name, r_name) == 0)
+      return &mep_elf_howto_table[i];
+
+  return NULL;
+}
 \f
 /* Perform a single relocation.  */
 
@@ -318,6 +333,8 @@ mep_final_link_relocate
       byte[3^e2] = ((u >> 16) & 0xff);
       break;
     case R_MEP_HI16S: /* ----------------vutsrqponmlkjihg */
+      if (s & 0x8000)
+       s += 0x10000;
       byte[2^e2] = ((s >> 24) & 0xff);
       byte[3^e2] = ((s >> 16) & 0xff);
       break;
@@ -736,6 +753,10 @@ mep_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;
 }
 
@@ -929,6 +950,7 @@ mep_elf_fake_sections (bfd *               abfd ATTRIBUTE_UNUSED,
 #define elf_backend_can_gc_sections            1
 
 #define bfd_elf32_bfd_reloc_type_lookup                mep_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup        mep_reloc_name_lookup
 #define bfd_elf32_bfd_set_private_flags                mep_elf_set_private_flags
 #define bfd_elf32_bfd_copy_private_bfd_data    mep_elf_copy_private_bfd_data
 #define bfd_elf32_bfd_merge_private_bfd_data   mep_elf_merge_private_bfd_data
This page took 0.024052 seconds and 4 git commands to generate.