This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RFA: Fix -mips32r2 failures on mips64-linux-gnu
- From: Richard Sandiford <rsandifo at nildram dot co dot uk>
- To: binutils at sourceware dot org
- Date: Tue, 11 Mar 2008 10:17:05 +0000
- Subject: RFA: Fix -mips32r2 failures on mips64-linux-gnu
Some gas and ld tests use -mips32r2 without forcing a 32-bit ABI.
This leads to failures on mips64-linux-gnu.
For gas it's as simple as adding "-32", and I'd have installed this
part as obvious.
However, if you specify an ABI in the ld tests, you also need to specify
an emulation, which (a) leads to the usual "traditional or not traditional?"
quandry and (b) forces you to choose an endianness. All in all, it seems
better to force an ABI and endianness only where necessary.
We may need to override o32_as_flags and o32_ld_flags for other
targets too, but this is enough for the targets I usually use.
We can always extend the code to other targets as we find the need.
Tested on mips64-linux-gnu, mipsel-linux-gnu, mips64el-elf and mips-elf.
Some of the tests fail on mips*-elf before and after the patch, but none
of them get worse.
OK to install?
Richard
gas/testsuite/
* gas/mips/elf-rel26.d: Add -32.
* gas/mips/mips16-intermix.d: Likewise.
ld/testsuite/
* ld-mips-elf/mips-elf.exp (o32_as_flags, o32_ld_flags): New variables.
(mips16_call_global_test, mips16_intermix_test): Use them.
Index: gas/testsuite/gas/mips/elf-rel26.d
===================================================================
--- gas/testsuite/gas/mips/elf-rel26.d 2008-03-11 09:47:46.000000000 +0000
+++ gas/testsuite/gas/mips/elf-rel26.d 2008-03-11 09:48:06.000000000 +0000
@@ -1,4 +1,4 @@
-#as: -mips32 -EL -KPIC
+#as: -mips32 -32 -EL -KPIC
#readelf: --relocs
#name: MIPS ELF reloc 26
Index: gas/testsuite/gas/mips/mips16-intermix.d
===================================================================
--- gas/testsuite/gas/mips/mips16-intermix.d 2008-03-11 09:47:46.000000000 +0000
+++ gas/testsuite/gas/mips/mips16-intermix.d 2008-03-11 09:48:06.000000000 +0000
@@ -1,5 +1,5 @@
#objdump: -t
-#as: -mips32r2
+#as: -mips32r2 -32
#name: MIPS16 intermix
.*: +file format .*mips.*
Index: ld/testsuite/ld-mips-elf/mips-elf.exp
===================================================================
--- ld/testsuite/ld-mips-elf/mips-elf.exp 2008-03-11 09:47:46.000000000 +0000
+++ ld/testsuite/ld-mips-elf/mips-elf.exp 2008-03-11 09:48:06.000000000 +0000
@@ -56,6 +56,13 @@ set has_newabi [expr [istarget *-*-irix6
set linux_gnu [expr [istarget mips*-*-linux*]]
set embedded_elf [expr [istarget mips*-*-elf]]
+if { [istarget mips64*-linux-gnu] } {
+ set o32_as_flags "-32 -EB"
+ set o32_ld_flags "-melf32btsmip"
+} else {
+ set o32_as_flags ""
+ set o32_ld_flags ""
+}
# Check MIPS16 markings being passed through link.
run_dump_test "mips16-1"
@@ -264,23 +271,23 @@ if {[istarget mips*-*-linux*]} {
run_ld_link_tests $mips_tls_tests
}
-set mips16_call_global_test {
- {"Global calls from mips16"
- ""
- "-mips32r2" {mips16-call-global-1.s mips16-call-global-2.s mips16-call-global-3.s}
- {{objdump -dr mips16-call-global.d}}
- "mips16-call-global"}
-}
+set mips16_call_global_test [list \
+ [list "Global calls from mips16" \
+ "$o32_ld_flags" \
+ "$o32_as_flags -mips32r2" \
+ {mips16-call-global-1.s mips16-call-global-2.s mips16-call-global-3.s} \
+ {{objdump -dr mips16-call-global.d}} \
+ "mips16-call-global"]]
run_ld_link_tests $mips16_call_global_test
-set mips16_intermix_test {
- {"Intermixing mips32 and mips16 functions"
- ""
- "-mips32r2" {mips16-intermix-1.s mips16-intermix-2.s}
- {{objdump -t mips16-intermix.d}}
- "mips16-intermix"}
-}
+set mips16_intermix_test [list \
+ [list "Intermixing mips32 and mips16 functions" \
+ "$o32_ld_flags" \
+ "$o32_as_flags -mips32r2" \
+ {mips16-intermix-1.s mips16-intermix-2.s} \
+ {{objdump -t mips16-intermix.d}} \
+ "mips16-intermix"]]
run_ld_link_tests $mips16_intermix_test