From a5def729be2596496aec225e843903b25c672e01 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Wed, 10 Apr 2019 09:48:43 +0200 Subject: [PATCH] Disable R_X86_64_PLT32 generation as branch marker on Solaris/x86 The fix H.J. implemented for PR gas/22791 in the thread starting at [PATCH] x86-64: Treat PC32 relocation with branch as PLT32 https://sourceware.org/ml/binutils/2018-02/msg00065.html is causing problems on Solaris/x86. The native linker is strongly preferred there, and there's no intention of implementing the linker optimization he plans there. Besides, the kernel runtime linker, otherwise has no need to deal with that reloc at all, and instead of adding (possibly even more) workarounds with no benefit, it seems appropriate to disable the R_X86_64_PLT32 generation as branch marker on Solaris/x86 in the first place. The patch itself is trivial, the only complication is adapting the testsuite. Since I've found no way to have conditional sections in the .d files, I've instead used the solution already found elsewhere of having separate .d files for the affected tests in an i386/solaris subdirectory and skipping the original ones. Tested on amd64-pc-solaris2.11 and x86_64-pc-linux-gnu without regressions. * config/tc-i386.c (need_plt32_p) [TE_SOLARIS]: Return FALSE. * testsuite/gas/i386/solaris/solaris.exp: New driver. * testsuite/gas/i386/solaris/reloc64.d, testsuite/gas/i386/solaris/x86-64-jump.d, testsuite/gas/i386/solaris/x86-64-mpx-branch-1.d, testsuite/gas/i386/solaris/x86-64-mpx-branch-2.d, testsuite/gas/i386/solaris/x86-64-nop-3.d, testsuite/gas/i386/solaris/x86-64-nop-4.d, testsuite/gas/i386/solaris/x86-64-nop-5.d, testsuite/gas/i386/solaris/x86-64-relax-2.d, testsuite/gas/i386/solaris/x86-64-relax-3.d: New tests. * testsuite/gas/i386/reloc64.d, testsuite/gas/i386/x86-64-jump.d, testsuite/gas/i386/x86-64-mpx-branch-1.d, testsuite/gas/i386/x86-64-mpx-branch-2.d, testsuite/gas/i386/x86-64-nop-3.d, testsuite/gas/i386/x86-64-nop-4.d, testsuite/gas/i386/x86-64-nop-5.d, testsuite/gas/i386/x86-64-relax-2.d, testsuite/gas/i386/x86-64-relax-3.d: Skip on *-*-solaris*. --- gas/ChangeLog | 23 +++++ gas/config/tc-i386.c | 6 ++ gas/testsuite/gas/i386/reloc64.d | 1 + gas/testsuite/gas/i386/solaris/reloc64.d | 99 +++++++++++++++++++ gas/testsuite/gas/i386/solaris/solaris.exp | 48 +++++++++ gas/testsuite/gas/i386/solaris/x86-64-jump.d | 44 +++++++++ .../gas/i386/solaris/x86-64-mpx-branch-1.d | 29 ++++++ .../gas/i386/solaris/x86-64-mpx-branch-2.d | 29 ++++++ gas/testsuite/gas/i386/solaris/x86-64-nop-3.d | 21 ++++ gas/testsuite/gas/i386/solaris/x86-64-nop-4.d | 24 +++++ gas/testsuite/gas/i386/solaris/x86-64-nop-5.d | 27 +++++ .../gas/i386/solaris/x86-64-relax-2.d | 34 +++++++ .../gas/i386/solaris/x86-64-relax-3.d | 33 +++++++ gas/testsuite/gas/i386/x86-64-jump.d | 1 + gas/testsuite/gas/i386/x86-64-mpx-branch-1.d | 1 + gas/testsuite/gas/i386/x86-64-mpx-branch-2.d | 1 + gas/testsuite/gas/i386/x86-64-nop-3.d | 1 + gas/testsuite/gas/i386/x86-64-nop-4.d | 1 + gas/testsuite/gas/i386/x86-64-nop-5.d | 1 + gas/testsuite/gas/i386/x86-64-relax-2.d | 1 + gas/testsuite/gas/i386/x86-64-relax-3.d | 1 + 21 files changed, 426 insertions(+) create mode 100644 gas/testsuite/gas/i386/solaris/reloc64.d create mode 100644 gas/testsuite/gas/i386/solaris/solaris.exp create mode 100644 gas/testsuite/gas/i386/solaris/x86-64-jump.d create mode 100644 gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-1.d create mode 100644 gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-2.d create mode 100644 gas/testsuite/gas/i386/solaris/x86-64-nop-3.d create mode 100644 gas/testsuite/gas/i386/solaris/x86-64-nop-4.d create mode 100644 gas/testsuite/gas/i386/solaris/x86-64-nop-5.d create mode 100644 gas/testsuite/gas/i386/solaris/x86-64-relax-2.d create mode 100644 gas/testsuite/gas/i386/solaris/x86-64-relax-3.d diff --git a/gas/ChangeLog b/gas/ChangeLog index 4ca3bae8c86..75f4414c42c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,26 @@ +2019-04-10 Rainer Orth + + * config/tc-i386.c (need_plt32_p) [TE_SOLARIS]: Return FALSE. + * testsuite/gas/i386/solaris/solaris.exp: New driver. + * testsuite/gas/i386/solaris/reloc64.d, + testsuite/gas/i386/solaris/x86-64-jump.d, + testsuite/gas/i386/solaris/x86-64-mpx-branch-1.d, + testsuite/gas/i386/solaris/x86-64-mpx-branch-2.d, + testsuite/gas/i386/solaris/x86-64-nop-3.d, + testsuite/gas/i386/solaris/x86-64-nop-4.d, + testsuite/gas/i386/solaris/x86-64-nop-5.d, + testsuite/gas/i386/solaris/x86-64-relax-2.d, + testsuite/gas/i386/solaris/x86-64-relax-3.d: New tests. + * testsuite/gas/i386/reloc64.d, + testsuite/gas/i386/x86-64-jump.d, + testsuite/gas/i386/x86-64-mpx-branch-1.d, + testsuite/gas/i386/x86-64-mpx-branch-2.d, + testsuite/gas/i386/x86-64-nop-3.d, + testsuite/gas/i386/x86-64-nop-4.d, + testsuite/gas/i386/x86-64-nop-5.d, + testsuite/gas/i386/x86-64-relax-2.d, + testsuite/gas/i386/x86-64-relax-3.d: Skip on *-*-solaris*. + 2019-04-10 Alan Modra * config/te-cloudabi.h: New file. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 4816b54f93c..5eb6c4c2692 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -7787,6 +7787,12 @@ need_plt32_p (symbolS *s) if (!IS_ELF) return FALSE; +#ifdef TE_SOLARIS + /* Don't emit PLT32 relocation on Solaris: neither native linker nor + krtld support it. */ + return FALSE; +#endif + /* Since there is no need to prepare for PLT branch on x86-64, we can generate R_X86_64_PLT32, instead of R_X86_64_PC32, which can be used as a marker for 32-bit PC-relative branches. */ diff --git a/gas/testsuite/gas/i386/reloc64.d b/gas/testsuite/gas/i386/reloc64.d index 59e02b4800b..e9e03de86c4 100644 --- a/gas/testsuite/gas/i386/reloc64.d +++ b/gas/testsuite/gas/i386/reloc64.d @@ -1,6 +1,7 @@ #as: -mx86-used-note=no #objdump: -Drw #name: x86-64 relocs +#notarget: *-*-solaris* .*: +file format .*x86-64.* diff --git a/gas/testsuite/gas/i386/solaris/reloc64.d b/gas/testsuite/gas/i386/solaris/reloc64.d new file mode 100644 index 00000000000..5b4b91e424c --- /dev/null +++ b/gas/testsuite/gas/i386/solaris/reloc64.d @@ -0,0 +1,99 @@ +#as: -mx86-used-note=no +#source: ../reloc64.s +#objdump: -Drw +#name: x86-64 relocs + +.*: +file format .*x86-64.* + +Disassembly of section \.text: +#... +.*[ ]+R_X86_64_64[ ]+xtrn +.*[ ]+R_X86_64_32S[ ]+xtrn +.*[ ]+R_X86_64_32[ ]+xtrn +.*[ ]+R_X86_64_16[ ]+xtrn +.*[ ]+R_X86_64_8[ ]+xtrn +.*[ ]+R_X86_64_32S[ ]+xtrn +.*[ ]+R_X86_64_32[ ]+xtrn +.*[ ]+R_X86_64_PC64[ ]+xtrn\+0x0*2 +.*[ ]+R_X86_64_PC32[ ]+xtrn\+0x0*2 +.*[ ]+R_X86_64_PC16[ ]+xtrn\+0x0*2 +.*[ ]+R_X86_64_PC8[ ]+xtrn\+0x0*1 +.*[ ]+R_X86_64_PC32[ ]+xtrn-0x0*4 +.*[ ]+R_X86_64_PC32[ ]+xtrn-0x0*4 +.*[ ]+R_X86_64_PC32[ ]+xtrn-0x0*4 +.*[ ]+R_X86_64_PC8[ ]+xtrn-0x0*1 +.*[ ]+R_X86_64_GOT64[ ]+xtrn +.*[ ]+R_X86_64_GOT32[ ]+xtrn +.*[ ]+R_X86_64_GOT32[ ]+xtrn +.*[ ]+R_X86_64_GOTOFF64[ ]+xtrn +.*[ ]+R_X86_64_GOTPCREL[ ]+xtrn +.*[ ]+R_X86_64_GOTPCREL[ ]+xtrn +.*[ ]+R_X86_64_GOTPCREL[ ]+xtrn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GOT32[ ]+xtrn-0x4 +.*[ ]+R_X86_64_GOT32[ ]+xtrn\+0x4 +.*[ ]+R_X86_64_GOTPLT64[ ]+xtrn diff --git a/gas/testsuite/gas/i386/solaris/solaris.exp b/gas/testsuite/gas/i386/solaris/solaris.exp new file mode 100644 index 00000000000..e124ea869eb --- /dev/null +++ b/gas/testsuite/gas/i386/solaris/solaris.exp @@ -0,0 +1,48 @@ +# Copyright (C) 2019 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +# +# Solaris i386 tests +# +proc gas_64_check { } { + global NM + global NMFLAGS + + set status [gas_host_run "$NM $NMFLAGS --help" ""] + return [regexp "targets:.*x86-64" [lindex $status 1]]; +} + +if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check] && [istarget "*-*-solaris*"]] then { + + global ASFLAGS + set old_ASFLAGS "$ASFLAGS" + set ASFLAGS "$ASFLAGS --64 --defsym x86_64=1 --strip-local-absolute" + + run_dump_test "reloc64" + run_dump_test "x86-64-mpx-branch-1" + run_dump_test "x86-64-mpx-branch-2" + + run_dump_test "x86-64-relax-2" + run_dump_test "x86-64-relax-3" + + run_dump_test "x86-64-jump" + + run_dump_test "x86-64-nop-3" + run_dump_test "x86-64-nop-4" + run_dump_test "x86-64-nop-5" + + set ASFLAGS "$old_ASFLAGS" +} diff --git a/gas/testsuite/gas/i386/solaris/x86-64-jump.d b/gas/testsuite/gas/i386/solaris/x86-64-jump.d new file mode 100644 index 00000000000..861f1b47a08 --- /dev/null +++ b/gas/testsuite/gas/i386/solaris/x86-64-jump.d @@ -0,0 +1,44 @@ +#objdump: -drw +#source: ../x86-64-jump.s +#name: x86-64 jump + +.*: +file format .* + + +Disassembly of section .text: + +0+ <.text>: +[ ]*[a-f0-9]+: eb fe jmp (0x0|0 <.text>) +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 0x7 3: R_X86_64_PC32 xxx-0x4 +[ ]*[a-f0-9]+: ff 24 25 00 00 00 00 jmpq \*0x0 a: R_X86_64_32S xxx +[ ]*[a-f0-9]+: ff e7 jmpq \*%rdi +[ ]*[a-f0-9]+: ff 27 jmpq \*\(%rdi\) +[ ]*[a-f0-9]+: ff 2c bd 00 00 00 00 ljmp \*0x0\(,%rdi,4\) 15: R_X86_64_32S xxx +[ ]*[a-f0-9]+: 66 ff 2c bd 00 00 00 00 ljmpw \*0x0\(,%rdi,4\) 1d: R_X86_64_32S xxx +[ ]*[a-f0-9]+: ff 2c 25 00 00 00 00 ljmp \*0x0 24: R_X86_64_32S xxx +[ ]*[a-f0-9]+: 66 ff 2c 25 00 00 00 00 ljmpw \*0x0 2c: R_X86_64_32S xxx +[ ]*[a-f0-9]+: e8 cb ff ff ff callq 0x0 +[ ]*[a-f0-9]+: e8 00 00 00 00 callq 0x3a 36: R_X86_64_PC32 xxx-0x4 +[ ]*[a-f0-9]+: ff 14 25 00 00 00 00 callq \*0x0 3d: R_X86_64_32S xxx +[ ]*[a-f0-9]+: ff d7 callq \*%rdi +[ ]*[a-f0-9]+: ff 17 callq \*\(%rdi\) +[ ]*[a-f0-9]+: ff 1c bd 00 00 00 00 lcall \*0x0\(,%rdi,4\) 48: R_X86_64_32S xxx +[ ]*[a-f0-9]+: 66 ff 1c bd 00 00 00 00 lcallw \*0x0\(,%rdi,4\) 50: R_X86_64_32S xxx +[ ]*[a-f0-9]+: ff 1c 25 00 00 00 00 lcall \*0x0 57: R_X86_64_32S xxx +[ ]*[a-f0-9]+: 66 ff 1c 25 00 00 00 00 lcallw \*0x0 5f: R_X86_64_32S xxx +[ ]*[a-f0-9]+: 67 e3 00 jecxz 0x66 65: R_X86_64_PC8 \$\+0x2 +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: e3 00 jrcxz 0x69 68: R_X86_64_PC8 \$\+0x1 +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 66 ff 13 callw \*\(%rbx\) +[ ]*[a-f0-9]+: ff 1b lcall \*\(%rbx\) +[ ]*[a-f0-9]+: 66 ff 23 jmpw \*\(%rbx\) +[ ]*[a-f0-9]+: ff 2b ljmp \*\(%rbx\) +[ ]*[a-f0-9]+: eb 00 jmp 0x76 +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 67 e3 00 jecxz 0x7a +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: e3 00 jrcxz 0x7d +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: eb 00 jmp 0x80 +#pass diff --git a/gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-1.d b/gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-1.d new file mode 100644 index 00000000000..0c30add118b --- /dev/null +++ b/gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-1.d @@ -0,0 +1,29 @@ +#as: -J +#source: ../x86-64-mpx-branch-1.s +#objdump: -dwr +#name: x86-64 MPX branch + +.*: +file format .* + + +Disassembly of section .text: + +0+ : +[ ]*[a-f0-9]+: f2 e8 00 00 00 00 bnd callq 6 2: R_X86_64_PC32 \*ABS\*\+0x10003c +[ ]*[a-f0-9]+: f2 e9 00 00 00 00 bnd jmpq c 8: R_X86_64_PC32 \*ABS\*\+0x10003c + +0+c : +[ ]*[a-f0-9]+: f2 eb fd bnd jmp c +[ ]*[a-f0-9]+: f2 72 fa bnd jb c +[ ]*[a-f0-9]+: f2 e8 f4 ff ff ff bnd callq c +[ ]*[a-f0-9]+: f2 eb 09 bnd jmp 24 +[ ]*[a-f0-9]+: f2 72 06 bnd jb 24 +[ ]*[a-f0-9]+: f2 e8 00 00 00 00 bnd callq 24 + +0+24 : +[ ]*[a-f0-9]+: f2 e9 00 00 00 00 bnd jmpq 2a 26: R_X86_64_PC32 foo-0x4 +[ ]*[a-f0-9]+: f2 0f 82 00 00 00 00 bnd jb 31 2d: R_X86_64_PC32 foo-0x4 +[ ]*[a-f0-9]+: f2 e8 00 00 00 00 bnd callq 37 33: R_X86_64_PC32 foo-0x4 +[ ]*[a-f0-9]+: f2 e9 00 00 00 00 bnd jmpq 3d 39: R_X86_64_PLT32 foo-0x4 +[ ]*[a-f0-9]+: f2 0f 82 00 00 00 00 bnd jb 44 40: R_X86_64_PLT32 foo-0x4 +[ ]*[a-f0-9]+: f2 e8 00 00 00 00 bnd callq 4a 46: R_X86_64_PLT32 foo-0x4 diff --git a/gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-2.d b/gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-2.d new file mode 100644 index 00000000000..db47ec6f6ae --- /dev/null +++ b/gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-2.d @@ -0,0 +1,29 @@ +#as: -J -madd-bnd-prefix +#source: ../x86-64-mpx-branch-2.s +#objdump: -dwr +#name: x86-64 branch with BND prefix + +.*: +file format .* + + +Disassembly of section .text: + +0+ : +[ ]*[a-f0-9]+: f2 e8 00 00 00 00 bnd callq 6 2: R_X86_64_PC32 \*ABS\*\+0x10003c +[ ]*[a-f0-9]+: f2 e9 00 00 00 00 bnd jmpq c 8: R_X86_64_PC32 \*ABS\*\+0x10003c + +0+c : +[ ]*[a-f0-9]+: f2 eb fd bnd jmp c +[ ]*[a-f0-9]+: f2 72 fa bnd jb c +[ ]*[a-f0-9]+: f2 e8 f4 ff ff ff bnd callq c +[ ]*[a-f0-9]+: f2 eb 09 bnd jmp 24 +[ ]*[a-f0-9]+: f2 72 06 bnd jb 24 +[ ]*[a-f0-9]+: f2 e8 00 00 00 00 bnd callq 24 + +0+24 : +[ ]*[a-f0-9]+: f2 e9 00 00 00 00 bnd jmpq 2a 26: R_X86_64_PC32 foo-0x4 +[ ]*[a-f0-9]+: f2 0f 82 00 00 00 00 bnd jb 31 2d: R_X86_64_PC32 foo-0x4 +[ ]*[a-f0-9]+: f2 e8 00 00 00 00 bnd callq 37 33: R_X86_64_PC32 foo-0x4 +[ ]*[a-f0-9]+: f2 e9 00 00 00 00 bnd jmpq 3d 39: R_X86_64_PLT32 foo-0x4 +[ ]*[a-f0-9]+: f2 0f 82 00 00 00 00 bnd jb 44 40: R_X86_64_PLT32 foo-0x4 +[ ]*[a-f0-9]+: f2 e8 00 00 00 00 bnd callq 4a 46: R_X86_64_PLT32 foo-0x4 diff --git a/gas/testsuite/gas/i386/solaris/x86-64-nop-3.d b/gas/testsuite/gas/i386/solaris/x86-64-nop-3.d new file mode 100644 index 00000000000..d16ad0a89a0 --- /dev/null +++ b/gas/testsuite/gas/i386/solaris/x86-64-nop-3.d @@ -0,0 +1,21 @@ +#source: ../nop-3.s +#objdump: -drw +#name: x86-64 .nops 3 + +.*: +file format .* + + +Disassembly of section .text: + +0+ <_start>: + +[a-f0-9]+: 31 c0 xor %eax,%eax + +[a-f0-9]+: 85 c0 test %eax,%eax + +[a-f0-9]+: 0f 1f 00 nopl \(%rax\) + +[a-f0-9]+: 31 c0 xor %eax,%eax + +[a-f0-9]+: 31 c0 xor %eax,%eax + +Disassembly of section .altinstr_replacement: + +0+ <.altinstr_replacement>: + +[a-f0-9]+: e9 00 00 00 00 jmpq 5 <_start\+0x5> 1: R_X86_64_PC32 foo-0x4 +#pass diff --git a/gas/testsuite/gas/i386/solaris/x86-64-nop-4.d b/gas/testsuite/gas/i386/solaris/x86-64-nop-4.d new file mode 100644 index 00000000000..14dae11e2ea --- /dev/null +++ b/gas/testsuite/gas/i386/solaris/x86-64-nop-4.d @@ -0,0 +1,24 @@ +#source: ../nop-4.s +#objdump: -drw +#name: x86-64 .nops 4 + +.*: +file format .* + + +Disassembly of section .text: + +0+ <_start>: + +[a-f0-9]+: 31 c0 xor %eax,%eax + +[a-f0-9]+: 85 c0 test %eax,%eax + +[a-f0-9]+: 66 0f 1f 84 00 00 00 00 00 nopw 0x0\(%rax,%rax,1\) + +[a-f0-9]+: 31 c0 xor %eax,%eax + +[a-f0-9]+: 31 c0 xor %eax,%eax + +Disassembly of section .altinstr_replacement: + +0+ <.altinstr_replacement>: + +[a-f0-9]+: 89 c0 mov %eax,%eax + +[a-f0-9]+: 89 c0 mov %eax,%eax + +[a-f0-9]+: 89 c0 mov %eax,%eax + +[a-f0-9]+: e9 00 00 00 00 jmpq b <_start\+0xb> 7: R_X86_64_PC32 foo-0x4 +#pass diff --git a/gas/testsuite/gas/i386/solaris/x86-64-nop-5.d b/gas/testsuite/gas/i386/solaris/x86-64-nop-5.d new file mode 100644 index 00000000000..93c85caaba2 --- /dev/null +++ b/gas/testsuite/gas/i386/solaris/x86-64-nop-5.d @@ -0,0 +1,27 @@ +#source: ../nop-5.s +#objdump: -drw +#name: x86-64 .nops 5 + +.*: +file format .* + + +Disassembly of section .text: + +0+ <_start>: + +[a-f0-9]+: 31 c0 xor %eax,%eax + +[a-f0-9]+: 85 c0 test %eax,%eax + +[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) + +[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) + +[a-f0-9]+: 90 nop + +[a-f0-9]+: 31 c0 xor %eax,%eax + +[a-f0-9]+: 31 c0 xor %eax,%eax + +Disassembly of section .altinstr_replacement: + +0+ <.altinstr_replacement>: + +[a-f0-9]+: 89 c0 mov %eax,%eax + +[a-f0-9]+: 89 c0 mov %eax,%eax + +[a-f0-9]+: 89 c0 mov %eax,%eax + +[a-f0-9]+: 89 c0 mov %eax,%eax + +[a-f0-9]+: e9 00 00 00 00 jmpq d <_start\+0xd> 9: R_X86_64_PC32 foo-0x4 +#pass diff --git a/gas/testsuite/gas/i386/solaris/x86-64-relax-2.d b/gas/testsuite/gas/i386/solaris/x86-64-relax-2.d new file mode 100644 index 00000000000..d7197904ab8 --- /dev/null +++ b/gas/testsuite/gas/i386/solaris/x86-64-relax-2.d @@ -0,0 +1,34 @@ +#source: ../relax-3.s +#as: -mshared +#objdump: -dwr + +.*: +file format .* + + +Disassembly of section .text: + +0+ : +[ ]*[a-f0-9]+: eb 24 jmp 26 +[ ]*[a-f0-9]+: eb 1e jmp 22 +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 9 5: R_X86_64_PC32 global_def-0x4 +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq e a: R_X86_64_PLT32 global_def-0x4 +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 13 f: R_X86_64_PC32 weak_def-0x4 +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 18 14: R_X86_64_PC32 weak_hidden_undef-0x4 +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 1d 19: R_X86_64_PC32 weak_hidden_def-0x4 +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 22 1e: R_X86_64_PC32 hidden_undef-0x4 + +0+22 : +[ ]*[a-f0-9]+: c3 retq + +0+23 : +[ ]*[a-f0-9]+: c3 retq + +0+24 : +[ ]*[a-f0-9]+: c3 retq + +0+25 : +[ ]*[a-f0-9]+: c3 retq + +0+26 : +[ ]*[a-f0-9]+: c3 retq +#pass diff --git a/gas/testsuite/gas/i386/solaris/x86-64-relax-3.d b/gas/testsuite/gas/i386/solaris/x86-64-relax-3.d new file mode 100644 index 00000000000..86a6a6566ee --- /dev/null +++ b/gas/testsuite/gas/i386/solaris/x86-64-relax-3.d @@ -0,0 +1,33 @@ +#source: ../relax-3.s +#objdump: -dwr + +.*: +file format .* + + +Disassembly of section .text: + +0+ : +[ ]*[a-f0-9]+: eb 21 jmp 23 +[ ]*[a-f0-9]+: eb 1b jmp 1f +[ ]*[a-f0-9]+: eb 1b jmp 21 +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq b 7: R_X86_64_PLT32 global_def-0x4 +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 10 c: R_X86_64_PC32 weak_def-0x4 +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 15 11: R_X86_64_PC32 weak_hidden_undef-0x4 +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 1a 16: R_X86_64_PC32 weak_hidden_def-0x4 +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 1f 1b: R_X86_64_PC32 hidden_undef-0x4 + +0+1f : +[ ]*[a-f0-9]+: c3 retq + +0+20 : +[ ]*[a-f0-9]+: c3 retq + +0+21 : +[ ]*[a-f0-9]+: c3 retq + +0+22 : +[ ]*[a-f0-9]+: c3 retq + +0+23 : +[ ]*[a-f0-9]+: c3 retq +#pass diff --git a/gas/testsuite/gas/i386/x86-64-jump.d b/gas/testsuite/gas/i386/x86-64-jump.d index 9f7b4b48481..c771e5e0110 100644 --- a/gas/testsuite/gas/i386/x86-64-jump.d +++ b/gas/testsuite/gas/i386/x86-64-jump.d @@ -1,5 +1,6 @@ #objdump: -drw #name: x86-64 jump +#notarget: *-*-solaris* .*: +file format .* diff --git a/gas/testsuite/gas/i386/x86-64-mpx-branch-1.d b/gas/testsuite/gas/i386/x86-64-mpx-branch-1.d index d44841e7459..7ee6c6b82fe 100644 --- a/gas/testsuite/gas/i386/x86-64-mpx-branch-1.d +++ b/gas/testsuite/gas/i386/x86-64-mpx-branch-1.d @@ -1,6 +1,7 @@ #as: -J #objdump: -dwr #name: x86-64 MPX branch +#notarget: *-*-solaris* .*: +file format .* diff --git a/gas/testsuite/gas/i386/x86-64-mpx-branch-2.d b/gas/testsuite/gas/i386/x86-64-mpx-branch-2.d index 514c34363e6..96e000936f1 100644 --- a/gas/testsuite/gas/i386/x86-64-mpx-branch-2.d +++ b/gas/testsuite/gas/i386/x86-64-mpx-branch-2.d @@ -1,6 +1,7 @@ #as: -J -madd-bnd-prefix #objdump: -dwr #name: x86-64 branch with BND prefix +#notarget: *-*-solaris* .*: +file format .* diff --git a/gas/testsuite/gas/i386/x86-64-nop-3.d b/gas/testsuite/gas/i386/x86-64-nop-3.d index 1dc9505b4f8..8514c4d0773 100644 --- a/gas/testsuite/gas/i386/x86-64-nop-3.d +++ b/gas/testsuite/gas/i386/x86-64-nop-3.d @@ -1,6 +1,7 @@ #source: nop-3.s #objdump: -drw #name: x86-64 .nops 3 +#notarget: *-*-solaris* .*: +file format .* diff --git a/gas/testsuite/gas/i386/x86-64-nop-4.d b/gas/testsuite/gas/i386/x86-64-nop-4.d index 25927ca2228..7b696624cf4 100644 --- a/gas/testsuite/gas/i386/x86-64-nop-4.d +++ b/gas/testsuite/gas/i386/x86-64-nop-4.d @@ -1,6 +1,7 @@ #source: nop-4.s #objdump: -drw #name: x86-64 .nops 4 +#notarget: *-*-solaris* .*: +file format .* diff --git a/gas/testsuite/gas/i386/x86-64-nop-5.d b/gas/testsuite/gas/i386/x86-64-nop-5.d index 6036be30d37..b0b7854f8a8 100644 --- a/gas/testsuite/gas/i386/x86-64-nop-5.d +++ b/gas/testsuite/gas/i386/x86-64-nop-5.d @@ -1,6 +1,7 @@ #source: nop-5.s #objdump: -drw #name: x86-64 .nops 5 +#notarget: *-*-solaris* .*: +file format .* diff --git a/gas/testsuite/gas/i386/x86-64-relax-2.d b/gas/testsuite/gas/i386/x86-64-relax-2.d index c9eba8452aa..8f432dff526 100644 --- a/gas/testsuite/gas/i386/x86-64-relax-2.d +++ b/gas/testsuite/gas/i386/x86-64-relax-2.d @@ -1,6 +1,7 @@ #source: relax-3.s #as: -mshared #objdump: -dwr +#notarget: *-*-solaris* .*: +file format .* diff --git a/gas/testsuite/gas/i386/x86-64-relax-3.d b/gas/testsuite/gas/i386/x86-64-relax-3.d index 28ab5dd3f7f..bb605081452 100644 --- a/gas/testsuite/gas/i386/x86-64-relax-3.d +++ b/gas/testsuite/gas/i386/x86-64-relax-3.d @@ -1,5 +1,6 @@ #source: relax-3.s #objdump: -dwr +#notarget: *-*-solaris* .*: +file format .* -- 2.30.2