+2018-12-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-xc16x.c (elf32_xc16x_rtype_to_howto): New function.
+ (elf32_xc16x_relocate_section): Call elf32_xc16x_rtype_to_howto
+ instead of xc16x_reloc_type_lookup to get reloc_howto_type.
+
2018-12-07 H.J. Lu <hongjiu.lu@intel.com>
PR ld/23958
return NULL;
}
+static reloc_howto_type *
+elf32_xc16x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, unsigned r_type)
+{
+ if (r_type < ARRAY_SIZE (xc16x_elf_howto_table))
+ return & xc16x_elf_howto_table[r_type];
+
+ return NULL;
+}
+
/* For a particular operand this function is
called to finalise the type of relocation. */
or sections discarded by a linker script, we just want the
section contents cleared. Avoid any special processing. */
reloc_howto_type *howto;
- howto = xc16x_reloc_type_lookup (input_bfd, r_type);
+ howto = elf32_xc16x_rtype_to_howto (input_bfd, r_type);
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
rel, 1, relend, howto, 0, contents);
}