summaryrefslogtreecommitdiff
path: root/bfd/elf-m10300.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf-m10300.c')
-rw-r--r--bfd/elf-m10300.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index 6a18b44eadd..52457ed6e85 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -806,7 +806,13 @@ mn10300_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (r_type < (unsigned int) R_MN10300_MAX);
+ if (r_type >= R_MN10300_MAX)
+ {
+ (*_bfd_error_handler) (_("%A: unrecognised MN10300 reloc number: %d"),
+ abfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ r_type = R_MN10300_NONE;
+ }
cache_ptr->howto = elf_mn10300_howto_table + r_type;
}