Pass link_info to _bfd_merge_private_bfd_data

Most BFD linker functions take a bfd_link_info param, which reinforces
the fact that they are linker functions and allow access to linker
callbacks, eg. einfo for printing errors.  I was going to use einfo
for --fatal-warnings support before I decided a better way was the
patch commit 4519d071.

bfd/
	* targets.c (bfd_target <_bfd_merge_private_bfd_data>): Replace
	obfd param with struct bfd_link_info param.  Update all callers.
	* linker.c (bfd_merge_private_bfd_data): Likewise.
	(_bfd_generic_verify_endian_match): Likewise.
	* aoutf1.h (sunos_merge_private_bfd_data): Likewise.
	* coff-arm.c (coff_arm_merge_private_bfd_data): Likewise.
	* elf-attrs.c (_bfd_elf_merge_object_attributes): Likewise.
	* elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Likewise.
	(_bfd_elf_merge_object_attributes): Likewise.
	* elf-m10300.c (_bfd_mn10300_elf_merge_private_bfd_data): Likewise.
	* elf-s390-common.c (elf_s390_merge_obj_attributes): Likewise.
	* elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
	* elf32-arm.c (elf32_arm_merge_eabi_attributes): Likewise.
	(elf32_arm_merge_private_bfd_data): Likewise.
	* elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Likewise.
	* elf32-cr16.c (_bfd_cr16_elf_merge_private_bfd_data): Likewise.
	* elf32-cris.c (cris_elf_merge_private_bfd_data): Likewise.
	* elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
	* elf32-h8300.c (elf32_h8_merge_private_bfd_data): Likewise.
	* elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
	* elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
	* elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
	* elf32-m32r.c (m32r_elf_merge_private_bfd_data): Likewise.
	* elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
	* elf32-m68hc1x.h (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
	* elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Likewise.
	* elf32-mcore.c (mcore_elf_merge_private_bfd_data): Likewise.
	* elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
	* elf32-msp430.c (elf32_msp430_merge_mspabi_attributes): Likewise.
	(elf32_msp430_merge_private_bfd_data): Likewise.
	* elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
	* elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
	* elf32-nios2.c (nios2_elf32_merge_private_bfd_data): Likewise.
	* elf32-or1k.c (elf32_or1k_merge_private_bfd_data): Likewise.
	* elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Likewise.
	(ppc_elf_merge_obj_attributes): Likewise.
	(ppc_elf_merge_private_bfd_data): Likewise.
	* elf32-rl78.c (rl78_elf_merge_private_bfd_data): Likewise.
	* elf32-rx.c (rx_elf_merge_private_bfd_data): Likewise.
	* elf32-s390.c (elf32_s390_merge_private_bfd_data): Likewise.
	* elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
	(elf32_score_merge_private_bfd_data): Likewise.
	* elf32-score.h (s7_elf32_score_merge_private_bfd_data): Likewise.
	* elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
	* elf32-sh.c (sh_merge_bfd_arch, sh_elf_merge_private_data): Likewise.
	* elf32-sh64.c (sh64_elf_merge_private_data): Likewise.
	* elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Likewise.
	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
	(elf32_tic6x_merge_private_bfd_data): Likewise.
	* elf32-v850.c (v850_elf_merge_private_bfd_data): Likewise.
	* elf32-vax.c (elf32_vax_merge_private_bfd_data): Likewise.
	* elf32-visium.c (visium_elf_merge_private_bfd_data): Likewise.
	* elf32-xtensa.c (elf_xtensa_merge_private_bfd_data): Likewise.
	* elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
	* elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Likewise.
	* elf64-s390.c (elf64_s390_merge_private_bfd_data): Likewise.
	* elf64-sh64.c (sh_elf64_merge_private_data): Likewise.
	* elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
	* elfnn-aarch64.c (elfNN_aarch64_merge_private_bfd_data): Likewise.
	* elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
	* elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
	(mips_elf_merge_obj_attributes): Likewise.
	(_bfd_mips_elf_merge_private_bfd_data): Likewise.
	* elfxx-mips.h (_bfd_mips_elf_merge_private_bfd_data): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Likewise.
	* elfxx-sparc.h (_bfd_sparc_elf_merge_private_bfd_data): Likewise.
	* elfxx-target.h (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
	* elfxx-tilegx.c (_bfd_tilegx_elf_merge_private_bfd_data): Likewise.
	* elfxx-tilegx.h (_bfd_tilegx_elf_merge_private_bfd_data): Likewise.
	* libbfd-in.h (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
ld/
	* ldlang.c (lang_check): Update bfd_merge_private_bfd_data call.
This commit is contained in:
Alan Modra 2016-09-30 08:44:50 +09:30
parent 1047201fd0
commit 50e03d47b7
63 changed files with 275 additions and 139 deletions

View File

@ -1,3 +1,78 @@
2016-10-07 Alan Modra <amodra@gmail.com>
* targets.c (bfd_target <_bfd_merge_private_bfd_data>): Replace
obfd param with struct bfd_link_info param. Update all callers.
* linker.c (bfd_merge_private_bfd_data): Likewise.
(_bfd_generic_verify_endian_match): Likewise.
* aoutf1.h (sunos_merge_private_bfd_data): Likewise.
* coff-arm.c (coff_arm_merge_private_bfd_data): Likewise.
* elf-attrs.c (_bfd_elf_merge_object_attributes): Likewise.
* elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Likewise.
(_bfd_elf_merge_object_attributes): Likewise.
* elf-m10300.c (_bfd_mn10300_elf_merge_private_bfd_data): Likewise.
* elf-s390-common.c (elf_s390_merge_obj_attributes): Likewise.
* elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
* elf32-arm.c (elf32_arm_merge_eabi_attributes): Likewise.
(elf32_arm_merge_private_bfd_data): Likewise.
* elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Likewise.
* elf32-cr16.c (_bfd_cr16_elf_merge_private_bfd_data): Likewise.
* elf32-cris.c (cris_elf_merge_private_bfd_data): Likewise.
* elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
* elf32-h8300.c (elf32_h8_merge_private_bfd_data): Likewise.
* elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
* elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
* elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
* elf32-m32r.c (m32r_elf_merge_private_bfd_data): Likewise.
* elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
* elf32-m68hc1x.h (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
* elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Likewise.
* elf32-mcore.c (mcore_elf_merge_private_bfd_data): Likewise.
* elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
* elf32-msp430.c (elf32_msp430_merge_mspabi_attributes): Likewise.
(elf32_msp430_merge_private_bfd_data): Likewise.
* elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
* elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
* elf32-nios2.c (nios2_elf32_merge_private_bfd_data): Likewise.
* elf32-or1k.c (elf32_or1k_merge_private_bfd_data): Likewise.
* elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Likewise.
(ppc_elf_merge_obj_attributes): Likewise.
(ppc_elf_merge_private_bfd_data): Likewise.
* elf32-rl78.c (rl78_elf_merge_private_bfd_data): Likewise.
* elf32-rx.c (rx_elf_merge_private_bfd_data): Likewise.
* elf32-s390.c (elf32_s390_merge_private_bfd_data): Likewise.
* elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
(elf32_score_merge_private_bfd_data): Likewise.
* elf32-score.h (s7_elf32_score_merge_private_bfd_data): Likewise.
* elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
* elf32-sh.c (sh_merge_bfd_arch, sh_elf_merge_private_data): Likewise.
* elf32-sh64.c (sh64_elf_merge_private_data): Likewise.
* elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Likewise.
* elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
(elf32_tic6x_merge_private_bfd_data): Likewise.
* elf32-v850.c (v850_elf_merge_private_bfd_data): Likewise.
* elf32-vax.c (elf32_vax_merge_private_bfd_data): Likewise.
* elf32-visium.c (visium_elf_merge_private_bfd_data): Likewise.
* elf32-xtensa.c (elf_xtensa_merge_private_bfd_data): Likewise.
* elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
* elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Likewise.
* elf64-s390.c (elf64_s390_merge_private_bfd_data): Likewise.
* elf64-sh64.c (sh_elf64_merge_private_data): Likewise.
* elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
* elfnn-aarch64.c (elfNN_aarch64_merge_private_bfd_data): Likewise.
* elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
* elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
(mips_elf_merge_obj_attributes): Likewise.
(_bfd_mips_elf_merge_private_bfd_data): Likewise.
* elfxx-mips.h (_bfd_mips_elf_merge_private_bfd_data): Likewise.
* elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Likewise.
* elfxx-sparc.h (_bfd_sparc_elf_merge_private_bfd_data): Likewise.
* elfxx-target.h (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
* elfxx-tilegx.c (_bfd_tilegx_elf_merge_private_bfd_data): Likewise.
* elfxx-tilegx.h (_bfd_tilegx_elf_merge_private_bfd_data): Likewise.
* libbfd-in.h (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
2016-10-07 Alan Modra <amodra@gmail.com>
* Makefile.am (LIBBFD_H_FILES): Update.

View File

@ -75,8 +75,9 @@
#define MY_bfd_merge_private_bfd_data sunos_merge_private_bfd_data
static bfd_boolean
sunos_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
sunos_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
if (bfd_get_flavour (ibfd) != bfd_target_aout_flavour
|| bfd_get_flavour (obfd) != bfd_target_aout_flavour)
return TRUE;

View File

@ -7291,7 +7291,7 @@ typedef struct bfd_target
bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
/* Called to merge BFD general private data from one object file
to a common output file when linking. */
bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
/* Called to initialize BFD private section data from one object file
to another. */
#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
@ -7615,11 +7615,12 @@ bfd_boolean bfd_link_check_relocs
bfd_boolean _bfd_generic_link_check_relocs
(bfd *abfd, struct bfd_link_info *info);
bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
bfd_boolean bfd_merge_private_bfd_data
(bfd *ibfd, struct bfd_link_info *info);
#define bfd_merge_private_bfd_data(ibfd, obfd) \
BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
(ibfd, obfd))
#define bfd_merge_private_bfd_data(ibfd, info) \
BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
(ibfd, 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

@ -2168,8 +2168,9 @@ coff_arm_adjust_symndx (bfd *obfd ATTRIBUTE_UNUSED,
targets, eg different CPUs or different APCS's. */
static bfd_boolean
coff_arm_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
coff_arm_merge_private_bfd_data (bfd * ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
BFD_ASSERT (ibfd != NULL && obfd != NULL);
if (ibfd == obfd)

View File

@ -571,8 +571,9 @@ _bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr)
attributes. */
bfd_boolean
_bfd_elf_merge_object_attributes (bfd *ibfd, bfd *obfd)
_bfd_elf_merge_object_attributes (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
obj_attribute *in_attr;
obj_attribute *out_attr;
int vendor;

View File

@ -2392,7 +2392,7 @@ extern unsigned int _bfd_elf_ppc_at_tprel_transform
/* PowerPC elf_object_p tweak. */
extern bfd_boolean _bfd_elf_ppc_set_arch (bfd *);
/* PowerPC .gnu.attributes handling common to both 32-bit and 64-bit. */
extern void _bfd_elf_ppc_merge_fp_attributes (bfd *, bfd *);
extern void _bfd_elf_ppc_merge_fp_attributes (bfd *, struct bfd_link_info *);
/* Exported interface for writing elf corefile notes. */
extern char *elfcore_write_note
@ -2508,7 +2508,8 @@ extern char *_bfd_elf_attr_strdup (bfd *, const char *);
extern void _bfd_elf_copy_obj_attributes (bfd *, bfd *);
extern int _bfd_elf_obj_attrs_arg_type (bfd *, int, unsigned int);
extern void _bfd_elf_parse_attributes (bfd *, Elf_Internal_Shdr *);
extern bfd_boolean _bfd_elf_merge_object_attributes (bfd *, bfd *);
extern bfd_boolean _bfd_elf_merge_object_attributes
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf_merge_unknown_attribute_low (bfd *, bfd *, int);
extern bfd_boolean _bfd_elf_merge_unknown_attribute_list (bfd *, bfd *);
extern Elf_Internal_Shdr *_bfd_elf_single_rel_hdr (asection *sec);

View File

@ -4725,8 +4725,10 @@ _bfd_mn10300_elf_object_p (bfd *abfd)
object file when linking. */
static bfd_boolean
_bfd_mn10300_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
_bfd_mn10300_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;

View File

@ -259,8 +259,9 @@ elf_s390_elf_sort_relocs_p (asection *sec)
/* Merge object attributes from IBFD into OBFD. Raise an error if
there are conflicting attributes. */
static bfd_boolean
elf_s390_merge_obj_attributes (bfd *ibfd, bfd *obfd)
elf_s390_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
obj_attribute *in_attr, *in_attrs;
obj_attribute *out_attr, *out_attrs;
@ -309,7 +310,7 @@ elf_s390_merge_obj_attributes (bfd *ibfd, bfd *obfd)
}
/* Merge Tag_compatibility attributes and any common GNU ones. */
_bfd_elf_merge_object_attributes (ibfd, obfd);
_bfd_elf_merge_object_attributes (ibfd, info);
return TRUE;
}

View File

@ -542,8 +542,9 @@ arc_info_to_howto_rel (bfd * abfd ATTRIBUTE_UNUSED,
object file when linking. */
static bfd_boolean
arc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
arc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
unsigned short mach_ibfd;
static unsigned short mach_obfd = EM_NONE;
flagword out_flags;
@ -551,7 +552,7 @@ arc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
asection *sec;
/* Check if we have the same endianess. */
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
if (! _bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
/* Collect ELF flags. */

View File

@ -13492,8 +13492,9 @@ elf32_arm_attributes_forbid_div (const obj_attribute *attr)
are conflicting attributes. */
static bfd_boolean
elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
obj_attribute *in_attr;
obj_attribute *out_attr;
/* Some tags have 0 = don't care, 1 = strong requirement,
@ -14048,7 +14049,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
}
/* Merge Tag_compatibility attributes and any common GNU ones. */
if (!_bfd_elf_merge_object_attributes (ibfd, obfd))
if (!_bfd_elf_merge_object_attributes (ibfd, info))
return FALSE;
/* Check for any attributes not known on ARM. */
@ -14076,7 +14077,7 @@ elf32_arm_versions_compatible (unsigned iver, unsigned over)
object file when linking. */
static bfd_boolean
elf32_arm_merge_private_bfd_data (bfd * ibfd, bfd * obfd);
elf32_arm_merge_private_bfd_data (bfd *, struct bfd_link_info *);
/* Display the flags field. */
@ -19595,21 +19596,22 @@ elf32_arm_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
object file when linking. */
static bfd_boolean
elf32_arm_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
elf32_arm_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword out_flags;
flagword in_flags;
bfd_boolean flags_compatible = TRUE;
asection *sec;
/* Check if we have the same endianness. */
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
if (! _bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
if (! is_arm_elf (ibfd) || ! is_arm_elf (obfd))
return TRUE;
if (!elf32_arm_merge_eabi_attributes (ibfd, obfd))
if (!elf32_arm_merge_eabi_attributes (ibfd, info))
return FALSE;
/* The input BFD must have had its flags initialised. */

View File

@ -4967,8 +4967,9 @@ elf32_bfin_print_private_bfd_data (bfd * abfd, void * ptr)
object file when linking. */
static bfd_boolean
elf32_bfin_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf32_bfin_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags, new_flags;
bfd_boolean error = FALSE;

View File

@ -1725,8 +1725,10 @@ _bfd_cr16_elf_object_p (bfd *abfd)
object file when linking. */
static bfd_boolean
_bfd_cr16_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
_bfd_cr16_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;

View File

@ -4154,11 +4154,12 @@ cris_elf_print_private_bfd_data (bfd *abfd, void * ptr)
/* Don't mix files with and without a leading underscore. */
static bfd_boolean
cris_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
cris_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
int imach, omach;
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
if (! _bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour

View File

@ -6349,8 +6349,9 @@ frv_elf_arch_extension_p (flagword base, flagword extension)
object file when linking. */
static bfd_boolean
frv_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
frv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags, old_partial;
flagword new_flags, new_partial;
bfd_boolean error = FALSE;

View File

@ -33,7 +33,8 @@ static void elf32_h8_info_to_howto_rel
static unsigned long elf32_h8_mach (flagword);
static void elf32_h8_final_write_processing (bfd *, bfd_boolean);
static bfd_boolean elf32_h8_object_p (bfd *);
static bfd_boolean elf32_h8_merge_private_bfd_data (bfd *, bfd *);
static bfd_boolean elf32_h8_merge_private_bfd_data
(bfd *, struct bfd_link_info *);
static bfd_boolean elf32_h8_relax_section
(bfd *, asection *, struct bfd_link_info *, bfd_boolean *);
static bfd_boolean elf32_h8_relax_delete_bytes
@ -640,8 +641,10 @@ elf32_h8_object_p (bfd *abfd)
time is the architecture/machine information. */
static bfd_boolean
elf32_h8_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf32_h8_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;

View File

@ -330,8 +330,9 @@ i370_elf_set_private_flags (bfd *abfd, flagword flags)
object file when linking. */
static bfd_boolean
i370_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
i370_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags;
flagword new_flags;

View File

@ -768,8 +768,9 @@ iq2000_elf_set_private_flags (bfd *abfd, flagword flags)
file to the output object file when linking. */
static bfd_boolean
iq2000_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
iq2000_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags, old_partial;
flagword new_flags, new_partial;
bfd_boolean error = FALSE;

View File

@ -817,8 +817,9 @@ m32c_elf_set_private_flags (bfd *abfd, flagword flags)
object file when linking. */
static bfd_boolean
m32c_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
m32c_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags, old_partial;
flagword new_flags, new_partial;
bfd_boolean error = FALSE;

View File

@ -3483,8 +3483,9 @@ m32r_elf_set_private_flags (bfd *abfd, flagword flags)
object file when linking. */
static bfd_boolean
m32r_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
m32r_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword out_flags;
flagword in_flags;

View File

@ -1308,14 +1308,15 @@ _bfd_m68hc11_elf_set_private_flags (bfd *abfd, flagword flags)
object file when linking. */
bfd_boolean
_bfd_m68hc11_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
_bfd_m68hc11_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags;
flagword new_flags;
bfd_boolean ok = TRUE;
/* Check if we have the same endianness */
if (!_bfd_generic_verify_endian_match (ibfd, obfd))
if (!_bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour

View File

@ -33,7 +33,8 @@
#define BFD_M68HC11_BANK_VIRTUAL_NAME "__bank_virtual"
/* Set and control ELF flags in ELF header. */
extern bfd_boolean _bfd_m68hc11_elf_merge_private_bfd_data (bfd*,bfd*);
extern bfd_boolean _bfd_m68hc11_elf_merge_private_bfd_data
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_m68hc11_elf_set_private_flags (bfd*,flagword);
extern bfd_boolean _bfd_m68hc11_elf_print_private_bfd_data (bfd*, void*);

View File

@ -1117,8 +1117,9 @@ elf32_m68k_set_private_flags (bfd *abfd, flagword flags)
/* Merge backend specific data from an object file to the output
object file when linking. */
static bfd_boolean
elf32_m68k_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf32_m68k_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword out_flags;
flagword in_flags;
flagword out_isa;

View File

@ -49,13 +49,14 @@ mcore_elf_set_private_flags (bfd * abfd, flagword flags)
object file when linking. */
static bfd_boolean
mcore_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
mcore_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags;
flagword new_flags;
/* Check if we have the same endianness. */
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
if (! _bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour

View File

@ -568,14 +568,15 @@ mep_elf_set_private_flags (bfd * abfd,
object file when linking. */
static bfd_boolean
mep_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
mep_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
static bfd *last_ibfd = 0;
flagword old_flags, new_flags;
flagword old_partial, new_partial;
/* Check if we have the same endianness. */
if (_bfd_generic_verify_endian_match (ibfd, obfd) == FALSE)
if (!_bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
new_flags = elf_elfheader (ibfd)->e_flags;

View File

@ -2406,8 +2406,9 @@ data_model (int model)
Raise an error if there are conflicting attributes. */
static bfd_boolean
elf32_msp430_merge_mspabi_attributes (bfd *ibfd, bfd *obfd)
elf32_msp430_merge_mspabi_attributes (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
obj_attribute *in_attr;
obj_attribute *out_attr;
bfd_boolean result = TRUE;
@ -2509,8 +2510,9 @@ elf32_msp430_merge_mspabi_attributes (bfd *ibfd, bfd *obfd)
object file when linking. */
static bfd_boolean
elf32_msp430_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
elf32_msp430_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
/* Make sure that the machine number reflects the most
advanced version of the MSP architecture required. */
#define max(a,b) ((a) > (b) ? (a) : (b))
@ -2519,7 +2521,7 @@ elf32_msp430_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
max (bfd_get_mach (ibfd), bfd_get_mach (obfd)));
#undef max
return elf32_msp430_merge_mspabi_attributes (ibfd, obfd);
return elf32_msp430_merge_mspabi_attributes (ibfd, info);
}
static bfd_boolean

View File

@ -502,13 +502,14 @@ mt_elf_set_private_flags (bfd * abfd,
object file when linking. */
static bfd_boolean
mt_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
mt_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags, new_flags;
bfd_boolean ok = TRUE;
/* Check if we have the same endianness. */
if (!_bfd_generic_verify_endian_match (ibfd, obfd))
if (!_bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
/* If they're not both mt, then merging is meaningless, so just

View File

@ -77,7 +77,8 @@ static bfd_boolean nds32_elf_relocate_section
static bfd_boolean nds32_elf_object_p (bfd *);
static void nds32_elf_final_write_processing (bfd *, bfd_boolean);
static bfd_boolean nds32_elf_set_private_flags (bfd *, flagword);
static bfd_boolean nds32_elf_merge_private_bfd_data (bfd *, bfd *);
static bfd_boolean nds32_elf_merge_private_bfd_data
(bfd *, struct bfd_link_info *);
static bfd_boolean nds32_elf_print_private_bfd_data (bfd *, void *);
static bfd_boolean nds32_elf_gc_sweep_hook
(bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
@ -5988,8 +5989,9 @@ nds32_check_vec_size (bfd *ibfd)
object file when linking. */
static bfd_boolean
nds32_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
nds32_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword out_flags;
flagword in_flags;
flagword out_16regs;

View File

@ -2916,8 +2916,9 @@ nios2_elf32_build_stubs (struct bfd_link_info *info)
object file when linking. */
static bfd_boolean
nios2_elf32_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
nios2_elf32_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags;
flagword new_flags;
@ -2925,7 +2926,7 @@ nios2_elf32_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
return TRUE;
/* Check if we have the same endianness. */
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
if (! _bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
new_flags = elf_elfheader (ibfd)->e_flags;
@ -2968,7 +2969,7 @@ nios2_elf32_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
}
/* Merge Tag_compatibility attributes and any common GNU ones. */
_bfd_elf_merge_object_attributes (ibfd, obfd);
_bfd_elf_merge_object_attributes (ibfd, info);
return TRUE;
}

View File

@ -2765,8 +2765,9 @@ or1k_elf_set_private_flags (bfd *abfd, flagword flags)
EF_OR1K_NODELAY flag setting. */
static bfd_boolean
elf32_or1k_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf32_or1k_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword out_flags;
flagword in_flags;

View File

@ -4656,8 +4656,9 @@ ppc_elf_check_relocs (bfd *abfd,
/* Warn for conflicting Tag_GNU_Power_ABI_FP attributes between IBFD
and OBFD, and merge non-conflicting ones. */
void
_bfd_elf_ppc_merge_fp_attributes (bfd *ibfd, bfd *obfd)
_bfd_elf_ppc_merge_fp_attributes (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
obj_attribute *in_attr, *in_attrs;
obj_attribute *out_attr, *out_attrs;
@ -4725,13 +4726,15 @@ _bfd_elf_ppc_merge_fp_attributes (bfd *ibfd, bfd *obfd)
/* Merge object attributes from IBFD into OBFD. Warn if
there are conflicting attributes. */
static bfd_boolean
ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
ppc_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd;
obj_attribute *in_attr, *in_attrs;
obj_attribute *out_attr, *out_attrs;
_bfd_elf_ppc_merge_fp_attributes (ibfd, obfd);
_bfd_elf_ppc_merge_fp_attributes (ibfd, info);
obfd = info->output_bfd;
in_attrs = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU];
out_attrs = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU];
@ -4800,7 +4803,7 @@ ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
}
/* Merge Tag_compatibility attributes and any common GNU ones. */
_bfd_elf_merge_object_attributes (ibfd, obfd);
_bfd_elf_merge_object_attributes (ibfd, info);
return TRUE;
}
@ -4809,8 +4812,9 @@ ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
object file when linking. */
static bfd_boolean
ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
ppc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags;
flagword new_flags;
bfd_boolean error;
@ -4819,10 +4823,10 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
return TRUE;
/* Check if we have the same endianness. */
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
if (! _bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
if (!ppc_elf_merge_obj_attributes (ibfd, obfd))
if (!ppc_elf_merge_obj_attributes (ibfd, info))
return FALSE;
new_flags = elf_elfheader (ibfd)->e_flags;

View File

@ -1156,8 +1156,9 @@ rl78_cpu_name (flagword flags)
object file when linking. */
static bfd_boolean
rl78_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
rl78_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword new_flags;
flagword old_flags;
bfd_boolean error = FALSE;

View File

@ -3083,8 +3083,9 @@ describe_flags (flagword flags)
object file when linking. */
static bfd_boolean
rx_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
rx_elf_merge_private_bfd_data (bfd * ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags;
flagword new_flags;
bfd_boolean error = FALSE;

View File

@ -4171,12 +4171,14 @@ elf_s390_plt_sym_val (bfd_vma i, const asection *plt,
object file when linking. */
static bfd_boolean
elf32_s390_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf32_s390_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
if (!is_s390_elf (ibfd) || !is_s390_elf (obfd))
return TRUE;
if (!elf_s390_merge_obj_attributes (ibfd, obfd))
if (!elf_s390_merge_obj_attributes (ibfd, info))
return FALSE;
elf_elfheader (obfd)->e_flags |= elf_elfheader (ibfd)->e_flags;

View File

@ -4018,12 +4018,13 @@ s3_elf32_score_print_private_bfd_data (bfd *abfd, void * ptr)
}
static bfd_boolean
s3_elf32_score_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
s3_elf32_score_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword in_flags;
flagword out_flags;
if (!_bfd_generic_verify_endian_match (ibfd, obfd))
if (!_bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
in_flags = elf_elfheader (ibfd)->e_flags;
@ -4392,12 +4393,12 @@ elf32_score_print_private_bfd_data (bfd *abfd, void * ptr)
}
static bfd_boolean
elf32_score_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf32_score_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
if (bfd_get_mach (obfd) == bfd_mach_score3)
return s3_elf32_score_merge_private_bfd_data (ibfd, obfd);
if (bfd_get_mach (info->output_bfd) == bfd_mach_score3)
return s3_elf32_score_merge_private_bfd_data (ibfd, info);
else
return s7_elf32_score_merge_private_bfd_data (ibfd, obfd);
return s7_elf32_score_merge_private_bfd_data (ibfd, info);
}
static bfd_boolean

View File

@ -141,7 +141,7 @@ extern bfd_boolean
s7_elf32_score_print_private_bfd_data (bfd *, void *);
extern bfd_boolean
s7_elf32_score_merge_private_bfd_data (bfd *, bfd *);
s7_elf32_score_merge_private_bfd_data (bfd *, struct bfd_link_info *);
extern bfd_boolean
s7_elf32_score_new_section_hook (bfd *, asection *);

View File

@ -3824,12 +3824,13 @@ s7_elf32_score_print_private_bfd_data (bfd *abfd, void * ptr)
}
bfd_boolean
s7_elf32_score_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
s7_elf32_score_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword in_flags;
flagword out_flags;
if (!_bfd_generic_verify_endian_match (ibfd, obfd))
if (!_bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
in_flags = elf_elfheader (ibfd)->e_flags;

View File

@ -6422,11 +6422,12 @@ sh_find_elf_flags (unsigned int arch_set)
that fits the requirements then an error is emitted. */
static bfd_boolean
sh_merge_bfd_arch (bfd *ibfd, bfd *obfd)
sh_merge_bfd_arch (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
unsigned int old_arch, new_arch, merged_arch;
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
if (! _bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
old_arch = sh_get_arch_up_from_bfd_mach (bfd_get_mach (obfd));
@ -6466,9 +6467,9 @@ sh_merge_bfd_arch (bfd *ibfd, bfd *obfd)
calls sh_merge_bfd_arch() to check dsp/fpu compatibility. */
static bfd_boolean
sh_elf_merge_private_data (bfd *ibfd, bfd *obfd)
sh_elf_merge_private_data (bfd *ibfd, struct bfd_link_info *info)
{
extern bfd_boolean sh_merge_bfd_arch (bfd *, bfd *);
bfd *obfd = info->output_bfd;
if (! is_sh_elf (ibfd) || ! is_sh_elf (obfd))
return TRUE;
@ -6483,7 +6484,7 @@ sh_elf_merge_private_data (bfd *ibfd, bfd *obfd)
elf_elfheader (obfd)->e_flags &= ~EF_SH_PIC;
}
if (! sh_merge_bfd_arch (ibfd, obfd))
if (! sh_merge_bfd_arch (ibfd, info))
{
_bfd_error_handler ("%B: uses instructions which are incompatible "
"with instructions used in previous modules",

View File

@ -44,7 +44,7 @@ static bfd_boolean sh64_elf_new_section_hook
static bfd_boolean sh64_elf_copy_private_data
(bfd *, bfd *);
static bfd_boolean sh64_elf_merge_private_data
(bfd *, bfd *);
(bfd *, struct bfd_link_info *);
static bfd_boolean sh64_elf_fake_sections
(bfd *, Elf_Internal_Shdr *, asection *);
static bfd_boolean sh64_elf_set_private_flags
@ -203,11 +203,12 @@ sh64_elf_copy_private_data (bfd * ibfd, bfd * obfd)
}
static bfd_boolean
sh64_elf_merge_private_data (bfd *ibfd, bfd *obfd)
sh64_elf_merge_private_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags, new_flags;
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
if (! _bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour

View File

@ -67,8 +67,9 @@ elf32_sparc_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
object file when linking. */
static bfd_boolean
elf32_sparc_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf32_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
bfd_boolean error;
unsigned long ibfd_mach;
/* FIXME: This should not be static. */
@ -109,7 +110,7 @@ elf32_sparc_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
return FALSE;
}
return _bfd_sparc_elf_merge_private_bfd_data (ibfd, obfd);
return _bfd_sparc_elf_merge_private_bfd_data (ibfd, info);
}
/* The final processing done just before writing out the object file.

View File

@ -3730,8 +3730,9 @@ elf32_tic6x_array_alignment_to_tag (int align)
succeeded, FALSE otherwise. */
static bfd_boolean
elf32_tic6x_merge_attributes (bfd *ibfd, bfd *obfd)
elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
bfd_boolean result = TRUE;
obj_attribute *in_attr;
obj_attribute *out_attr;
@ -3916,7 +3917,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, bfd *obfd)
}
/* Merge Tag_ABI_compatibility attributes and any common GNU ones. */
if (!_bfd_elf_merge_object_attributes (ibfd, obfd))
if (!_bfd_elf_merge_object_attributes (ibfd, info))
return FALSE;
result &= _bfd_elf_merge_unknown_attribute_list (ibfd, obfd);
@ -3925,15 +3926,15 @@ elf32_tic6x_merge_attributes (bfd *ibfd, bfd *obfd)
}
static bfd_boolean
elf32_tic6x_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf32_tic6x_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
if (!_bfd_generic_verify_endian_match (ibfd, obfd))
if (!_bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
if (! is_tic6x_elf (ibfd) || ! is_tic6x_elf (obfd))
if (! is_tic6x_elf (ibfd) || ! is_tic6x_elf (info->output_bfd))
return TRUE;
if (!elf32_tic6x_merge_attributes (ibfd, obfd))
if (!elf32_tic6x_merge_attributes (ibfd, info))
return FALSE;
return TRUE;

View File

@ -2760,8 +2760,9 @@ v850_elf_set_private_flags (bfd *abfd, flagword flags)
to the output object file when linking. */
static bfd_boolean
v850_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
v850_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword out_flags;
flagword in_flags;
bfd_boolean result = TRUE;

View File

@ -50,7 +50,6 @@ static bfd_vma elf_vax_plt_sym_val (bfd_vma, const asection *,
const arelent *);
static bfd_boolean elf32_vax_set_private_flags (bfd *, flagword);
static bfd_boolean elf32_vax_merge_private_bfd_data (bfd *, bfd *);
static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, void *);
static reloc_howto_type howto_table[] = {
@ -499,8 +498,9 @@ elf32_vax_set_private_flags (bfd *abfd, flagword flags)
/* Merge backend specific data from an object file to the output
object file when linking. */
static bfd_boolean
elf32_vax_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf32_vax_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword in_flags;
if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour

View File

@ -763,8 +763,9 @@ visium_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
file to the output object file when linking. */
static bfd_boolean
visium_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
visium_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags;
flagword new_flags;
flagword mismatch;

View File

@ -3457,13 +3457,14 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd,
object file when linking. */
static bfd_boolean
elf_xtensa_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf_xtensa_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
unsigned out_mach, in_mach;
flagword out_flag, in_flag;
/* Check if we have the same endianness. */
if (!_bfd_generic_verify_endian_match (ibfd, obfd))
if (!_bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
/* Don't even pretend to support mixed-format linking. */

View File

@ -4202,8 +4202,9 @@ elf64_ia64_set_private_flags (bfd *abfd, flagword flags)
/* Merge backend specific data from an object file to the output
object file when linking. */
static bfd_boolean
elf64_ia64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf64_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword out_flags;
flagword in_flags;
bfd_boolean ok = TRUE;

View File

@ -5999,8 +5999,9 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
object file when linking. */
static bfd_boolean
ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
ppc64_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
unsigned long iflags, oflags;
if ((ibfd->flags & BFD_LINKER_CREATED) != 0)
@ -6009,7 +6010,7 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
if (!is_ppc64_elf (ibfd) || !is_ppc64_elf (obfd))
return TRUE;
if (!_bfd_generic_verify_endian_match (ibfd, obfd))
if (!_bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
iflags = elf_elfheader (ibfd)->e_flags;
@ -6031,10 +6032,10 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
return FALSE;
}
_bfd_elf_ppc_merge_fp_attributes (ibfd, obfd);
_bfd_elf_ppc_merge_fp_attributes (ibfd, info);
/* Merge Tag_compatibility attributes and any common GNU ones. */
_bfd_elf_merge_object_attributes (ibfd, obfd);
_bfd_elf_merge_object_attributes (ibfd, info);
return TRUE;
}

View File

@ -3973,15 +3973,12 @@ elf_s390_plt_sym_val (bfd_vma i, const asection *plt,
object file when linking. */
static bfd_boolean
elf64_s390_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf64_s390_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
if (!is_s390_elf (ibfd) || !is_s390_elf (obfd))
if (!is_s390_elf (ibfd) || !is_s390_elf (info->output_bfd))
return TRUE;
if (!elf_s390_merge_obj_attributes (ibfd, obfd))
return FALSE;
return TRUE;
return elf_s390_merge_obj_attributes (ibfd, info);
}
/* Why was the hash table entry size definition changed from

View File

@ -2271,11 +2271,12 @@ sh_elf64_copy_private_data (bfd *ibfd, bfd *obfd)
}
static bfd_boolean
sh_elf64_merge_private_data (bfd *ibfd, bfd *obfd)
sh_elf64_merge_private_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword old_flags, new_flags;
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
if (! _bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour

View File

@ -636,8 +636,9 @@ elf64_sparc_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, asymbol *asym)
object file when linking. */
static bfd_boolean
elf64_sparc_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf64_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
bfd_boolean error;
flagword new_flags, old_flags;
int new_mm, old_mm;
@ -715,7 +716,7 @@ elf64_sparc_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
return FALSE;
}
}
return _bfd_sparc_elf_merge_private_bfd_data (ibfd, obfd);
return _bfd_sparc_elf_merge_private_bfd_data (ibfd, info);
}
/* MARCO: Set the correct entry size for the .stab section. */

View File

@ -6522,15 +6522,16 @@ elfNN_aarch64_set_private_flags (bfd *abfd, flagword flags)
object file when linking. */
static bfd_boolean
elfNN_aarch64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elfNN_aarch64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword out_flags;
flagword in_flags;
bfd_boolean flags_compatible = TRUE;
asection *sec;
/* Check if we have the same endianess. */
if (!_bfd_generic_verify_endian_match (ibfd, obfd))
if (!_bfd_generic_verify_endian_match (ibfd, info))
return FALSE;
if (!is_aarch64_elf (ibfd) || !is_aarch64_elf (obfd))

View File

@ -4702,8 +4702,9 @@ elfNN_ia64_set_private_flags (bfd *abfd, flagword flags)
/* Merge backend specific data from an object file to the output
object file when linking. */
static bfd_boolean
elfNN_ia64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elfNN_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
flagword out_flags;
flagword in_flags;
bfd_boolean ok = TRUE;

View File

@ -15063,8 +15063,9 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
if there are conflicting settings. */
static bfd_boolean
mips_elf_merge_obj_e_flags (bfd *ibfd, bfd *obfd)
mips_elf_merge_obj_e_flags (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
struct mips_elf_obj_tdata *out_tdata = mips_elf_tdata (obfd);
flagword old_flags;
flagword new_flags;
@ -15255,8 +15256,9 @@ mips_elf_merge_obj_e_flags (bfd *ibfd, bfd *obfd)
/* Merge object attributes from IBFD into OBFD. Raise an error if
there are conflicting attributes. */
static bfd_boolean
mips_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
mips_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
obj_attribute *in_attr;
obj_attribute *out_attr;
bfd *abi_fp_bfd;
@ -15398,7 +15400,7 @@ mips_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
}
/* Merge Tag_compatibility attributes and any common GNU ones. */
return _bfd_elf_merge_object_attributes (ibfd, obfd);
return _bfd_elf_merge_object_attributes (ibfd, info);
}
/* Merge object ABI flags from IBFD into OBFD. Raise an error if
@ -15437,8 +15439,9 @@ mips_elf_merge_obj_abiflags (bfd *ibfd, bfd *obfd)
object file when linking. */
bfd_boolean
_bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
_bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
struct mips_elf_obj_tdata *out_tdata;
struct mips_elf_obj_tdata *in_tdata;
bfd_boolean null_input_bfd = TRUE;
@ -15446,7 +15449,7 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
bfd_boolean ok;
/* Check if we have the same endianness. */
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
if (! _bfd_generic_verify_endian_match (ibfd, info))
{
_bfd_error_handler
(_("%B: endianness incompatible with that of the selected emulation"),
@ -15575,9 +15578,9 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
ok = TRUE;
}
else
ok = mips_elf_merge_obj_e_flags (ibfd, obfd);
ok = mips_elf_merge_obj_e_flags (ibfd, info);
ok = mips_elf_merge_obj_attributes (ibfd, obfd) && ok;
ok = mips_elf_merge_obj_attributes (ibfd, info) && ok;
ok = mips_elf_merge_obj_abiflags (ibfd, obfd) && ok;

View File

@ -107,7 +107,7 @@ extern struct bfd_link_hash_table *_bfd_mips_vxworks_link_hash_table_create
extern bfd_boolean _bfd_mips_elf_final_link
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_mips_elf_merge_private_bfd_data
(bfd *, bfd *);
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_mips_elf_set_private_flags
(bfd *, flagword);
extern const char * _bfd_mips_fp_abi_string

View File

@ -4942,8 +4942,9 @@ _bfd_sparc_elf_plt_sym_val (bfd_vma i, const asection *plt, const arelent *rel)
object file when linking. */
bfd_boolean
_bfd_sparc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
_bfd_sparc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
obj_attribute *in_attr, *in_attrs;
obj_attribute *out_attr, *out_attrs;
@ -4974,9 +4975,8 @@ _bfd_sparc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
out_attr->i |= in_attr->i;
out_attr->type = 1;
/* Merge Tag_compatibility attributes and any common GNU ones. */
_bfd_elf_merge_object_attributes (ibfd, obfd);
_bfd_elf_merge_object_attributes (ibfd, info);
return TRUE;
}

View File

@ -145,4 +145,4 @@ extern bfd_boolean _bfd_sparc_elf_object_p
extern bfd_vma _bfd_sparc_elf_plt_sym_val
(bfd_vma, const asection *, const arelent *);
extern bfd_boolean _bfd_sparc_elf_merge_private_bfd_data
(bfd *, bfd *);
(bfd *, struct bfd_link_info *);

View File

@ -223,7 +223,7 @@
#endif
#ifndef bfd_elfNN_bfd_merge_private_bfd_data
#define bfd_elfNN_bfd_merge_private_bfd_data \
((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true)
#endif
#ifndef bfd_elfNN_bfd_set_private_flags
#define bfd_elfNN_bfd_set_private_flags \

View File

@ -4426,8 +4426,9 @@ tilegx_additional_program_headers (bfd *abfd,
bfd_boolean
_bfd_tilegx_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
_bfd_tilegx_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
const char *targ1 = bfd_get_target (ibfd);
const char *targ2 = bfd_get_target (obfd);

View File

@ -96,4 +96,4 @@ extern bfd_boolean
tilegx_elf_finish_dynamic_sections (bfd *, struct bfd_link_info *);
extern bfd_boolean
_bfd_tilegx_elf_merge_private_bfd_data (bfd *, bfd *);
_bfd_tilegx_elf_merge_private_bfd_data (bfd *, struct bfd_link_info *);

View File

@ -262,7 +262,7 @@ extern bfd_boolean _bfd_generic_get_section_contents_in_window
#define _bfd_generic_bfd_copy_private_bfd_data \
((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
#define _bfd_generic_bfd_merge_private_bfd_data \
((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true)
#define _bfd_generic_bfd_set_private_flags \
((bfd_boolean (*) (bfd *, flagword)) bfd_true)
#define _bfd_generic_bfd_copy_private_section_data \

View File

@ -267,7 +267,7 @@ extern bfd_boolean _bfd_generic_get_section_contents_in_window
#define _bfd_generic_bfd_copy_private_bfd_data \
((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
#define _bfd_generic_bfd_merge_private_bfd_data \
((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true)
#define _bfd_generic_bfd_set_private_flags \
((bfd_boolean (*) (bfd *, flagword)) bfd_true)
#define _bfd_generic_bfd_copy_private_section_data \
@ -3154,7 +3154,7 @@ void *bfd_arch_default_fill (bfd_size_type count,
/* Extracted from linker.c. */
bfd_boolean _bfd_generic_verify_endian_match
(bfd *ibfd, bfd *obfd);
(bfd *ibfd, struct bfd_link_info *info);
#ifdef __cplusplus
}

View File

@ -3338,20 +3338,20 @@ FUNCTION
bfd_merge_private_bfd_data
SYNOPSIS
bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
bfd_boolean bfd_merge_private_bfd_data
(bfd *ibfd, struct bfd_link_info *info);
DESCRIPTION
Merge private BFD information from the BFD @var{ibfd} to the
the output file BFD @var{obfd} when linking. Return <<TRUE>> on success,
the output file BFD when linking. Return <<TRUE>> on success,
<<FALSE>> on error. Possible error returns are:
o <<bfd_error_no_memory>> -
Not enough memory exists to create private data for @var{obfd}.
.#define bfd_merge_private_bfd_data(ibfd, obfd) \
. BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
. (ibfd, obfd))
.#define bfd_merge_private_bfd_data(ibfd, info) \
. BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
. (ibfd, info))
*/
/*
@ -3360,7 +3360,7 @@ INTERNAL_FUNCTION
SYNOPSIS
bfd_boolean _bfd_generic_verify_endian_match
(bfd *ibfd, bfd *obfd);
(bfd *ibfd, struct bfd_link_info *info);
DESCRIPTION
Can be used from / for bfd_merge_private_bfd_data to check that
@ -3369,8 +3369,10 @@ DESCRIPTION
*/
bfd_boolean
_bfd_generic_verify_endian_match (bfd *ibfd, bfd *obfd)
_bfd_generic_verify_endian_match (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
if (ibfd->xvec->byteorder != obfd->xvec->byteorder
&& ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
&& obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)

View File

@ -291,7 +291,7 @@ BFD_JUMP_TABLE macros.
. bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
. {* Called to merge BFD general private data from one object file
. to a common output file when linking. *}
. bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
. bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
. {* Called to initialize BFD private section data from one object file
. to another. *}
.#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \

View File

@ -6055,7 +6055,7 @@ lang_check (void)
information which is needed in the output file. */
if (!command_line.warn_mismatch)
pfn = bfd_set_error_handler (ignore_bfd_errors);
if (!bfd_merge_private_bfd_data (input_bfd, link_info.output_bfd))
if (!bfd_merge_private_bfd_data (input_bfd, &link_info))
{
if (command_line.warn_mismatch)
einfo (_("%P%X: failed to merge target specific data"