aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-m10200.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf-m10200.c')
-rw-r--r--bfd/elf-m10200.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c
index 82c4ee7..cc71c1e 100644
--- a/bfd/elf-m10200.c
+++ b/bfd/elf-m10200.c
@@ -212,16 +212,25 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
/* Set the howto pointer for an MN10200 ELF reloc. */
-static void
-mn10200_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+static bfd_boolean
+mn10200_info_to_howto (bfd *abfd,
arelent *cache_ptr,
Elf_Internal_Rela *dst)
{
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (r_type < (unsigned int) R_MN10200_MAX);
+ if (r_type >= (unsigned int) R_MN10200_MAX)
+ {
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+ abfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
cache_ptr->howto = &elf_mn10200_howto_table[r_type];
+ return cache_ptr->howto != NULL;
}
/* Perform a relocation as part of a final link. */
@@ -1378,7 +1387,7 @@ mn10200_elf_get_relocated_section_contents (bfd *output_bfd,
#define elf_backend_rela_normal 1
#define elf_info_to_howto mn10200_info_to_howto
-#define elf_info_to_howto_rel 0
+#define elf_info_to_howto_rel NULL
#define elf_backend_relocate_section mn10200_elf_relocate_section
#define bfd_elf32_bfd_relax_section mn10200_elf_relax_section
#define bfd_elf32_bfd_get_relocated_section_contents \