+2021-05-13 Alan Modra <amodra@gmail.com>
+
+ PR 27858
+ * elf32-sh.c (sh_elf_info_to_howto): Correct check for last valid
+ reloc howto.
+
2021-05-12 Luis Machado <luis.machado@linaro.org>
* elf-bfd.h (elfcore_write_aarch_mte): New prototype.
r = ELF32_R_TYPE (dst->r_info);
- if (r >= R_SH_max
+ if (r >= R_SH_FIRST_INVALID_RELOC_6
|| (r >= R_SH_FIRST_INVALID_RELOC && r <= R_SH_LAST_INVALID_RELOC)
|| (r >= R_SH_FIRST_INVALID_RELOC_2 && r <= R_SH_LAST_INVALID_RELOC_2)
|| (r >= R_SH_FIRST_INVALID_RELOC_3 && r <= R_SH_LAST_INVALID_RELOC_3)
|| (r >= R_SH_FIRST_INVALID_RELOC_4 && r <= R_SH_LAST_INVALID_RELOC_4)
- || (r >= R_SH_FIRST_INVALID_RELOC_5 && r <= R_SH_LAST_INVALID_RELOC_5)
- || (r >= R_SH_FIRST_INVALID_RELOC_6 && r <= R_SH_LAST_INVALID_RELOC_6))
+ || (r >= R_SH_FIRST_INVALID_RELOC_5 && r <= R_SH_LAST_INVALID_RELOC_5))
{
/* xgettext:c-format */
_bfd_error_handler (_("%pB: unsupported relocation type %#x"),