Prevent an out-of-bounds `elf32_frv_howto_table' table access in
`frv_info_to_howto_rela' by using the size of the table rather than
R_FRV_max to determine the number of entries in the contiguous regular
FRV relocation range defined and described in the table.
bfd/
* elf32-frv.c (frv_info_to_howto_rela): Correct the range check
for `elf32_frv_howto_table' table access.
+2018-04-04 Maciej W. Rozycki <macro@mips.com>
+
+ * elf32-frv.c (frv_info_to_howto_rela): Correct the range check
+ for `elf32_frv_howto_table' table access.
+
2018-04-04 Maciej W. Rozycki <macro@mips.com>
* elf32-mips.c (mips_elf32_rtype_to_howto): Also return
2018-04-04 Maciej W. Rozycki <macro@mips.com>
* elf32-mips.c (mips_elf32_rtype_to_howto): Also return
#include "elf/frv.h"
#include "dwarf2.h"
#include "hashtab.h"
#include "elf/frv.h"
#include "dwarf2.h"
#include "hashtab.h"
/* Forward declarations. */
/* Forward declarations. */
- if (r_type >= (unsigned int) R_FRV_max)
+ if (r_type >= ARRAY_SIZE (elf32_frv_howto_table))
{
/* xgettext:c-format */
_bfd_error_handler (_("%pB: unsupported relocation type %#x"),
{
/* xgettext:c-format */
_bfd_error_handler (_("%pB: unsupported relocation type %#x"),