aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-spu.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-spu.c')
-rw-r--r--bfd/elf32-spu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index ace7c29..21fd856 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -151,7 +151,14 @@ spu_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
enum elf_spu_reloc_type r_type;
r_type = (enum elf_spu_reloc_type) ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (r_type < R_SPU_max);
+ /* PR 17512: file: 90c2a92e. */
+ if (r_type >= R_SPU_max)
+ {
+ (*_bfd_error_handler) (_("%A: unrecognised SPU reloc number: %d"),
+ abfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ r_type = R_SPU_NONE;
+ }
cache_ptr->howto = &elf_howto_table[(int) r_type];
}