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

@ -1,3 +1,42 @@
2016-04-21 Nick Clifton <nickc@redhat.com>
* 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.
2016-04-20 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_gc_sweep_hook): Removed.

View File

@ -472,6 +472,7 @@ aout_adobe_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED,
_bfd_generic_copy_link_hash_symbol_type
#define aout_32_bfd_final_link _bfd_generic_final_link
#define aout_32_bfd_link_split_section _bfd_generic_link_split_section
#define aout_32_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target aout_adobe_vec =
{

View File

@ -542,6 +542,10 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
#define MY_bfd_link_split_section _bfd_generic_link_split_section
#endif
#ifndef MY_bfd_link_check_relocs
#define MY_bfd_link_check_relocs _bfd_generic_link_check_relocs
#endif
#ifndef MY_bfd_copy_private_bfd_data
#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#endif

View File

@ -997,6 +997,10 @@ tic30_aout_set_arch_mach (bfd *abfd,
#define MY_bfd_link_split_section _bfd_generic_link_split_section
#endif
#ifndef MY_bfd_link_check_relocs
#define MY_bfd_link_check_relocs _bfd_generic_link_check_relocs
#endif
#ifndef MY_bfd_copy_private_bfd_data
#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#endif

View File

@ -7413,6 +7413,7 @@ typedef struct bfd_target
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, \
@ -7454,6 +7455,9 @@ typedef struct bfd_target
/* 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 *);
@ -7566,6 +7570,12 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym
bfd_boolean bfd_hide_sym_by_version
(struct bfd_elf_version_tree *verdefs, const char *sym_name);
bfd_boolean bfd_link_check_relocs
(bfd *abfd, struct bfd_link_info *info);
bfd_boolean _bfd_generic_link_check_relocs
(bfd *abfd, struct bfd_link_info *info);
/* Extracted from simple.c. */
bfd_byte *bfd_simple_get_relocated_section_contents
(bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);

View File

@ -309,12 +309,12 @@ binary_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
#define binary_bfd_define_common_symbol bfd_generic_define_common_symbol
#define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define binary_bfd_link_just_syms _bfd_generic_link_just_syms
#define binary_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
#define binary_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
#define binary_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define binary_bfd_final_link _bfd_generic_final_link
#define binary_bfd_link_split_section _bfd_generic_link_split_section
#define binary_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
#define binary_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target binary_vec =
{

View File

@ -1393,6 +1393,7 @@ b_out_bfd_get_relocated_section_contents (bfd *output_bfd,
#define b_out_section_already_linked _bfd_generic_section_already_linked
#define b_out_bfd_define_common_symbol bfd_generic_define_common_symbol
#define aout_32_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
#define b_out_bfd_link_check_relocs _bfd_generic_link_check_relocs
extern const bfd_target bout_le_vec;

View File

@ -2351,6 +2351,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
#define _bfd_ecoff_section_already_linked \
_bfd_coff_section_already_linked
#define _bfd_ecoff_bfd_define_common_symbol bfd_generic_define_common_symbol
#define _bfd_ecoff_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target alpha_ecoff_le_vec =
{

View File

@ -4014,6 +4014,7 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = {
#define _bfd_xcoff_bfd_discard_group bfd_generic_discard_group
#define _bfd_xcoff_section_already_linked _bfd_generic_section_already_linked
#define _bfd_xcoff_bfd_define_common_symbol _bfd_xcoff_define_common_symbol
#define _bfd_xcoff_bfd_link_check_relocs _bfd_generic_link_check_relocs
/* For dynamic symbols and relocs entry points. */
#define _bfd_xcoff_get_synthetic_symtab _bfd_nodynamic_get_synthetic_symtab

View File

@ -2741,6 +2741,7 @@ const bfd_target rs6000_xcoff64_vec =
_bfd_generic_copy_link_hash_symbol_type,
_bfd_xcoff_bfd_final_link,
_bfd_generic_link_split_section,
_bfd_generic_link_check_relocs,
bfd_generic_gc_sections,
bfd_generic_lookup_section_flags,
bfd_generic_merge_sections,
@ -2999,6 +3000,7 @@ const bfd_target rs6000_xcoff64_aix_vec =
_bfd_generic_copy_link_hash_symbol_type,
_bfd_xcoff_bfd_final_link,
_bfd_generic_link_split_section,
_bfd_generic_link_check_relocs,
bfd_generic_gc_sections,
bfd_generic_lookup_section_flags,
bfd_generic_merge_sections,

View File

@ -5480,6 +5480,8 @@ dummy_reloc16_extra_cases (bfd *abfd ATTRIBUTE_UNUSED,
_bfd_generic_copy_link_hash_symbol_type
#define coff_bfd_link_split_section _bfd_generic_link_split_section
#define coff_bfd_link_check_relocs _bfd_generic_link_check_relocs
#ifndef coff_start_final_link
#define coff_start_final_link NULL
#endif

View File

@ -287,6 +287,10 @@
#define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section
#endif
#ifndef bfd_elfNN_bfd_link_check_relocs
#define bfd_elfNN_bfd_link_check_relocs _bfd_elf_link_check_relocs
#endif
#ifndef bfd_elfNN_archive_p
#define bfd_elfNN_archive_p bfd_generic_archive_p
#endif

View File

@ -157,6 +157,7 @@ msdos_set_section_contents (bfd *abfd,
#define msdos_bfd_final_link _bfd_generic_final_link
#define msdos_bfd_link_split_section _bfd_generic_link_split_section
#define msdos_set_arch_mach _bfd_generic_set_arch_mach
#define msdos_bfd_link_check_relocs _bfd_generic_link_check_relocs
#define msdos_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound
#define msdos_canonicalize_symtab _bfd_nosymbols_canonicalize_symtab

View File

@ -183,6 +183,7 @@ os9k_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
_bfd_generic_copy_link_hash_symbol_type
#define os9k_bfd_final_link _bfd_generic_final_link
#define os9k_bfd_link_split_section _bfd_generic_link_split_section
#define os9k_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target i386_aout_os9k_vec =
{

View File

@ -3863,6 +3863,7 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
_bfd_generic_copy_link_hash_symbol_type
#define ieee_bfd_final_link _bfd_generic_final_link
#define ieee_bfd_link_split_section _bfd_generic_link_split_section
#define ieee_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target ieee_vec =
{

View File

@ -940,10 +940,10 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
#define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define ihex_bfd_link_just_syms _bfd_generic_link_just_syms
#define ihex_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
#define ihex_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
#define ihex_bfd_final_link _bfd_generic_final_link
#define ihex_bfd_link_split_section _bfd_generic_link_split_section
#define ihex_bfd_link_check_relocs _bfd_generic_link_check_relocs
/* The Intel Hex target vector. */

View File

@ -499,6 +499,8 @@ extern bfd_boolean _bfd_generic_set_section_contents
#define _bfd_nolink_bfd_define_common_symbol \
((bfd_boolean (*) (bfd *, struct bfd_link_info *, \
struct bfd_link_hash_entry *)) bfd_false)
#define _bfd_nolink_bfd_link_check_relocs \
_bfd_generic_link_check_relocs
/* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not
have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC

View File

@ -504,6 +504,8 @@ extern bfd_boolean _bfd_generic_set_section_contents
#define _bfd_nolink_bfd_define_common_symbol \
((bfd_boolean (*) (bfd *, struct bfd_link_info *, \
struct bfd_link_hash_entry *)) bfd_false)
#define _bfd_nolink_bfd_link_check_relocs \
_bfd_generic_link_check_relocs
/* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not
have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC

View File

@ -242,6 +242,7 @@ extern bfd_boolean _bfd_ecoff_get_section_contents
(bfd *, asection *, void * location, file_ptr, bfd_size_type);
#define _bfd_ecoff_bfd_link_split_section _bfd_generic_link_split_section
#define _bfd_ecoff_bfd_link_check_relocs _bfd_generic_link_check_relocs
extern bfd_boolean _bfd_ecoff_bfd_copy_private_bfd_data
(bfd *, bfd *);

View File

@ -3304,3 +3304,46 @@ bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs,
bfd_find_version_for_sym (verdefs, sym_name, &hidden);
return hidden;
}
/*
FUNCTION
bfd_link_check_relocs
SYNOPSIS
bfd_boolean bfd_link_check_relocs
(bfd *abfd, struct bfd_link_info *info);
DESCRIPTION
Checks the relocs in ABFD for validity.
Does not execute the relocs.
Return TRUE if everything is OK, FALSE otherwise.
This is the external entry point to this code.
*/
bfd_boolean
bfd_link_check_relocs (bfd *abfd, struct bfd_link_info *info)
{
return BFD_SEND (abfd, _bfd_link_check_relocs, (abfd, info));
}
/*
FUNCTION
_bfd_generic_link_check_relocs
SYNOPSIS
bfd_boolean _bfd_generic_link_check_relocs
(bfd *abfd, struct bfd_link_info *info);
DESCRIPTION
Stub function for targets that do not implement reloc checking.
Return TRUE.
This is an internal function. It should not be called from
outside the BFD library.
*/
bfd_boolean
_bfd_generic_link_check_relocs (bfd *abfd ATTRIBUTE_UNUSED,
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
return TRUE;
}

View File

@ -44,6 +44,7 @@
_bfd_generic_copy_link_hash_symbol_type
#define bfd_mach_o_bfd_final_link _bfd_generic_final_link
#define bfd_mach_o_bfd_link_split_section _bfd_generic_link_split_section
#define bfd_mach_o_bfd_link_check_relocs _bfd_generic_link_check_relocs
#define bfd_mach_o_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
#define bfd_mach_o_bfd_set_private_flags bfd_mach_o_bfd_set_private_flags
#define bfd_mach_o_get_section_contents _bfd_generic_get_section_contents

View File

@ -3278,6 +3278,7 @@ mmo_write_object_contents (bfd *abfd)
_bfd_generic_copy_link_hash_symbol_type
#define mmo_bfd_final_link _bfd_generic_final_link
#define mmo_bfd_link_split_section _bfd_generic_link_split_section
#define mmo_bfd_link_check_relocs _bfd_generic_link_check_relocs
/* Strictly speaking, only MMIX uses this restricted format, but let's not
stop anybody from shooting themselves in the foot. */

View File

@ -59,6 +59,7 @@
_bfd_generic_copy_link_hash_symbol_type
#define nlm_bfd_final_link _bfd_generic_final_link
#define nlm_bfd_link_split_section _bfd_generic_link_split_section
#define nlm_bfd_link_check_relocs _bfd_generic_link_check_relocs
/* This structure contains everything that BFD knows about a target.
It includes things like its byte order, name, what routines to call

View File

@ -1192,6 +1192,7 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
_bfd_generic_copy_link_hash_symbol_type
#define oasys_bfd_final_link _bfd_generic_final_link
#define oasys_bfd_link_split_section _bfd_generic_link_split_section
#define oasys_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target oasys_vec =
{

View File

@ -67,6 +67,7 @@
#define bfd_pef_bfd_final_link _bfd_generic_final_link
#define bfd_pef_bfd_link_split_section _bfd_generic_link_split_section
#define bfd_pef_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
#define bfd_pef_bfd_link_check_relocs _bfd_generic_link_check_relocs
static int
bfd_pef_parse_traceback_table (bfd *abfd,

View File

@ -106,6 +106,7 @@ dlerror (void)
#define bfd_plugin_section_already_linked _bfd_generic_section_already_linked
#define bfd_plugin_bfd_define_common_symbol bfd_generic_define_common_symbol
#define bfd_plugin_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
#define bfd_plugin_bfd_link_check_relocs _bfd_generic_link_check_relocs
static enum ld_plugin_status
message (int level ATTRIBUTE_UNUSED,

View File

@ -465,6 +465,7 @@ ppcboot_bfd_print_private_bfd_data (bfd *abfd, void * farg)
#define ppcboot_bfd_link_split_section _bfd_generic_link_split_section
#define ppcboot_get_section_contents_in_window \
_bfd_generic_get_section_contents_in_window
#define ppcboot_bfd_link_check_relocs _bfd_generic_link_check_relocs
#define ppcboot_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#define ppcboot_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data

View File

@ -6758,6 +6758,7 @@ som_bfd_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
#define som_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
#define som_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
#define som_find_inliner_info _bfd_nosymbols_find_inliner_info
#define som_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target hppa_som_vec =
{

View File

@ -1275,10 +1275,10 @@ srec_print_symbol (bfd *abfd,
#define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define srec_bfd_link_just_syms _bfd_generic_link_just_syms
#define srec_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
#define srec_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
#define srec_bfd_final_link _bfd_generic_final_link
#define srec_bfd_link_split_section _bfd_generic_link_split_section
#define srec_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target srec_vec =
{

View File

@ -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 *);
.

View File

@ -980,11 +980,11 @@ tekhex_print_symbol (bfd *abfd,
#define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define tekhex_bfd_link_just_syms _bfd_generic_link_just_syms
#define tekhex_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
#define tekhex_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
#define tekhex_bfd_final_link _bfd_generic_final_link
#define tekhex_bfd_link_split_section _bfd_generic_link_split_section
#define tekhex_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
#define tekhex_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target tekhex_vec =
{

View File

@ -873,6 +873,7 @@ versados_canonicalize_reloc (bfd *abfd,
_bfd_generic_copy_link_hash_symbol_type
#define versados_bfd_final_link _bfd_generic_final_link
#define versados_bfd_link_split_section _bfd_generic_link_split_section
#define versados_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target m68k_versados_vec =
{

View File

@ -9260,6 +9260,7 @@ bfd_vms_get_data (bfd *abfd)
_bfd_nodynamic_get_dynamic_reloc_upper_bound
#define alpha_vms_canonicalize_dynamic_reloc \
_bfd_nodynamic_canonicalize_dynamic_reloc
#define alpha_vms_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target alpha_vms_vec =
{

View File

@ -59,6 +59,7 @@
#define bfd_sym_bfd_final_link _bfd_generic_final_link
#define bfd_sym_bfd_link_split_section _bfd_generic_link_split_section
#define bfd_sym_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
#define bfd_sym_bfd_link_check_relocs _bfd_generic_link_check_relocs
extern const bfd_target sym_vec;

View File

@ -1,3 +1,7 @@
2016-04-21 Nick Clifton <nickc@redhat.com>
* bfdlink.h: Add prototype for bfd_link_check_relocs.
2016-04-20 H.J. Lu <hongjiu.lu@intel.com>
* bfdlink.h (bfd_link_info): Add check_relocs_after_open_input.

View File

@ -226,6 +226,11 @@ extern void bfd_link_repair_undef_list
/* Read symbols and cache symbol pointer array in outsymbols. */
extern bfd_boolean bfd_generic_link_read_symbols (bfd *);
/* Check the relocs in the BFD. Called after all the input
files have been loaded, and garbage collection has tagged
any unneeded sections. */
extern bfd_boolean bfd_link_check_relocs (bfd *,struct bfd_link_info *);
struct bfd_sym_chain
{
struct bfd_sym_chain *next;

View File

@ -1,3 +1,9 @@
2016-04-21 Nick Clifton <nickc@redhat.com>
* 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.
2016-04-21 Alan Modra <amodra@gmail.com>
* testsuite/ld-scripts/cross3.t: Add commonly used data

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. */
}
}
}