ld: Add --enable-separate-code
[deliverable/binutils-gdb.git] / bfd / elf32-i960.c
index 69d97440fdac73f7f25c8c17b177c90d69c8b51d..244e4eaf2505c1d7d7c7998132a00749de769855 100644 (file)
@@ -1,5 +1,5 @@
 /* Intel 960 specific support for 32-bit ELF
-   Copyright (C) 1999-2014 Free Software Foundation, Inc.
+   Copyright (C) 1999-2018 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -29,7 +29,7 @@
 #define bfd_elf32_bfd_reloc_type_lookup        elf32_i960_reloc_type_lookup
 #define bfd_elf32_bfd_reloc_name_lookup \
   elf32_i960_reloc_name_lookup
-#define elf_info_to_howto              elf32_i960_info_to_howto
+#define elf_info_to_howto              NULL
 #define elf_info_to_howto_rel          elf32_i960_info_to_howto_rel
 
 /* ELF relocs are against symbols.  If we are producing relocatable
@@ -83,7 +83,7 @@ elf32_i960_relocate (bfd *abfd ATTRIBUTE_UNUSED,
 
 static reloc_howto_type elf_howto_table[]=
 {
-  HOWTO (R_960_NONE, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
+  HOWTO (R_960_NONE, 0, 3, 0, FALSE, 0, complain_overflow_dont,
         elf32_i960_relocate, "R_960_NONE", TRUE,
         0x00000000, 0x00000000, FALSE),
   EMPTY_HOWTO (1),
@@ -116,15 +116,7 @@ elf32_i960_bfd_to_reloc_type (bfd_reloc_code_real_type code)
     }
 }
 
-static void
-elf32_i960_info_to_howto (bfd *               abfd ATTRIBUTE_UNUSED,
-                         arelent *           cache_ptr ATTRIBUTE_UNUSED,
-                         Elf_Internal_Rela * dst ATTRIBUTE_UNUSED)
-{
-  abort ();
-}
-
-static void
+static bfd_boolean
 elf32_i960_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
                              arelent *cache_ptr,
                              Elf_Internal_Rela *dst)
@@ -132,9 +124,19 @@ elf32_i960_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
   enum elf_i960_reloc_type type;
 
   type = (enum elf_i960_reloc_type) ELF32_R_TYPE (dst->r_info);
-  BFD_ASSERT (type < R_960_max);
+
+  /* PR 17521: file: 9609b8d6.  */
+  if (type >= R_960_max)
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+                         abfd, type);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
 
   cache_ptr->howto = &elf_howto_table[(int) type];
+  return TRUE;
 }
 
 static reloc_howto_type *
@@ -158,10 +160,10 @@ elf32_i960_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
   return NULL;
 }
 
-#define TARGET_LITTLE_SYM      bfd_elf32_i960_vec
+#define TARGET_LITTLE_SYM      i960_elf32_vec
 #define TARGET_LITTLE_NAME     "elf32-i960"
 #define ELF_ARCH               bfd_arch_i960
 #define ELF_MACHINE_CODE       EM_960
-#define ELF_MAXPAGESIZE        1 /* FIXME: This number is wrong,  It should be the page size in bytes.  */
+#define ELF_MAXPAGESIZE                1 /* FIXME: This number is wrong,  It should be the page size in bytes.  */
 
 #include "elf32-target.h"
This page took 0.023562 seconds and 4 git commands to generate.