public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@orcam.me.uk>
To: Nick Clifton <nickc@redhat.com>
Cc: YunQiang Su <yunqiang.su@cipunited.com>, binutils@sourceware.org
Subject: [committed 04/16] MIPS/LD/testsuite: Fix unaligned JALX failures with OpenBSD targets
Date: Fri, 28 Jul 2023 06:06:47 +0100 (BST)	[thread overview]
Message-ID: <alpine.DEB.2.21.2307271608100.10240@angie.orcam.me.uk> (raw)
In-Reply-To: <alpine.DEB.2.21.2307271457290.10240@angie.orcam.me.uk>

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'.
---
 ld/testsuite/ld-mips-elf/mips-elf.exp                 |   24 ++++++++++++------
 ld/testsuite/ld-mips-elf/unaligned-jalx-0.d           |    2 -
 ld/testsuite/ld-mips-elf/unaligned-jalx-1.d           |    2 -
 ld/testsuite/ld-mips-elf/unaligned-jalx-2.d           |    2 -
 ld/testsuite/ld-mips-elf/unaligned-jalx-3.d           |    2 -
 ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-0.d |    2 -
 ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d |    2 -
 ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-0.d    |    2 -
 ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d    |    2 -
 9 files changed, 24 insertions(+), 16 deletions(-)

binutils-mips-ld-test-jalx.diff
Index: binutils-gdb/ld/testsuite/ld-mips-elf/mips-elf.exp
===================================================================
--- binutils-gdb.orig/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ binutils-gdb/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -412,14 +412,22 @@ run_dump_test_n64 "bal-jalx-pic-micromip
 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"
Index: binutils-gdb/ld/testsuite/ld-mips-elf/unaligned-jalx-0.d
===================================================================
--- binutils-gdb.orig/ld/testsuite/ld-mips-elf/unaligned-jalx-0.d
+++ binutils-gdb/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
 
Index: binutils-gdb/ld/testsuite/ld-mips-elf/unaligned-jalx-1.d
===================================================================
--- binutils-gdb.orig/ld/testsuite/ld-mips-elf/unaligned-jalx-1.d
+++ binutils-gdb/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
Index: binutils-gdb/ld/testsuite/ld-mips-elf/unaligned-jalx-2.d
===================================================================
--- binutils-gdb.orig/ld/testsuite/ld-mips-elf/unaligned-jalx-2.d
+++ binutils-gdb/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
Index: binutils-gdb/ld/testsuite/ld-mips-elf/unaligned-jalx-3.d
===================================================================
--- binutils-gdb.orig/ld/testsuite/ld-mips-elf/unaligned-jalx-3.d
+++ binutils-gdb/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
Index: binutils-gdb/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-0.d
===================================================================
--- binutils-gdb.orig/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-0.d
+++ binutils-gdb/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
 
Index: binutils-gdb/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d
===================================================================
--- binutils-gdb.orig/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d
+++ binutils-gdb/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
Index: binutils-gdb/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-0.d
===================================================================
--- binutils-gdb.orig/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-0.d
+++ binutils-gdb/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
 
Index: binutils-gdb/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d
===================================================================
--- binutils-gdb.orig/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d
+++ binutils-gdb/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

  parent reply	other threads:[~2023-07-28  5:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28  5:06 [committed 00/16] MIPS: Revert the change of `mipsisa64*-*-linux*' semantics Maciej W. Rozycki
2023-07-28  5:06 ` [committed 01/16] Revert "MIPS: support mips*64 as CPU and gnuabi64 as ABI" Maciej W. Rozycki
2023-07-28  5:06 ` [committed 02/16] MIPS/LD: Include n64 `.interp' with INITIAL_READONLY_SECTIONS Maciej W. Rozycki
2023-07-28  5:06 ` [committed 03/16] MIPS/GAS/testsuite: Disable compact EH #7 tests with OpenBSD targets Maciej W. Rozycki
2023-07-28  5:06 ` Maciej W. Rozycki [this message]
2023-07-28  5:06 ` [committed 05/16] MIPS/LD/testsuite: Fix JALR relaxation test failure with IRIX 6 Maciej W. Rozycki
2023-07-28  5:06 ` [committed 06/16] MIPS/LD/testsuite: Fix `attr-gnu-4-10' failures with IRIX targets Maciej W. Rozycki
2023-07-28  5:07 ` [committed 07/16] MIPS/LD/testsuite: Fix `attr-gnu-4-10' failures with OpenBSD targets Maciej W. Rozycki
2023-07-28  5:07 ` [committed 08/16] MIPS/LD/testsuite: Run `got-dump-1' for o32/n32 ABIs Maciej W. Rozycki
2023-07-28  5:07 ` [committed 09/16] MIPS/GAS/testsuite: Force o32 for tests expecting 32-bit addressing Maciej W. Rozycki
2023-07-28  5:07 ` [committed 10/16] MIPS/LD/testsuite: Fix MIPS16 interlinking test n64 regressions Maciej W. Rozycki
2023-07-28  5:07 ` [committed 11/16] MIPS/LD/testsuite: Fix MIPS16 interlinking test IRIX 6 regressions Maciej W. Rozycki
2023-07-28  5:07 ` [committed 12/16] testsuite: Also discard the `.MIPS.options' section Maciej W. Rozycki
2023-07-28  5:07 ` [committed 13/16] MIPS/testsuite: Handle 64-bit addresses Maciej W. Rozycki
2023-07-28  5:07 ` [committed 14/16] testsuite: Handle composed R_MIPS_NONE relocations Maciej W. Rozycki
2023-07-28  5:07 ` [committed 15/16] MIPS/GAS/testsuite: Fix n64 compact EH failures Maciej W. Rozycki
2023-07-28  5:07 ` [committed 16/16] MIPS: Support `-gnuabi64' target triplet suffix for 64-bit Linux targets Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.2307271608100.10240@angie.orcam.me.uk \
    --to=macro@orcam.me.uk \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=yunqiang.su@cipunited.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).