diff options
author | Maciej W. Rozycki <macro@imgtec.com> | 2016-01-04 23:30:00 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@imgtec.com> | 2016-01-04 23:30:00 +0000 |
commit | d537eeb527bb80fb791d22a7eedec245856b9d35 (patch) | |
tree | 662e3b839feee9b1ef630b85561d129bb493c6de /ld | |
parent | 43d223b5430a93dc0d777276471128800b9887cf (diff) | |
download | gdb-d537eeb527bb80fb791d22a7eedec245856b9d35.zip gdb-d537eeb527bb80fb791d22a7eedec245856b9d35.tar.gz gdb-d537eeb527bb80fb791d22a7eedec245856b9d35.tar.bz2 |
MIPS/BFD: Move attribute check after ELF file header flag check
We have a problem in that in making compatibility checks while merging
private BFD data on the MIPS target we give priority to the attribute
check, which may fail and cause the function to abort early on. The
problem with this is the ABI compatibility aspect recorded in the
attributes is relatively minor compared to aspects recorded in the ELF
file header. However the premature exit causes any more important
compatibility aspect violated to be masked and not reported to the user
once a problem with attributes has been noticed.
So move the attribute check after the ELF file header flag check in
`_bfd_mips_elf_merge_private_bfd_data', and do not return prematurely
there. Take advantage of the resulting grouping of ELF file header
handling together and remove the premature success return point for the
first input object being handled, letting the code later on figure out
output ABI flags even for this object.
Update LD test cases according to messages from ELF file header checks
now preceding ones from attribute checks.
bfd/
* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Move
attribute check after ELF file header flag check.
ld/
* testsuite/ld-mips-elf/attr-gnu-4-14.d: Update the order of
messages expected according to MIPS BFD private data merge
changes.
* testsuite/ld-mips-elf/attr-gnu-4-24.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-34.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-41.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-42.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-43.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-45.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-46.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-47.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-48.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-49.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-54.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-64.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-74.d: Likewise.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 19 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-14.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-24.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-34.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-41.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-42.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-43.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-45.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-46.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-47.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-48.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-49.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-54.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-64.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/attr-gnu-4-74.d | 4 |
15 files changed, 47 insertions, 28 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 64eeded..8a062e1 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,22 @@ +2016-01-04 Maciej W. Rozycki <macro@imgtec.com> + + * testsuite/ld-mips-elf/attr-gnu-4-14.d: Update the order of + messages expected according to MIPS BFD private data merge + changes. + * testsuite/ld-mips-elf/attr-gnu-4-24.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-34.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-41.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-42.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-43.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-45.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-46.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-47.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-48.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-49.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-54.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-64.d: Likewise. + * testsuite/ld-mips-elf/attr-gnu-4-74.d: Likewise. + 2016-01-01 Alan Modra <amodra@gmail.com> Update year range in copyright notice of all files. diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-14.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-14.d index 58cfd24..417ad0a 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-14.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-14.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-1.s #source: attr-gnu-4-4.s -W #ld: -r -#error: \A[^\n]*: Warning: .* uses -mdouble-float \(set by .*\), .* uses -mips32r2 -mfp64 \(12 callee-saved\)\n -#error: [^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: [^\n]*: Warning: .* uses -mdouble-float \(set by .*\), .* uses -mips32r2 -mfp64 \(12 callee-saved\)\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-24.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-24.d index e48e5bb..608ef0e 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-24.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-24.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-2.s #source: attr-gnu-4-4.s -W #ld: -r -#error: \A[^\n]*: Warning: .* uses -msingle-float \(set by .*\), .* uses -mips32r2 -mfp64 \(12 callee-saved\)\n -#error: [^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: [^\n]*: Warning: .* uses -msingle-float \(set by .*\), .* uses -mips32r2 -mfp64 \(12 callee-saved\)\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-34.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-34.d index 314515a..f8328b5 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-34.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-34.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-3.s #source: attr-gnu-4-4.s -W #ld: -r -#error: \A[^\n]*: Warning: .* uses -msoft-float \(set by .*\), .* uses -mhard-float\n -#error: [^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: [^\n]*: Warning: .* uses -msoft-float \(set by .*\), .* uses -mhard-float\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d index 7c61365..ff6e6e4 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-4.s -W #source: attr-gnu-4-1.s #ld: -r -#error: \A[^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -mdouble-float\n -#error: [^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: [^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -mdouble-float\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-42.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-42.d index dad0421..aa17693 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-42.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-42.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-4.s -W #source: attr-gnu-4-2.s #ld: -r -#error: \A[^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -msingle-float\n -#error: [^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: [^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -msingle-float\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-43.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-43.d index f30c18e..ddc0199 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-43.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-43.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-4.s -W #source: attr-gnu-4-3.s #ld: -r -#error: \A[^\n]*: Warning: .* uses -mhard-float \(set by .*\), .* uses -msoft-float\n -#error: [^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: [^\n]*: Warning: .* uses -mhard-float \(set by .*\), .* uses -msoft-float\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-45.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-45.d index c8716e3..b60b983 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-45.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-45.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-4.s -W -mips32r2 #source: attr-gnu-4-5.s #ld: -r -#error: \A[^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -mfpxx\n -#error: [^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: [^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -mfpxx\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-46.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-46.d index 9fa1b01..82dd22b 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-46.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-46.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-4.s -W -mips32r2 #source: attr-gnu-4-6.s #ld: -r -#error: \A[^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -mgp32 -mfp64\n -#error: [^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: [^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -mgp32 -mfp64\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-47.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-47.d index acb736b..eda8a27 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-47.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-47.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-4.s -W -mips32r2 #source: attr-gnu-4-7.s #ld: -r -#error: \A[^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -mgp32 -mfp64 -mno-odd-spreg\n -#error: [^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: [^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -mgp32 -mfp64 -mno-odd-spreg\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-48.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-48.d index cb4dcb6..084922b 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-48.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-48.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-4.s -W #source: attr-gnu-4-8.s -W #ld: -r -#error: \A[^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses unknown floating point ABI 8\n -#error: [^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: [^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses unknown floating point ABI 8\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-49.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-49.d index d03074e..24e5145 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-49.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-49.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-4.s -W #source: attr-gnu-4-9.s -W #ld: -r -#error: \A[^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses unknown floating point ABI 9\n -#error: [^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n +#error: [^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses unknown floating point ABI 9\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-54.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-54.d index 04155af..70d6b94 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-54.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-54.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-5.s #source: attr-gnu-4-4.s -W -mips32r2 #ld: -r -#error: \A[^\n]*: Warning: .* uses -mfpxx \(set by .*\), .* uses -mips32r2 -mfp64 \(12 callee-saved\)\n -#error: [^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: [^\n]*: Warning: .* uses -mfpxx \(set by .*\), .* uses -mips32r2 -mfp64 \(12 callee-saved\)\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-64.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-64.d index 98a3b34..9b4fbd8 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-64.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-64.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-6.s #source: attr-gnu-4-4.s -W -mips32r2 #ld: -r -#error: \A[^\n]*: Warning: .* uses -mgp32 -mfp64 \(set by .*\), .* uses -mips32r2 -mfp64 \(12 callee-saved\)\n -#error: [^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: [^\n]*: Warning: .* uses -mgp32 -mfp64 \(set by .*\), .* uses -mips32r2 -mfp64 \(12 callee-saved\)\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-74.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-74.d index 90eeaff..e281ae5 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-74.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-74.d @@ -1,6 +1,6 @@ #source: attr-gnu-4-7.s #source: attr-gnu-4-4.s -W -mips32r2 #ld: -r -#error: \A[^\n]*: Warning: .* uses -mgp32 -mfp64 -mno-odd-spreg \(set by .*\), .* uses -mips32r2 -mfp64 \(12 callee-saved\)\n -#error: [^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: \A[^\n]*: [^\n]* linking -mfp64 module with previous -mfp32 modules\n +#error: [^\n]*: Warning: .* uses -mgp32 -mfp64 -mno-odd-spreg \(set by .*\), .* uses -mips32r2 -mfp64 \(12 callee-saved\)\n #error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z |