* elf32-m68k.c (rtype_to_howto): If the reloc index is out of
authorAndreas Schwab <schwab@linux-m68k.org>
Mon, 7 Sep 2009 16:29:34 +0000 (16:29 +0000)
committerAndreas Schwab <schwab@linux-m68k.org>
Mon, 7 Sep 2009 16:29:34 +0000 (16:29 +0000)
range call the bfd error hander and use R_68K_NONE instead.

bfd/ChangeLog
bfd/elf32-m68k.c

index 4a5d23562ecb40f8abbb70dd34fa6f5517053ff5..3fd72b41f2ea284bf3534db336f2b77a2afc45ad 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-07  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * elf32-m68k.c (rtype_to_howto): If the reloc index is out of
+       range call the bfd error hander and use R_68K_NONE instead.
+
 2009-09-07  Tristan Gingold  <gingold@adacore.com>
 
        * po/SRC-POTFILES.in: Regenerate.
index f85aba00c7ef671ab6690254f70efc1657e72e03..12379351c4dafcc0f119f5fddc1c64b370251523 100644 (file)
@@ -374,13 +374,17 @@ static reloc_howto_type howto_table[] = {
 };
 
 static void
-rtype_to_howto (abfd, cache_ptr, dst)
-     bfd *abfd ATTRIBUTE_UNUSED;
-     arelent *cache_ptr;
-     Elf_Internal_Rela *dst;
+rtype_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
 {
-  BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_68K_max);
-  cache_ptr->howto = &howto_table[ELF32_R_TYPE(dst->r_info)];
+  unsigned int indx = ELF32_R_TYPE (dst->r_info);
+
+  if (indx >= (unsigned int) R_68K_max)
+    {
+      (*_bfd_error_handler) (_("%B: invalid relocation type %d"),
+                            abfd, (int) indx);
+      indx = R_68K_NONE;
+    }
+  cache_ptr->howto = &howto_table[indx];
 }
 
 #define elf_info_to_howto rtype_to_howto
This page took 0.031119 seconds and 4 git commands to generate.