aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-crx.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-crx.c')
-rw-r--r--bfd/elf32-crx.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/elf32-crx.c b/bfd/elf32-crx.c
index 90948bc..3d82da2 100644
--- a/bfd/elf32-crx.c
+++ b/bfd/elf32-crx.c
@@ -423,7 +423,13 @@ elf_crx_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
Elf_Internal_Rela *dst)
{
unsigned int r_type = ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (r_type < (unsigned int) R_CRX_MAX);
+ if (r_type >= R_CRX_MAX)
+ {
+ (*_bfd_error_handler) (_("%A: unrecognised CRX reloc number: %d"),
+ abfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ r_type = R_CRX_NONE;
+ }
cache_ptr->howto = &crx_elf_howto_table[r_type];
}