(bfd_vma) 0, input_bfd, input_section, rel->r_offset);
else
{
- _bfd_error_handler
- /* xgettext:c-format */
- (_("%pB(%pA+%#" PRIx64 "): reloc against `%s': error %d"),
- input_bfd, input_section,
- (uint64_t) rel->r_offset, name, (int) r);
+ _bfd_x86_elf_link_report_relocation_error (input_bfd,
+ input_section,
+ name, rel,
+ howto, r);
return false;
}
}
}
else
{
- _bfd_error_handler
- /* xgettext:c-format */
- (_("%pB(%pA+%#" PRIx64 "): reloc against `%s': error %d"),
- input_bfd, input_section,
- (uint64_t) rel->r_offset, name, (int) r);
+ _bfd_x86_elf_link_report_relocation_error (input_bfd,
+ input_section,
+ name, rel,
+ howto, r);
return false;
}
}
bfd_set_error (bfd_error_bad_value);
}
+/* Report link relocation error. */
+
+void
+_bfd_x86_elf_link_report_relocation_error (bfd *abfd, asection *sec,
+ const char *name,
+ Elf_Internal_Rela *rel,
+ reloc_howto_type *howto,
+ bfd_reloc_status_type status)
+{
+ const char *error_msg;
+
+ switch (status)
+ {
+ case bfd_reloc_outofrange:
+ error_msg = _("out of section range");
+ break;
+
+ case bfd_reloc_notsupported:
+ error_msg = _("not supported");
+ break;
+
+ default:
+ abort ();
+ }
+
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB(%pA+%#" PRIx64 "): relocation `%s' against `%s': %s"),
+ abfd, sec, (uint64_t) rel->r_offset, howto->name, name, error_msg);
+}
+
/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */
bool
Elf_Internal_Sym *, reloc_howto_type *,
enum elf_x86_error_type) ATTRIBUTE_HIDDEN;
+extern void _bfd_x86_elf_link_report_relocation_error
+ (bfd *, asection *, const char *, Elf_Internal_Rela *,
+ reloc_howto_type *, bfd_reloc_status_type) ATTRIBUTE_HIDDEN;
+
extern bool
_bfd_elf_x86_copy_special_section_fields
(const bfd *, bfd *, const Elf_Internal_Shdr *,