aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-iq2000.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-iq2000.c')
-rw-r--r--bfd/elf32-iq2000.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index a6bf8d2..75f50a2 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -435,6 +435,11 @@ iq2000_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
break;
default:
+ if (r_type >= (unsigned int) R_IQ2000_max)
+ {
+ _bfd_error_handler (_("%A: invalid IQ2000 reloc number: %d"), abfd, r_type);
+ r_type = 0;
+ }
cache_ptr->howto = & iq2000_elf_howto_table [r_type];
break;
}