/* Set the howto pointer for an M32R ELF reloc. */
-static void
+static bfd_boolean
m32r_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
arelent *cache_ptr,
Elf_Internal_Rela *dst)
if (r_type > (unsigned int) R_M32R_GNU_VTENTRY)
{
/* xgettext:c-format */
- _bfd_error_handler (_("%pB: invalid M32R reloc number: %d"), abfd, r_type);
- r_type = 0;
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+ abfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
}
cache_ptr->howto = &m32r_elf_howto_table[r_type];
+ return TRUE;
}
-static void
+static bfd_boolean
m32r_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
arelent *cache_ptr,
Elf_Internal_Rela *dst)
{
- BFD_ASSERT ((ELF32_R_TYPE(dst->r_info) == (unsigned int) R_M32R_NONE)
- || ((ELF32_R_TYPE(dst->r_info) > (unsigned int) R_M32R_GNU_VTENTRY)
- && (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_M32R_max)));
- cache_ptr->howto = &m32r_elf_howto_table[ELF32_R_TYPE(dst->r_info)];
+ unsigned int r_type = ELF32_R_TYPE (dst->r_info);
+
+ if (r_type == (unsigned int) R_M32R_NONE
+ || ((r_type > (unsigned int) R_M32R_GNU_VTENTRY)
+ && (r_type < (unsigned int) R_M32R_max)))
+ {
+ cache_ptr->howto = &m32r_elf_howto_table[r_type];
+ return TRUE;
+ }
+
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
}
\f
if (r_type < 0 || r_type >= (int) R_M32R_max)
{
/* xgettext:c-format */
- _bfd_error_handler (_("%pB: unknown relocation type %d"),
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
input_bfd, (int) r_type);
bfd_set_error (bfd_error_bad_value);
ret = FALSE;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: The target (%s) of an %s relocation is in the wrong section (%pA)"),
+ (_("%pB: the target (%s) of an %s relocation"
+ " is in the wrong section (%pA)"),
input_bfd,
sym_name,
m32r_elf_howto_table[(int) r_type].name,
|| ((in_flags & EF_M32R_ARCH) == E_M32R2_ARCH))
{
_bfd_error_handler
- (_("%pB: Instruction set mismatch with previous modules"), ibfd);
+ (_("%pB: instruction set mismatch with previous modules"), ibfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;