Fallout from recent bfd_reloc_outofrange changes
[deliverable/binutils-gdb.git] / bfd / elfn32-mips.c
index 08fbd4825dcfed8d504942b9795959f7012ee0e4..504c3f39c69a46340ab885e7f3ae7f52a5b9debe 100644 (file)
@@ -108,7 +108,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] =
   /* No relocation.  */
   HOWTO (R_MIPS_NONE,          /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
@@ -3403,7 +3403,12 @@ mips_elf_n32_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p)
          else
            return &elf_mips16_howto_table_rel[r_type - R_MIPS16_min];
        }
-      BFD_ASSERT (r_type < (unsigned int) R_MIPS_max);
+      if (r_type >= R_MIPS_max)
+       {
+         (*_bfd_error_handler) (_("unrecognised MIPS reloc number: %d"), r_type);
+         bfd_set_error (bfd_error_bad_value);
+         r_type = R_MIPS_NONE;
+       }
       if (rela_p)
        return &elf_mips_howto_table_rela[r_type];
       else
This page took 0.027316 seconds and 4 git commands to generate.