summaryrefslogtreecommitdiff
path: root/bfd/elf32-ip2k.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-ip2k.c')
-rw-r--r--bfd/elf32-ip2k.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index 79e1eccf38a..b77fd221cdf 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -1239,6 +1239,11 @@ ip2k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
+ if (r_type >= (unsigned int) R_IP2K_max)
+ {
+ _bfd_error_handler (_("%A: invalid IP2K reloc number: %d"), abfd, r_type);
+ r_type = 0;
+ }
cache_ptr->howto = & ip2k_elf_howto_table [r_type];
}