From 4f3b23b390640efdc36c575dbda2175e61154bc9 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 21 Apr 2016 15:43:00 +0100 Subject: 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. --- bfd/targets.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bfd/targets.c') diff --git a/bfd/targets.c b/bfd/targets.c index 50f3712..a9edd4c 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -452,6 +452,7 @@ BFD_JUMP_TABLE macros. . NAME##_bfd_copy_link_hash_symbol_type, \ . NAME##_bfd_final_link, \ . NAME##_bfd_link_split_section, \ +. NAME##_bfd_link_check_relocs, \ . NAME##_bfd_gc_sections, \ . NAME##_bfd_lookup_section_flags, \ . NAME##_bfd_merge_sections, \ @@ -493,6 +494,9 @@ BFD_JUMP_TABLE macros. . {* Should this section be split up into smaller pieces during linking. *} . bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); . +. {* Check the relocations in the bfd for validity. *} +. bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); +. . {* Remove sections that are not referenced from the output. *} . bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); . -- cgit v1.1