Add support for non-ELF targets to check their relocs.

bfd	* aout-adobe.c: Use _bfd_generic_link_check_relocs.
	* aout-target.h: Likewise.
	* aout-tic30.c: Likewise.
	* binary.c: Likewise.
	* bout.c: Likewise.
	* coff-alpha.c: Likewise.
	* coff-rs6000.c: Likewise.
	* coff64-rs6000.c: Likewise.
	* coffcode.h: Likewise.
	* i386msdos.c: Likewise.
	* i386os9k.c: Likewise.
	* ieee.c: Likewise.
	* ihex.c: Likewise.
	* libbfd-in.h: Likewise.
	* libecoff.h: Likewise.
	* mach-o-target.c: Likewise.
	* mmo.c: Likewise.
	* nlm-target.h: Likewise.
	* oasys.c: Likewise.
	* pef.c: Likewise.
	* plugin.c: Likewise.
	* ppcboot.c: Likewise.
	* som.c: Likewise.
	* srec.c: Likewise.
	* tekhex.c: Likewise.
	* versados.c: Likewise.
	* vms-alpha.c: Likewise.
	* xsym.c: Likewise.
	* elfxx-target.h: Use _bfd_elf_link_check_relocs.
	* linker.c (bfd_link_check_relocs): New function.
	(_bfd_generic_link_check_relocs): New function.
	* targets.c (BFD_JUMP_TABLE_LINK): Add initialization of
	_bfd_link_check_relocs field.
	(struct bfd_target)L Add _bfd_link_check_relocs field.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

ld	* ldlang.c (lang_check_relocs): Use bfd_link_check_relocs in
	prefernce to _bfd_elf_link_check_relocs.  Drop test for ELF
	targets.  Do not stop the checks when problems are encountered.

include	* bfdlink.h: Add prototype for bfd_link_check_relocs.
This commit is contained in:
Nick Clifton 2016-04-21 15:43:00 +01:00
parent 71829b1a3f
commit 4f3b23b390
38 changed files with 164 additions and 13 deletions

View file

@ -6783,18 +6783,19 @@ lang_add_gc_name (const char * name)
static void
lang_check_relocs (void)
{
if (link_info.check_relocs_after_open_input
&& bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour)
if (link_info.check_relocs_after_open_input)
{
bfd *abfd;
for (abfd = link_info.input_bfds;
abfd != (bfd *) NULL; abfd = abfd->link.next)
if (!_bfd_elf_link_check_relocs (abfd, &link_info))
if (!bfd_link_check_relocs (abfd, &link_info))
{
/* no object output, fail return */
/* No object output, fail return. */
config.make_executable = FALSE;
break;
/* Note: we do not abort the loop, but rather
continue the scan in case there are other
bad relocations to report. */
}
}
}