summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2016-01-04 23:13:10 +0000
committerMaciej W. Rozycki <macro@imgtec.com>2016-01-04 23:13:10 +0000
commit28d45e28be904a53fef4310b3d41e41b045885b0 (patch)
tree49f5c1cb802b4b82a5158b8ced49f42b3d795948 /bfd
parent23ba6f1807299311717df4d48b5f68d534ab6c47 (diff)
MIPS/BFD: Fold the handling of input MIPS ABI flags together
Fold the handling of input MIPS ABI flags in private BFD data merging together, moving the attribute check afterwards, and consequently making input vs output compatibility checks only start once all input ABI flag data has been gathered, checked for inconsistencies and put in order. Consequently also address the issue of input ABI flag inconsistencies being masked by a failing attribute check, which currently makes `_bfd_mips_elf_merge_private_bfd_data' exit prematurely and therefore prevent input ABI flag inconsistencies from being reported. Such inconsistencies need to be reported as they may be the very cause of an attribute check failure. bfd/ * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Fold the handling of input MIPS ABI flags together.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfxx-mips.c30
2 files changed, 19 insertions, 16 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 06dc3b3d7e..cd9e1b1b61 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2016-01-04 Maciej W. Rozycki <macro@imgtec.com>
+ * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Fold the
+ handling of input MIPS ABI flags together.
+
+2016-01-04 Maciej W. Rozycki <macro@imgtec.com>
+
* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Suppress
attribute checks for null input.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index e502f73c79..89d4409b09 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -15080,28 +15080,18 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
if (null_input_bfd)
return TRUE;
- /* Set up the FP ABI attribute from the abiflags if it is not already
- set. */
+ /* Populate abiflags using existing information. */
if (in_tdata->abiflags_valid)
{
obj_attribute *in_attr = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU];
+ Elf_Internal_ABIFlags_v0 in_abiflags;
+ Elf_Internal_ABIFlags_v0 abiflags;
+
+ /* Set up the FP ABI attribute from the abiflags if it is not already
+ set. */
if (in_attr[Tag_GNU_MIPS_ABI_FP].i == Val_GNU_MIPS_ABI_FP_ANY)
in_attr[Tag_GNU_MIPS_ABI_FP].i = in_tdata->abiflags.fp_abi;
- }
- if (!mips_elf_merge_obj_attributes (ibfd, obfd))
- return FALSE;
-
- /* Populate abiflags using existing information. */
- if (!in_tdata->abiflags_valid)
- {
- infer_mips_abiflags (ibfd, &in_tdata->abiflags);
- in_tdata->abiflags_valid = TRUE;
- }
- else
- {
- Elf_Internal_ABIFlags_v0 abiflags;
- Elf_Internal_ABIFlags_v0 in_abiflags;
infer_mips_abiflags (ibfd, &abiflags);
in_abiflags = in_tdata->abiflags;
@@ -15137,6 +15127,14 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
".MIPS.abiflags (0x%lx)"), ibfd,
(unsigned long) in_abiflags.flags2);
}
+ else
+ {
+ infer_mips_abiflags (ibfd, &in_tdata->abiflags);
+ in_tdata->abiflags_valid = TRUE;
+ }
+
+ if (!mips_elf_merge_obj_attributes (ibfd, obfd))
+ return FALSE;
if (!out_tdata->abiflags_valid)
{