2013-10-14 Chao-ying Fu <Chao-ying.Fu@imgtec.com>

* elfxx-mips.c (mips_elf_obj_tdata): Add abi_msa_bfd.
	(mips_elf_merge_obj_attributes): Set abi_msa_bfd to the first object
	file that has a Tag_GNU_MIPS_ABI_MSA attribute.
	Merge Tag_GNU_MIPS_ABI_MSA attributes.
This commit is contained in:
Chao-ying Fu 2013-10-14 18:43:39 +00:00
parent 387a82f124
commit b60bf9be01
2 changed files with 57 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2013-10-14 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
* elfxx-mips.c (mips_elf_obj_tdata): Add abi_msa_bfd.
(mips_elf_merge_obj_attributes): Set abi_msa_bfd to the first object
file that has a Tag_GNU_MIPS_ABI_MSA attribute.
Merge Tag_GNU_MIPS_ABI_MSA attributes.
2013-10-14 Nick Clifton <nickc@redhat.com>
* gen-aout.c (main): Fix formatting. Close file.

View File

@ -542,6 +542,9 @@ struct mips_elf_obj_tdata
/* Input BFD providing Tag_GNU_MIPS_ABI_FP attribute for output. */
bfd *abi_fp_bfd;
/* Input BFD providing Tag_GNU_MIPS_ABI_MSA attribute for output. */
bfd *abi_msa_bfd;
/* The GOT requirements of input bfds. */
struct mips_got_info *got;
@ -14328,12 +14331,18 @@ mips_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
obj_attribute *in_attr;
obj_attribute *out_attr;
bfd *abi_fp_bfd;
bfd *abi_msa_bfd;
abi_fp_bfd = mips_elf_tdata (obfd)->abi_fp_bfd;
in_attr = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU];
if (!abi_fp_bfd && in_attr[Tag_GNU_MIPS_ABI_FP].i != Val_GNU_MIPS_ABI_FP_ANY)
mips_elf_tdata (obfd)->abi_fp_bfd = ibfd;
abi_msa_bfd = mips_elf_tdata (obfd)->abi_msa_bfd;
if (!abi_msa_bfd
&& in_attr[Tag_GNU_MIPS_ABI_MSA].i != Val_GNU_MIPS_ABI_MSA_ANY)
mips_elf_tdata (obfd)->abi_msa_bfd = ibfd;
if (!elf_known_obj_attributes_proc (obfd)[0].i)
{
/* This is the first object. Copy the attributes. */
@ -14523,6 +14532,47 @@ mips_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
}
}
/* Check for conflicting Tag_GNU_MIPS_ABI_MSA attributes and merge
non-conflicting ones. */
if (in_attr[Tag_GNU_MIPS_ABI_MSA].i != out_attr[Tag_GNU_MIPS_ABI_MSA].i)
{
out_attr[Tag_GNU_MIPS_ABI_MSA].type = 1;
if (out_attr[Tag_GNU_MIPS_ABI_MSA].i == Val_GNU_MIPS_ABI_MSA_ANY)
out_attr[Tag_GNU_MIPS_ABI_MSA].i = in_attr[Tag_GNU_MIPS_ABI_MSA].i;
else if (in_attr[Tag_GNU_MIPS_ABI_MSA].i != Val_GNU_MIPS_ABI_MSA_ANY)
switch (out_attr[Tag_GNU_MIPS_ABI_MSA].i)
{
case Val_GNU_MIPS_ABI_MSA_128:
_bfd_error_handler
(_("Warning: %B uses %s (set by %B), "
"%B uses unknown MSA ABI %d"),
obfd, abi_msa_bfd, ibfd,
"-mmsa", in_attr[Tag_GNU_MIPS_ABI_MSA].i);
break;
default:
switch (in_attr[Tag_GNU_MIPS_ABI_MSA].i)
{
case Val_GNU_MIPS_ABI_MSA_128:
_bfd_error_handler
(_("Warning: %B uses unknown MSA ABI %d "
"(set by %B), %B uses %s"),
obfd, abi_msa_bfd, ibfd,
out_attr[Tag_GNU_MIPS_ABI_MSA].i, "-mmsa");
break;
default:
_bfd_error_handler
(_("Warning: %B uses unknown MSA ABI %d "
"(set by %B), %B uses unknown MSA ABI %d"),
obfd, abi_msa_bfd, ibfd,
out_attr[Tag_GNU_MIPS_ABI_MSA].i,
in_attr[Tag_GNU_MIPS_ABI_MSA].i);
break;
}
}
}
/* Merge Tag_compatibility attributes and any common GNU ones. */
_bfd_elf_merge_object_attributes (ibfd, obfd);