aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-mips-elf
diff options
context:
space:
mode:
authorYunQiang Su <yunqiang.su@cipunited.com>2023-05-10 15:50:19 +0800
committerYunQiang Su <yunqiang.su@cipunited.com>2023-06-05 11:00:14 +0800
commitffc528aed56b9e2c171137da28690a9bb6861b0b (patch)
tree8e6247b2959f909c50551bbd3ec0777ebe32781b /ld/testsuite/ld-mips-elf
parentbe0d391f22fe6009c3be907753975a984cbbcc23 (diff)
downloadgdb-ffc528aed56b9e2c171137da28690a9bb6861b0b.zip
gdb-ffc528aed56b9e2c171137da28690a9bb6861b0b.tar.gz
gdb-ffc528aed56b9e2c171137da28690a9bb6861b0b.tar.bz2
MIPS: fix r6 testsuites
Introduce run_dump_test_o32l run_dump_test_n32l run_dump_test_n64l Which use `-march=from-abi` for pre-R6 testcases, like micromips/mips16e etc. For cases doesn't use run_dump_test_*, we use -mips32r2 for micromips32 -mips1 for mips16-32 -march=from-abi for testcases to o32/n32/n64 both/all. Replace `addi` with `addiu` for some cases for both r6 and pre-R6. Introduce some new testcases for r6 with FPXX/FP64. Introduce new testcase: comdat-reloc-r6. Skip `default` in mips_arch_list_matching if triple is mipsisa*, due to: 1)it will cannot match mipsr6@*.d: since mips32rN/mips64rN will always be used, it won't be a problem. 2)some test think -march=mips64rN will alway true for mipsisa64rN, which is not true now. This patch fix testsuite for all r6-default gnu triples: mipsisa32r6-linux-gnu mipsisa32r6el-linux-gnu mips-img-linux-gnu mipsel-img-linux-gnu mipsisa64r6-linux-gnu mipsisa64r6el-linux-gnu
Diffstat (limited to 'ld/testsuite/ld-mips-elf')
-rw-r--r--ld/testsuite/ld-mips-elf/attr-gnu-4-01.d1
-rw-r--r--ld/testsuite/ld-mips-elf/attr-gnu-4-11.d1
-rw-r--r--ld/testsuite/ld-mips-elf/attr-gnu-4-40.d1
-rw-r--r--ld/testsuite/ld-mips-elf/attr-gnu-4-41.d1
-rw-r--r--ld/testsuite/ld-mips-elf/attr-gnu-8-00.d1
-rw-r--r--ld/testsuite/ld-mips-elf/attr-gnu-8-01.d1
-rw-r--r--ld/testsuite/ld-mips-elf/attr-gnu-8-02.d1
-rw-r--r--ld/testsuite/ld-mips-elf/attr-gnu-8-10.d1
-rw-r--r--ld/testsuite/ld-mips-elf/attr-gnu-8-11.d1
-rw-r--r--ld/testsuite/ld-mips-elf/attr-gnu-8-20.d1
-rw-r--r--ld/testsuite/ld-mips-elf/attr-gnu-8-22.d1
-rw-r--r--ld/testsuite/ld-mips-elf/emit-relocs-1.d2
-rw-r--r--ld/testsuite/ld-mips-elf/gp-disp-sym.s2
-rw-r--r--ld/testsuite/ld-mips-elf/jalr3.dd2
-rw-r--r--ld/testsuite/ld-mips-elf/jalx-1.d2
-rw-r--r--ld/testsuite/ld-mips-elf/mips-elf.exp316
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-1.d4
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-and-micromips.d4
-rw-r--r--ld/testsuite/ld-mips-elf/mode-change-error-1.d4
-rw-r--r--ld/testsuite/ld-mips-elf/n64-plt-1.dd2
-rw-r--r--ld/testsuite/ld-mips-elf/n64-plt-4.dd2
-rw-r--r--ld/testsuite/ld-mips-elf/nan-legacy.d1
-rw-r--r--ld/testsuite/ld-mips-elf/nan-mixed-1.d1
-rw-r--r--ld/testsuite/ld-mips-elf/nan-mixed-2.d1
-rw-r--r--ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d2
-rw-r--r--ld/testsuite/ld-mips-elf/reloc-3.d2
26 files changed, 208 insertions, 150 deletions
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d
index 24d051d..71bce95 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d
@@ -1,5 +1,6 @@
#source: attr-gnu-4-0.s
#source: attr-gnu-4-1.s
+#as: -march=from-abi
#ld: -r
#readelf: -A
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d
index ce94a81..12268fb 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d
@@ -1,5 +1,6 @@
#source: attr-gnu-4-1.s
#source: attr-gnu-4-1.s
+#as: -march=from-abi
#ld: -r
#readelf: -A
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-40.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-40.d
index 6aa22b9..67f2bdf 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-40.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-40.d
@@ -1,5 +1,6 @@
#source: attr-gnu-4-4.s -W
#source: attr-gnu-4-0.s
+#as: -march=from-abi
#ld: -r
#error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\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 49f2137..029d0ed 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d
@@ -1,5 +1,6 @@
#source: attr-gnu-4-4.s -W
#source: attr-gnu-4-1.s
+#as: -march=from-abi
#ld: -r
#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
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d
index 2f8e5f0..a8a2aaa 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d
@@ -1,5 +1,6 @@
#source: attr-gnu-8-0.s
#source: attr-gnu-8-0.s
+#as: -march=from-abi
#ld: -r
#readelf: -A
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d
index e2cda33..82006ff 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d
@@ -1,5 +1,6 @@
#source: attr-gnu-8-0.s
#source: attr-gnu-8-1.s
+#as: -march=from-abi
#ld: -r
#readelf: -A
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d
index 54b196f..9f08a43 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d
@@ -1,5 +1,6 @@
#source: attr-gnu-8-0.s
#source: attr-gnu-8-2.s
+#as: -march=from-abi
#ld: -r
#readelf: -A
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d
index f7c512b..9796282 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d
@@ -1,5 +1,6 @@
#source: attr-gnu-8-1.s
#source: attr-gnu-8-0.s
+#as: -march=from-abi
#ld: -r
#readelf: -A
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d
index be87af4..8d3cf40 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d
@@ -1,5 +1,6 @@
#source: attr-gnu-8-1.s
#source: attr-gnu-8-1.s
+#as: -march=from-abi
#ld: -r
#readelf: -A
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d
index 05f4da0..02abcc7 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d
@@ -1,5 +1,6 @@
#source: attr-gnu-8-2.s
#source: attr-gnu-8-0.s
+#as: -march=from-abi
#ld: -r
#readelf: -A
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d
index 908ce4f..164bc25 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d
@@ -1,5 +1,6 @@
#source: attr-gnu-8-2.s
#source: attr-gnu-8-2.s
+#as: -march=from-abi
#ld: -r
#readelf: -A
diff --git a/ld/testsuite/ld-mips-elf/emit-relocs-1.d b/ld/testsuite/ld-mips-elf/emit-relocs-1.d
index 0de0729..32e15a2 100644
--- a/ld/testsuite/ld-mips-elf/emit-relocs-1.d
+++ b/ld/testsuite/ld-mips-elf/emit-relocs-1.d
@@ -23,7 +23,7 @@ OFFSET +TYPE +VALUE
Contents of section \.text:
- 80000 03e00008 00000000 00000000 00000000 .*
+ 80000 03e0000[89] 00000000 00000000 00000000 .*
Contents of section \.merge1:
80400 666c7574 74657200 flutter.*
Contents of section \.merge2:
diff --git a/ld/testsuite/ld-mips-elf/gp-disp-sym.s b/ld/testsuite/ld-mips-elf/gp-disp-sym.s
index c6380ba..3b06e71 100644
--- a/ld/testsuite/ld-mips-elf/gp-disp-sym.s
+++ b/ld/testsuite/ld-mips-elf/gp-disp-sym.s
@@ -2,4 +2,4 @@
.text
foo:
lui $t0, %hi(_gp_disp)
- addi $t0, $t0, %lo(_gp_disp)
+ addiu $t0, $t0, %lo(_gp_disp)
diff --git a/ld/testsuite/ld-mips-elf/jalr3.dd b/ld/testsuite/ld-mips-elf/jalr3.dd
index 6b6d484..5c9d83f 100644
--- a/ld/testsuite/ld-mips-elf/jalr3.dd
+++ b/ld/testsuite/ld-mips-elf/jalr3.dd
@@ -9,6 +9,6 @@ Disassembly of section \.text:
c: 00000000 nop
0+000010 <\$bar>:
- 10: 03e00008 jr ra
+ 10: 03e0000[89] jr ra
14: 00000000 nop
\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/jalx-1.d b/ld/testsuite/ld-mips-elf/jalx-1.d
index f082628..80c3be2 100644
--- a/ld/testsuite/ld-mips-elf/jalx-1.d
+++ b/ld/testsuite/ld-mips-elf/jalx-1.d
@@ -1,5 +1,5 @@
#name: MIPS jalx-1
-#source: jalx-1.s
+#source: jalx-1.s -march=from-abi
#ld: -T jalx-1.ld
#objdump: -d
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index 920bb12..ff9635e 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -72,7 +72,8 @@ proc run_dump_test_abi { abi name args } {
set asflags [regsub -- {-march=[^[:blank:]]*} $asflags {}]
set args [lreplace $args 0 0]
}
- if !$has_abi($abi) {
+ set abi_r [regsub "l$" $abi {}]
+ if !$has_abi($abi_r) {
lappend args {notarget *-*-*}
}
if { [llength $args] > 0 } {
@@ -91,6 +92,13 @@ proc run_dump_test_abi { abi name args } {
proc run_dump_test_o32 { name args } {
run_dump_test_abi o32 $name [lindex $args 0]
}
+proc run_dump_test_o32l { name args } {
+ if {[istarget *-linux*] || [istarget *-img-elf]} {
+ run_dump_test_abi o32l $name [lindex $args 0]
+ } else {
+ run_dump_test_abi o32 $name [lindex $args 0]
+ }
+}
# run_dump_test_n32 NAME ARGS
#
@@ -99,6 +107,13 @@ proc run_dump_test_o32 { name args } {
proc run_dump_test_n32 { name args } {
run_dump_test_abi n32 $name [lindex $args 0]
}
+proc run_dump_test_n32l { name args } {
+ if {[istarget *-linux*] || [istarget *-img-elf]} {
+ run_dump_test_abi n32l $name [lindex $args 0]
+ } else {
+ run_dump_test_abi n32 $name [lindex $args 0]
+ }
+}
# run_dump_test_n64 NAME ARGS
#
@@ -107,6 +122,13 @@ proc run_dump_test_n32 { name args } {
proc run_dump_test_n64 { name args } {
run_dump_test_abi n64 $name [lindex $args 0]
}
+proc run_dump_test_n64l { name args } {
+ if {[istarget *-linux*] || [istarget *-img-elf]} {
+ run_dump_test_abi n64l $name [lindex $args 0]
+ } else {
+ run_dump_test_abi n64 $name [lindex $args 0]
+ }
+}
# run_dump_test_eabi NAME ARGS
#
@@ -139,49 +161,69 @@ set linux_gnu [expr [istarget mips*-*-linux*]]
set embedded_elf [expr [istarget mips*-*-elf]]
# Set defaults.
+# ABI with l tail means legacy, aka pre-R6.
+# Please use them, if the test only suite for pre-R6,
+# such as mips16/micromips tests.
set abi_asflags(o32) ""
+set abi_asflags(o32l) ""
set abi_asflags(n32) ""
+set abi_asflags(n32l) ""
set abi_asflags(n64) ""
+set abi_asflags(n64l) ""
set abi_asflags(eabi) ""
set abi_ldflags(o32) ""
+set abi_ldflags(o32l) ""
set abi_ldflags(n32) ""
+set abi_ldflags(n32l) ""
set abi_ldflags(n64) ""
+set abi_ldflags(n64l) ""
set abi_ldflags(eabi) ""
# Override as needed.
if {[istarget *-*-openbsd*] } {
set irixemul 0
-} elseif { [istarget mips64*-*-linux*] } {
+} elseif { [istarget mips*64*-*-linux*] } {
+ set abi_asflags(o32) -32
+ set abi_asflags(o32l) "-32 -march=from-abi"
+ set abi_asflags(n32) ""
+ set abi_asflags(n32l) "-n32 -march=from-abi"
+ set abi_asflags(n64) "-64"
+ set abi_asflags(n64l) "-march=from-abi -64"
if [istarget *el-*-*] {
- set abi_asflags(o32) -32
set abi_ldflags(o32) -melf32ltsmip
- set abi_asflags(n64) "-march=from-abi -64"
+ set abi_ldflags(o32l) -melf32ltsmip
set abi_ldflags(n64) -melf64ltsmip
+ set abi_ldflags(n64l) -melf64ltsmip
} else {
- set abi_asflags(o32) -32
set abi_ldflags(o32) -melf32btsmip
- set abi_asflags(n64) "-march=from-abi -64"
+ set abi_ldflags(o32l) -melf32btsmip
set abi_ldflags(n64) -melf64btsmip
+ set abi_ldflags(n64l) -melf64btsmip
}
set irixemul 0
-} elseif {[istarget *-*-linux*] } {
+} elseif {[istarget *-*-linux*] || [istarget *-img-elf] } {
+ set abi_asflags(o32) ""
+ set abi_asflags(o32l) "-march=from-abi"
+ set abi_asflags(n32) "-n32"
+ set abi_asflags(n32l) "-n32 -march=from-abi"
+ set abi_asflags(n64) "-64"
+ set abi_asflags(n64l) "-64 -march=from-abi"
if [istarget *el-*-*] {
- set abi_asflags(n32) "-march=from-abi -n32"
set abi_ldflags(n32) -melf32ltsmipn32
- set abi_asflags(n64) "-march=from-abi -64"
+ set abi_ldflags(n32l) -melf32ltsmipn32
set abi_ldflags(n64) -melf64ltsmip
+ set abi_ldflags(n64l) -melf64ltsmip
} else {
- set abi_asflags(n32) "-march=from-abi -n32"
set abi_ldflags(n32) -melf32btsmipn32
- set abi_asflags(n64) "-march=from-abi -64"
+ set abi_ldflags(n32l) -melf32btsmipn32
set abi_ldflags(n64) -melf64btsmip
+ set abi_ldflags(n64l) -melf64btsmip
}
set irixemul 0
} elseif {[istarget *-img-elf*] \
|| [istarget *-mti-elf*] \
|| [istarget *-sde-elf*] \
|| [istarget *-*-netbsd*] \
- || [istarget *-*-linux*] \
|| [istarget *-*-sysv4*] } {
if [istarget *el-*-*] {
set abi_asflags(o32) -32
@@ -305,56 +347,56 @@ run_dump_test "mips16-1"
# MIPS branch offset final link checking.
run_dump_test "branch-misc-1"
run_dump_test "branch-misc-2"
-run_dump_test_o32 "branch-absolute"
-run_dump_test_o32 "branch-absolute-addend"
-run_dump_test_n32 "branch-absolute-n32"
-run_dump_test_n32 "branch-absolute-addend-n32"
-run_dump_test_n64 "branch-absolute-n64"
-run_dump_test_n64 "branch-absolute-addend-n64"
-
-run_dump_test_o32 "mips16-pcrel-0"
-run_dump_test_o32 "mips16-pcrel-1" noarch
-run_dump_test_o32 "mips16e2-pcrel-0" noarch
-run_dump_test_o32 "mips16e2-pcrel-1" noarch
-run_dump_test_o32 "mips16-pcrel-addend-2"
-run_dump_test_o32 "mips16-pcrel-addend-6"
-run_dump_test_o32 "mips16e2-pcrel-addend-2" noarch
-run_dump_test_o32 "mips16e2-pcrel-addend-6" noarch
-run_dump_test_n32 "mips16-pcrel-n32-0"
-run_dump_test_n32 "mips16-pcrel-n32-1"
-run_dump_test_n64 "mips16-pcrel-n64-sym32-0"
-run_dump_test_n64 "mips16-pcrel-n64-sym32-1"
-run_dump_test_n32 "mips16e2-pcrel-n32-0" noarch
-run_dump_test_n32 "mips16e2-pcrel-n32-1" noarch
-run_dump_test_n64 "mips16e2-pcrel-n64-sym32-0" noarch
-run_dump_test_n64 "mips16e2-pcrel-n64-sym32-1" noarch
-
-run_dump_test_o32 "mips16-branch-2"
-run_dump_test_o32 "mips16-branch-3"
-run_dump_test_o32 "mips16-branch-addend-2"
-run_dump_test_o32 "mips16-branch-addend-3"
-run_dump_test_o32 "mips16-branch-absolute"
-run_dump_test_o32 "mips16-branch-absolute-1"
-run_dump_test_o32 "mips16-branch-absolute-2"
-run_dump_test_o32 "mips16-branch-absolute-addend"
-run_dump_test_o32 "mips16-branch-absolute-addend-1"
-run_dump_test_n32 "mips16-branch-absolute-n32"
-run_dump_test_n32 "mips16-branch-absolute-n32-1"
-run_dump_test_n32 "mips16-branch-absolute-n32-2"
-run_dump_test_n32 "mips16-branch-absolute-addend-n32"
-run_dump_test_n32 "mips16-branch-absolute-addend-n32-1"
-run_dump_test_n64 "mips16-branch-absolute-n64"
-run_dump_test_n64 "mips16-branch-absolute-n64-1"
-run_dump_test_n64 "mips16-branch-absolute-n64-2"
-run_dump_test_n64 "mips16-branch-absolute-addend-n64"
-run_dump_test_n64 "mips16-branch-absolute-addend-n64-1"
-
-run_dump_test_o32 "micromips-branch-absolute"
-run_dump_test_o32 "micromips-branch-absolute-addend"
-run_dump_test_n32 "micromips-branch-absolute-n32"
-run_dump_test_n32 "micromips-branch-absolute-addend-n32"
-run_dump_test_n64 "micromips-branch-absolute-n64"
-run_dump_test_n64 "micromips-branch-absolute-addend-n64"
+run_dump_test_o32l "branch-absolute"
+run_dump_test_o32l "branch-absolute-addend"
+run_dump_test_n32l "branch-absolute-n32"
+run_dump_test_n32l "branch-absolute-addend-n32"
+run_dump_test_n64l "branch-absolute-n64"
+run_dump_test_n64l "branch-absolute-addend-n64"
+
+run_dump_test_o32l "mips16-pcrel-0"
+run_dump_test_o32l "mips16-pcrel-1" noarch
+run_dump_test_o32l "mips16e2-pcrel-0" noarch
+run_dump_test_o32l "mips16e2-pcrel-1" noarch
+run_dump_test_o32l "mips16-pcrel-addend-2"
+run_dump_test_o32l "mips16-pcrel-addend-6" noarch
+run_dump_test_o32l "mips16e2-pcrel-addend-2" noarch
+run_dump_test_o32l "mips16e2-pcrel-addend-6" noarch
+run_dump_test_n32l "mips16-pcrel-n32-0"
+run_dump_test_n32l "mips16-pcrel-n32-1"
+run_dump_test_n64l "mips16-pcrel-n64-sym32-0"
+run_dump_test_n64l "mips16-pcrel-n64-sym32-1"
+run_dump_test_n32l "mips16e2-pcrel-n32-0" noarch
+run_dump_test_n32l "mips16e2-pcrel-n32-1" noarch
+run_dump_test_n64l "mips16e2-pcrel-n64-sym32-0" noarch
+run_dump_test_n64l "mips16e2-pcrel-n64-sym32-1" noarch
+
+run_dump_test_o32l "mips16-branch-2"
+run_dump_test_o32l "mips16-branch-3"
+run_dump_test_o32l "mips16-branch-addend-2"
+run_dump_test_o32l "mips16-branch-addend-3"
+run_dump_test_o32l "mips16-branch-absolute"
+run_dump_test_o32l "mips16-branch-absolute-1"
+run_dump_test_o32l "mips16-branch-absolute-2"
+run_dump_test_o32l "mips16-branch-absolute-addend"
+run_dump_test_o32l "mips16-branch-absolute-addend-1"
+run_dump_test_n32l "mips16-branch-absolute-n32"
+run_dump_test_n32l "mips16-branch-absolute-n32-1"
+run_dump_test_n32l "mips16-branch-absolute-n32-2"
+run_dump_test_n32l "mips16-branch-absolute-addend-n32"
+run_dump_test_n32l "mips16-branch-absolute-addend-n32-1"
+run_dump_test_n64l "mips16-branch-absolute-n64"
+run_dump_test_n64l "mips16-branch-absolute-n64-1"
+run_dump_test_n64l "mips16-branch-absolute-n64-2"
+run_dump_test_n64l "mips16-branch-absolute-addend-n64"
+run_dump_test_n64l "mips16-branch-absolute-addend-n64-1"
+
+run_dump_test_o32l "micromips-branch-absolute"
+run_dump_test_o32l "micromips-branch-absolute-addend"
+run_dump_test_n32l "micromips-branch-absolute-n32"
+run_dump_test_n32l "micromips-branch-absolute-addend-n32"
+run_dump_test_n64l "micromips-branch-absolute-n64"
+run_dump_test_n64l "micromips-branch-absolute-addend-n64"
# Jalx test
run_dump_test "jalx-1"
@@ -381,69 +423,69 @@ if { $linux_gnu } {
"jalx-2"]]
}
-run_dump_test_o32 "jalx-addend"
-run_dump_test_o32 "jalx-local"
-run_dump_test_o32 "bal-jalx-addend"
-run_dump_test_o32 "bal-jalx-addend-micromips"
-run_dump_test_o32 "bal-jalx-local"
-run_dump_test_o32 "bal-jalx-local-micromips"
-run_dump_test_o32 "bal-jalx-pic"
-run_dump_test_o32 "bal-jalx-pic-micromips"
-run_dump_test_o32 "bal-jalx-pic-ignore"
-run_dump_test_o32 "bal-jalx-pic-ignore-micromips"
-run_dump_test_n32 "jalx-addend-n32"
-run_dump_test_n32 "jalx-local-n32"
-run_dump_test_n32 "bal-jalx-addend-n32"
-run_dump_test_n32 "bal-jalx-addend-micromips-n32"
-run_dump_test_n32 "bal-jalx-local-n32"
-run_dump_test_n32 "bal-jalx-local-micromips-n32"
-run_dump_test_n32 "bal-jalx-pic-n32"
-run_dump_test_n32 "bal-jalx-pic-micromips-n32"
-run_dump_test_n32 "bal-jalx-pic-ignore-n32"
-run_dump_test_n32 "bal-jalx-pic-ignore-micromips-n32"
-run_dump_test_n64 "jalx-addend-n64"
-run_dump_test_n64 "jalx-local-n64"
-run_dump_test_n64 "bal-jalx-addend-n64"
-run_dump_test_n64 "bal-jalx-addend-micromips-n64"
-run_dump_test_n64 "bal-jalx-local-n64"
-run_dump_test_n64 "bal-jalx-local-micromips-n64"
-run_dump_test_n64 "bal-jalx-pic-n64"
-run_dump_test_n64 "bal-jalx-pic-micromips-n64"
-run_dump_test_n64 "bal-jalx-pic-ignore-n64"
-run_dump_test_n64 "bal-jalx-pic-ignore-micromips-n64"
-
-run_dump_test "unaligned-jalx-0" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-1" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-2" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-3" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-mips16-0" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-mips16-1" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-micromips-0" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-micromips-1" [list [list ld $abi_ldflags(o32)]]
-
-run_dump_test_n32 "unaligned-jalx-addend-0"
-run_dump_test_n32 "unaligned-jalx-addend-1"
-run_dump_test_n32 "unaligned-jalx-addend-2"
-run_dump_test_n32 "unaligned-jalx-addend-3"
-run_dump_test_n32 "unaligned-jalx-addend-mips16-0"
-run_dump_test_n32 "unaligned-jalx-addend-mips16-1"
-run_dump_test_n32 "unaligned-jalx-addend-micromips-0"
-run_dump_test_n32 "unaligned-jalx-addend-micromips-1"
+run_dump_test_o32l "jalx-addend"
+run_dump_test_o32l "jalx-local"
+run_dump_test_o32l "bal-jalx-addend"
+run_dump_test_o32l "bal-jalx-addend-micromips"
+run_dump_test_o32l "bal-jalx-local"
+run_dump_test_o32l "bal-jalx-local-micromips"
+run_dump_test_o32l "bal-jalx-pic"
+run_dump_test_o32l "bal-jalx-pic-micromips"
+run_dump_test_o32l "bal-jalx-pic-ignore"
+run_dump_test_o32l "bal-jalx-pic-ignore-micromips"
+run_dump_test_n32l "jalx-addend-n32"
+run_dump_test_n32l "jalx-local-n32"
+run_dump_test_n32l "bal-jalx-addend-n32"
+run_dump_test_n32l "bal-jalx-addend-micromips-n32"
+run_dump_test_n32l "bal-jalx-local-n32"
+run_dump_test_n32l "bal-jalx-local-micromips-n32"
+run_dump_test_n32l "bal-jalx-pic-n32"
+run_dump_test_n32l "bal-jalx-pic-micromips-n32"
+run_dump_test_n32l "bal-jalx-pic-ignore-n32"
+run_dump_test_n32l "bal-jalx-pic-ignore-micromips-n32"
+run_dump_test_n64l "jalx-addend-n64"
+run_dump_test_n64l "jalx-local-n64"
+run_dump_test_n64l "bal-jalx-addend-n64"
+run_dump_test_n64l "bal-jalx-addend-micromips-n64"
+run_dump_test_n64l "bal-jalx-local-n64"
+run_dump_test_n64l "bal-jalx-local-micromips-n64"
+run_dump_test_n64l "bal-jalx-pic-n64"
+run_dump_test_n64l "bal-jalx-pic-micromips-n64"
+run_dump_test_n64l "bal-jalx-pic-ignore-n64"
+run_dump_test_n64l "bal-jalx-pic-ignore-micromips-n64"
+
+run_dump_test_o32l "unaligned-jalx-0" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-1" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-2" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-3" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-mips16-0" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-mips16-1" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-micromips-0" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-micromips-1" [list [list ld $abi_ldflags(o32)]]
+
+run_dump_test_n32l "unaligned-jalx-addend-0"
+run_dump_test_n32l "unaligned-jalx-addend-1"
+run_dump_test_n32l "unaligned-jalx-addend-2"
+run_dump_test_n32l "unaligned-jalx-addend-3"
+run_dump_test_n32l "unaligned-jalx-addend-mips16-0"
+run_dump_test_n32l "unaligned-jalx-addend-mips16-1"
+run_dump_test_n32l "unaligned-jalx-addend-micromips-0"
+run_dump_test_n32l "unaligned-jalx-addend-micromips-1"
run_dump_test_o32 "unaligned-branch" noarch
-run_dump_test_n32 "unaligned-branch-2"
-run_dump_test_n32 "unaligned-branch-ignore-2"
+run_dump_test_n32l "unaligned-branch-2"
+run_dump_test_n32l "unaligned-branch-ignore-2"
run_dump_test_n32 "unaligned-branch-r6-1"
run_dump_test_n32 "unaligned-branch-ignore-r6-1"
run_dump_test_n32 "unaligned-branch-r6-2" noarch
-run_dump_test_n32 "unaligned-branch-mips16"
-run_dump_test_n32 "unaligned-branch-ignore-mips16"
-run_dump_test_n32 "unaligned-branch-micromips"
-run_dump_test_n32 "unaligned-branch-ignore-micromips"
-run_dump_test_n32 "unaligned-jump"
-run_dump_test_n32 "unaligned-jump-mips16"
-run_dump_test_n32 "unaligned-jump-micromips"
+run_dump_test_n32l "unaligned-branch-mips16"
+run_dump_test_n32l "unaligned-branch-ignore-mips16"
+run_dump_test_n32l "unaligned-branch-micromips"
+run_dump_test_n32l "unaligned-branch-ignore-micromips"
+run_dump_test_n32l "unaligned-jump"
+run_dump_test_n32l "unaligned-jump-mips16"
+run_dump_test_n32l "unaligned-jump-micromips"
run_dump_test_o32 "unaligned-lwpc-0" noarch
run_dump_test_o32 "unaligned-lwpc-1" noarch
@@ -474,11 +516,11 @@ if { $linux_gnu } {
}
if { $embedded_elf } {
- run_dump_test_n32 "elf-rel-got-n32-embed" {{as -EB} {ld -EB}}
- run_dump_test_n32 "elf-rel-xgot-n32-embed" {{as -EB} {ld -EB}}
+ run_dump_test_n32l "elf-rel-got-n32-embed" {{as -EB} {ld -EB}}
+ run_dump_test_n32l "elf-rel-xgot-n32-embed" {{as -EB} {ld -EB}}
} else {
- run_dump_test_n32 "elf-rel-got-n32" {{as -EB} {ld -EB}}
- run_dump_test_n32 "elf-rel-xgot-n32" {{as -EB} {ld -EB}}
+ run_dump_test_n32l "elf-rel-got-n32" {{as -EB} {ld -EB}}
+ run_dump_test_n32l "elf-rel-xgot-n32" {{as -EB} {ld -EB}}
}
if { $irix } {
run_dump_test_n64 "elf-rel-got-n64-irix"
@@ -487,8 +529,8 @@ if { $irix } {
run_dump_test_n64 "elf-rel-got-n64-embed" {{as -EB} {ld -EB}}
run_dump_test_n64 "elf-rel-xgot-n64-embed" {{as -EB} {ld -EB}}
} else {
- run_dump_test_n64 "elf-rel-got-n64" {{as -EB} {ld -EB}}
- run_dump_test_n64 "elf-rel-xgot-n64" {{as -EB} {ld -EB}}
+ run_dump_test_n64l "elf-rel-got-n64" {{as -EB} {ld -EB}}
+ run_dump_test_n64l "elf-rel-xgot-n64" {{as -EB} {ld -EB}}
}
run_dump_test_n32 "relax-jalr-n32" {{as -EB} {ld -EB}}
@@ -795,8 +837,8 @@ run_dump_test_n32 "jalbal" noarch
run_dump_test "mode-change-error-1"
-run_dump_test_o32 "mips16-hilo"
-run_dump_test_n32 "mips16-hilo-n32"
+run_dump_test_o32l "mips16-hilo"
+run_dump_test_n32l "mips16-hilo-n32"
if { $linux_gnu } {
run_dump_test_n32 "textrel-1"
@@ -865,8 +907,8 @@ if { $linux_gnu && $has_abi(o32) } {
set base_syms 1
foreach { isa aflag lflag suffix } \
{ MIPS -march=mips1 "" "" \
- microMIPS -mmicromips "" -micromips \
- "microMIPS insn32" "-mmicromips -minsn32" --insn32 \
+ microMIPS "-mips32r2 -mmicromips" "" -micromips \
+ "microMIPS insn32" "-mips32r2 -mmicromips -minsn32" --insn32 \
-micromips-insn32 } {
foreach dynsym { 7fff 8000 fff0 10000 2fe80 } {
run_ld_link_tests \
@@ -1206,7 +1248,7 @@ foreach { abi } $abis {
[list \
"MIPS JALR reloc unaligned/cross-mode link test ($abi)" \
"$abi_ldflags($abi) -T jalr3.ld" "" \
- "$abi_asflags($abi)" \
+ "$abi_asflags($abi) -march=from-abi" \
[list ../../../gas/testsuite/gas/mips/jalr4.s] \
[list "objdump {-d --prefix-addresses --show-raw-insn} jalr4.dd"] \
"jalr4-${abi}"] \
@@ -1244,6 +1286,8 @@ proc run_mips_plt_test { name abi filter micromips suffix {extra {}} } {
append as_flags " --defsym micromips=$micromips --defsym $abi=1"
if {[string equal $abi o32]} {
append as_flags " -march=mips2"
+ } else {
+ append as_flags " -march=mips3"
}
set ld_flags "$abi_ldflags($abi) -T compressed-plt-1.ld"
set dynobj "tmpdir/compressed-plt-1-${abi}-dyn.so"
@@ -1383,7 +1427,7 @@ if { $has_abi(o32) } {
run_ld_link_tests [list \
[list \
"PR ld/21334 MIPS GOT16 relocation in static binary" \
- "$abi_ldflags(o32) -e foo -T pr21334.ld" "" "$abi_asflags(o32)" \
+ "$abi_ldflags(o32) -e foo -T pr21334.ld" "" "$abi_asflags(o32) -march=from-abi" \
{pr21334.s} \
{{objdump {-d --prefix-addresses} pr21334.dd} \
{readelf -A pr21334.gd}} \
@@ -1418,7 +1462,7 @@ if { $has_abi(o32) } {
[list \
"microMIPS link PIC branch relaxation with offset" \
"$abi_ldflags(o32) -shared -T relax-offset.ld" "" \
- "$abi_asflags(o32) -relax-branch -mmicromips" \
+ "$abi_asflags(o32) -relax-branch -mips32r2 -mmicromips" \
{../../../gas/testsuite/gas/mips/relax-offset.s} \
{{objdump \
{-d --prefix-addresses --show-raw-insn} \
@@ -1571,7 +1615,7 @@ proc run_mips_undefweak_test { name abi args } {
"$name" \
"$abi_ldflags($abi) -e foo -T pr21375${scrsuf}.ld ${ldxtra}" \
"" \
- "$abi_asflags($abi) ${asxtra}" \
+ "$abi_asflags($abi) -march=from-abi ${asxtra}" \
[list pr21375${srcsuf}.s] \
[list \
[list objdump -d pr21375${objsuf}.dd] \
@@ -1650,11 +1694,11 @@ run_dump_test "pic-reloc-2"
run_dump_test "pic-reloc-3"
run_dump_test "pic-reloc-4"
run_dump_test_o32 "pic-reloc-5"
-run_dump_test_o32 "pic-reloc-5" [list [list name (microMIPS)] \
+run_dump_test_o32l "pic-reloc-5" [list [list name (microMIPS)] \
[list as "-mmicromips"]]
-run_dump_test_o32 "pic-reloc-6"
+run_dump_test_o32l "pic-reloc-6"
run_dump_test_n64 "pic-reloc-7"
-run_dump_test_n64 "pic-reloc-7" [list [list name (microMIPS)] \
+run_dump_test_n64l "pic-reloc-7" [list [list name (microMIPS)] \
[list as "-mmicromips"]]
run_dump_test_o32 "reloc-pcrel-r6"
diff --git a/ld/testsuite/ld-mips-elf/mips16-1.d b/ld/testsuite/ld-mips-elf/mips16-1.d
index 77d1316..f2d5caa 100644
--- a/ld/testsuite/ld-mips-elf/mips16-1.d
+++ b/ld/testsuite/ld-mips-elf/mips16-1.d
@@ -1,5 +1,5 @@
-#source: mips16-1a.s -no-mips16
-#source: mips16-1b.s -mips16
+#source: mips16-1a.s -no-mips16 -march=from-abi
+#source: mips16-1b.s -mips16 -march=from-abi
#ld: -r
#objdump: -pd
diff --git a/ld/testsuite/ld-mips-elf/mips16-and-micromips.d b/ld/testsuite/ld-mips-elf/mips16-and-micromips.d
index 6d740fe..4b89ae3 100644
--- a/ld/testsuite/ld-mips-elf/mips16-and-micromips.d
+++ b/ld/testsuite/ld-mips-elf/mips16-and-micromips.d
@@ -1,5 +1,5 @@
#name: MIPS16 and microMIPS interlink
-#source: ../../../gas/testsuite/gas/mips/nop.s -mips16
-#source: ../../../gas/testsuite/gas/mips/nop.s -mmicromips
+#source: ../../../gas/testsuite/gas/mips/nop.s -mips16 -march=from-abi
+#source: ../../../gas/testsuite/gas/mips/nop.s -mmicromips -march=from-abi
#ld: -e0
#error: \A.*: .*\.o: ASE mismatch: linking microMIPS module with previous MIPS16 modules[\n\r]+.*: failed to merge target specific data of file .*\.o\Z
diff --git a/ld/testsuite/ld-mips-elf/mode-change-error-1.d b/ld/testsuite/ld-mips-elf/mode-change-error-1.d
index afa54d8..90636c2 100644
--- a/ld/testsuite/ld-mips-elf/mode-change-error-1.d
+++ b/ld/testsuite/ld-mips-elf/mode-change-error-1.d
@@ -1,6 +1,6 @@
#name: Mode Change Error 1
-#source: mode-change-error-1a.s
-#source: mode-change-error-1b.s
+#source: mode-change-error-1a.s -march=from-abi
+#source: mode-change-error-1b.s -march=from-abi
#ld: -e 0x8000000
#error: \A[^\n]*: in function `main':\n
#error: \(\.text\+0x0\): unsupported jump between ISA modes; consider recompiling with interlinking enabled\n
diff --git a/ld/testsuite/ld-mips-elf/n64-plt-1.dd b/ld/testsuite/ld-mips-elf/n64-plt-1.dd
index 4c24a9a..51d654a 100644
--- a/ld/testsuite/ld-mips-elf/n64-plt-1.dd
+++ b/ld/testsuite/ld-mips-elf/n64-plt-1.dd
@@ -15,7 +15,7 @@ Disassembly of section \.plt:
00000000100002a0 <bar@plt>:
100002a0: 3c0f7fff lui t3,0x7fff
100002a4: ddf97ff8 ld t9,32760\(t3\)
- 100002a8: 03200008 jr t9
+ 100002a8: 0320000[89] jr t9
100002ac: 25f87ff8 addiu t8,t3,32760
Disassembly of section \.text:
diff --git a/ld/testsuite/ld-mips-elf/n64-plt-4.dd b/ld/testsuite/ld-mips-elf/n64-plt-4.dd
index 01c5025..71fee33 100644
--- a/ld/testsuite/ld-mips-elf/n64-plt-4.dd
+++ b/ld/testsuite/ld-mips-elf/n64-plt-4.dd
@@ -15,7 +15,7 @@ ffffffff1000029c: 2718fffe addiu t8,t8,-2
ffffffff100002a0 <bar@plt>:
ffffffff100002a0: 3c0f8000 lui t3,0x8000
ffffffff100002a4: ddf98010 ld t9,-32752\(t3\)
-ffffffff100002a8: 03200008 jr t9
+ffffffff100002a8: 0320000[89] jr t9
ffffffff100002ac: 25f88010 addiu t8,t3,-32752
Disassembly of section \.text:
diff --git a/ld/testsuite/ld-mips-elf/nan-legacy.d b/ld/testsuite/ld-mips-elf/nan-legacy.d
index 8dacc06..0d90432 100644
--- a/ld/testsuite/ld-mips-elf/nan-legacy.d
+++ b/ld/testsuite/ld-mips-elf/nan-legacy.d
@@ -1,5 +1,6 @@
#source: nan-legacy.s
#source: nan-legacy.s
+#as: -march=from-abi
#ld: -r
#objdump: -p
diff --git a/ld/testsuite/ld-mips-elf/nan-mixed-1.d b/ld/testsuite/ld-mips-elf/nan-mixed-1.d
index 9bc524c..c7e9570 100644
--- a/ld/testsuite/ld-mips-elf/nan-mixed-1.d
+++ b/ld/testsuite/ld-mips-elf/nan-mixed-1.d
@@ -1,5 +1,6 @@
#source: nan-legacy.s
#source: nan-2008.s
+#as: -march=from-abi
#ld: -r
#error: \A[^\n]*: [^\n]* linking -mnan=2008 module with previous -mnan=legacy modules\n
#error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
diff --git a/ld/testsuite/ld-mips-elf/nan-mixed-2.d b/ld/testsuite/ld-mips-elf/nan-mixed-2.d
index 388d770..a96cda0 100644
--- a/ld/testsuite/ld-mips-elf/nan-mixed-2.d
+++ b/ld/testsuite/ld-mips-elf/nan-mixed-2.d
@@ -1,5 +1,6 @@
#source: nan-2008.s
#source: nan-legacy.s
+#as: -march=from-abi
#ld: -r
#error: \A[^\n]*: [^\n]* linking -mnan=legacy module with previous -mnan=2008 modules\n
#error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
diff --git a/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d b/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d
index 3baf228..e3cc14e 100644
--- a/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d
+++ b/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d
@@ -17,6 +17,6 @@ Disassembly of section \.text:
4101c: 27391020 addiu t9,t9,4128
00041020 <foo2>:
- 41020: 03e00008 jr ra
+ 41020: 03e0000[89] jr ra
41024: 00000000 nop
\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/reloc-3.d b/ld/testsuite/ld-mips-elf/reloc-3.d
index 1ec51c5..0215016 100644
--- a/ld/testsuite/ld-mips-elf/reloc-3.d
+++ b/ld/testsuite/ld-mips-elf/reloc-3.d
@@ -1,5 +1,5 @@
#name: R_MIPS16_GPREL reloc
-#source: ../../../gas/testsuite/gas/mips/elf-rel6.s
+#source: ../../../gas/testsuite/gas/mips/elf-rel6.s -march=from-abi
#objdump: --prefix-addresses -tdr --show-raw-insn
#ld: -Ttext 0x20000000 -e 0x20000000 -N