aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-cr16.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-cr16.c')
-rw-r--r--bfd/elf32-cr16.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c
index dafbc08..7b9976a 100644
--- a/bfd/elf32-cr16.c
+++ b/bfd/elf32-cr16.c
@@ -673,7 +673,13 @@ elf_cr16_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
{
unsigned int r_type = ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (r_type < (unsigned int) R_CR16_MAX);
+ if (r_type >= R_CR16_MAX)
+ {
+ (*_bfd_error_handler) (_("%A: unrecognised CR16 reloc number: %d"),
+ abfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ r_type = R_CR16_NONE;
+ }
cache_ptr->howto = cr16_elf_howto_table + r_type;
}