diff options
Diffstat (limited to 'bfd/elfn32-mips.c')
-rw-r--r-- | bfd/elfn32-mips.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index 08fbd4825dc..299ea4dc0b6 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -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 |