aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@orcam.me.uk>2023-07-28 06:00:36 +0100
committerMaciej W. Rozycki <macro@orcam.me.uk>2023-07-28 06:01:21 +0100
commit7f251420206edd68394f59ce694c5084ce6dee11 (patch)
treec1373d4bee25d5964dbae09913b3ca92f2474b5a
parent09dc502a637c01e22e047ea67ea52ec8d4530018 (diff)
downloadgdb-7f251420206edd68394f59ce694c5084ce6dee11.zip
gdb-7f251420206edd68394f59ce694c5084ce6dee11.tar.gz
gdb-7f251420206edd68394f59ce694c5084ce6dee11.tar.bz2
MIPS/LD/testsuite: Fix unaligned JALX failures with OpenBSD targets
There are only n64 linker emulations included with `mips64*-*-openbsd*' targets, however the unaligned JALX tests insist on running across all targets and force the n32 ABI, causing link errors with the targets concerned, e.g.: ./ld-new: tmpdir/unaligned-jalx-0.o: ABI is incompatible with that of the selected emulation ./ld-new: failed to merge target specific data of file tmpdir/unaligned-jalx-0.o ./ld-new: tmpdir/unaligned-insn.o: ABI is incompatible with that of the selected emulation ./ld-new: failed to merge target specific data of file tmpdir/unaligned-insn.o Convert the tests then to use the per-ABI framework and run them for the o32 and n32 ABIs, removing these regressions: mips64-openbsd -FAIL: MIPS JALX to unaligned symbol 0 mips64-openbsd -FAIL: MIPS JALX to unaligned symbol 1 mips64-openbsd -FAIL: MIPS JALX to unaligned symbol 2 mips64-openbsd -FAIL: MIPS JALX to unaligned symbol 3 mips64-openbsd -FAIL: MIPS16 JALX to unaligned symbol 0 mips64-openbsd -FAIL: MIPS16 JALX to unaligned symbol 1 mips64-openbsd -FAIL: microMIPS JALX to unaligned symbol 0 mips64-openbsd -FAIL: microMIPS JALX to unaligned symbol 1 mips64el-openbsd -FAIL: MIPS JALX to unaligned symbol 0 mips64el-openbsd -FAIL: MIPS JALX to unaligned symbol 1 mips64el-openbsd -FAIL: MIPS JALX to unaligned symbol 2 mips64el-openbsd -FAIL: MIPS JALX to unaligned symbol 3 mips64el-openbsd -FAIL: MIPS16 JALX to unaligned symbol 0 mips64el-openbsd -FAIL: MIPS16 JALX to unaligned symbol 1 mips64el-openbsd -FAIL: microMIPS JALX to unaligned symbol 0 mips64el-openbsd -FAIL: microMIPS JALX to unaligned symbol 1 Similar tests for the n64 ABI can be added separately, using suitable dump patterns. ld/ * testsuite/ld-mips-elf/unaligned-jalx-0.d: Remove `-32' from the `as' tag. * testsuite/ld-mips-elf/unaligned-jalx-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-2.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-3.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-mips16-0.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-micromips-0.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d: Likewise. * testsuite/ld-mips-elf/mips-elf.exp: Run unaligned JALX tests with `run_dump_test_o32' and `run_dump_test_n32' rather than `run_dump_test'. (cherry picked from commit 67e789ae32fadc540c10839f08ad53ff01e2d732)
-rw-r--r--ld/testsuite/ld-mips-elf/mips-elf.exp24
-rw-r--r--ld/testsuite/ld-mips-elf/unaligned-jalx-0.d2
-rw-r--r--ld/testsuite/ld-mips-elf/unaligned-jalx-1.d2
-rw-r--r--ld/testsuite/ld-mips-elf/unaligned-jalx-2.d2
-rw-r--r--ld/testsuite/ld-mips-elf/unaligned-jalx-3.d2
-rw-r--r--ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-0.d2
-rw-r--r--ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d2
-rw-r--r--ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-0.d2
-rw-r--r--ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d2
9 files changed, 24 insertions, 16 deletions
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index 44f9dc9..903f7a0 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -412,14 +412,22 @@ 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_o32 "unaligned-jalx-0"
+run_dump_test_n32 "unaligned-jalx-0" [list [list name (n32)]]
+run_dump_test_o32 "unaligned-jalx-1"
+run_dump_test_n32 "unaligned-jalx-1" [list [list name (n32)]]
+run_dump_test_o32 "unaligned-jalx-2"
+run_dump_test_n32 "unaligned-jalx-2" [list [list name (n32)]]
+run_dump_test_o32 "unaligned-jalx-3"
+run_dump_test_n32 "unaligned-jalx-3" [list [list name (n32)]]
+run_dump_test_o32 "unaligned-jalx-mips16-0"
+run_dump_test_n32 "unaligned-jalx-mips16-0" [list [list name (n32)]]
+run_dump_test_o32 "unaligned-jalx-mips16-1"
+run_dump_test_n32 "unaligned-jalx-mips16-1" [list [list name (n32)]]
+run_dump_test_o32 "unaligned-jalx-micromips-0"
+run_dump_test_n32 "unaligned-jalx-micromips-0" [list [list name (n32)]]
+run_dump_test_o32 "unaligned-jalx-micromips-1"
+run_dump_test_n32 "unaligned-jalx-micromips-1" [list [list name (n32)]]
run_dump_test_n32 "unaligned-jalx-addend-0"
run_dump_test_n32 "unaligned-jalx-addend-1"
diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-0.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-0.d
index a37e5a9..ad08694 100644
--- a/ld/testsuite/ld-mips-elf/unaligned-jalx-0.d
+++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-0.d
@@ -1,7 +1,7 @@
#name: MIPS JALX to unaligned symbol 0
#source: unaligned-jalx-0.s
#source: unaligned-insn.s -mips16
-#as: -EB -32
+#as: -EB
#ld: -EB -Ttext 0x1c000000 -e 0x1c000000
#objdump: -dr --prefix-addresses --show-raw-insn
diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-1.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-1.d
index a6cc2ed..260124a 100644
--- a/ld/testsuite/ld-mips-elf/unaligned-jalx-1.d
+++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-1.d
@@ -1,7 +1,7 @@
#name: MIPS JALX to unaligned symbol 1
#source: unaligned-jalx-1.s
#source: unaligned-insn.s -mips16
-#as: -EB -32
+#as: -EB
#ld: -EB -Ttext 0x1c000000 -e 0x1c000000
#error: \A[^\n]*: in function `foo':\n
#error: \(\.text\+0x[0-9a-f]+\): cannot convert a jump to JALX for a non-word-aligned address\Z
diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-2.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-2.d
index 718c53d..f4552c3 100644
--- a/ld/testsuite/ld-mips-elf/unaligned-jalx-2.d
+++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-2.d
@@ -1,7 +1,7 @@
#name: MIPS JALX to unaligned symbol 2
#source: unaligned-jalx-2.s
#source: unaligned-insn.s -mips16
-#as: -EB -32
+#as: -EB
#ld: -EB -Ttext 0x1c000000 -e 0x1c000000
#objdump: -dr --prefix-addresses --show-raw-insn
#dump: unaligned-jalx-0.d
diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-3.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-3.d
index 36327f8..7cdcc8e 100644
--- a/ld/testsuite/ld-mips-elf/unaligned-jalx-3.d
+++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-3.d
@@ -1,7 +1,7 @@
#name: MIPS JALX to unaligned symbol 3
#source: unaligned-jalx-3.s
#source: unaligned-insn.s -mips16
-#as: -EB -32
+#as: -EB
#ld: -EB -Ttext 0x1c000000 -e 0x1c000000
#error: \A[^\n]*: in function `foo':\n
#error: \(\.text\+0x0\): cannot convert a branch to JALX for a non-word-aligned address\Z
diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-0.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-0.d
index 2622103..d76b53a 100644
--- a/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-0.d
+++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-0.d
@@ -1,7 +1,7 @@
#name: microMIPS JALX to unaligned symbol 0
#source: unaligned-jalx-0.s -mmicromips
#source: unaligned-insn.s
-#as: -EB -32
+#as: -EB
#ld: -EB -Ttext 0x1c000000 -e 0x1c000000
#objdump: -dr --prefix-addresses --show-raw-insn
diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d
index c38b2d5..f40a671 100644
--- a/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d
+++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d
@@ -1,7 +1,7 @@
#name: microMIPS JALX to unaligned symbol 1
#source: unaligned-jalx-1.s -mmicromips
#source: unaligned-insn.s
-#as: -EB -32
+#as: -EB
#ld: -EB -Ttext 0x1c000000 -e 0x1c000000
#error: \A[^\n]*: in function `foo':\n
#error: \(\.text\+0x[0-9a-f]+\): cannot convert a jump to JALX for a non-word-aligned address\Z
diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-0.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-0.d
index 176680d..c560fe4 100644
--- a/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-0.d
+++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-0.d
@@ -1,7 +1,7 @@
#name: MIPS16 JALX to unaligned symbol 0
#source: unaligned-jalx-0.s -mips16
#source: unaligned-insn.s
-#as: -EB -32
+#as: -EB
#ld: -EB -Ttext 0x1c000000 -e 0x1c000000
#objdump: -dr --prefix-addresses --show-raw-insn
diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d
index aacf089..b810f01 100644
--- a/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d
+++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d
@@ -1,7 +1,7 @@
#name: MIPS16 JALX to unaligned symbol 1
#source: unaligned-jalx-1.s -mips16
#source: unaligned-insn.s
-#as: -EB -32
+#as: -EB
#ld: -EB -Ttext 0x1c000000 -e 0x1c000000
#error: \A[^\n]*: in function `foo':\n
#error: \(\.text\+0x[0-9a-f]+\): cannot convert a jump to JALX for a non-word-aligned address\Z