Disable R_X86_64_PLT32 generation as branch marker on Solaris/x86
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 10 Apr 2019 07:48:43 +0000 (09:48 +0200)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 10 Apr 2019 07:48:43 +0000 (09:48 +0200)
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*.

21 files changed:
gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/gas/i386/reloc64.d
gas/testsuite/gas/i386/solaris/reloc64.d [new file with mode: 0644]
gas/testsuite/gas/i386/solaris/solaris.exp [new file with mode: 0644]
gas/testsuite/gas/i386/solaris/x86-64-jump.d [new file with mode: 0644]
gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-1.d [new file with mode: 0644]
gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-2.d [new file with mode: 0644]
gas/testsuite/gas/i386/solaris/x86-64-nop-3.d [new file with mode: 0644]
gas/testsuite/gas/i386/solaris/x86-64-nop-4.d [new file with mode: 0644]
gas/testsuite/gas/i386/solaris/x86-64-nop-5.d [new file with mode: 0644]
gas/testsuite/gas/i386/solaris/x86-64-relax-2.d [new file with mode: 0644]
gas/testsuite/gas/i386/solaris/x86-64-relax-3.d [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-jump.d
gas/testsuite/gas/i386/x86-64-mpx-branch-1.d
gas/testsuite/gas/i386/x86-64-mpx-branch-2.d
gas/testsuite/gas/i386/x86-64-nop-3.d
gas/testsuite/gas/i386/x86-64-nop-4.d
gas/testsuite/gas/i386/x86-64-nop-5.d
gas/testsuite/gas/i386/x86-64-relax-2.d
gas/testsuite/gas/i386/x86-64-relax-3.d

index 4ca3bae8c86df8424891a13122f1d2bb3a85b196..75f4414c42c5b9a2ae57b03735d5e0b374ec20da 100644 (file)
@@ -1,3 +1,26 @@
+2019-04-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * 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  <amodra@gmail.com>
 
        * config/te-cloudabi.h: New file.
index 4816b54f93c7eb8d509f16bc22ca0d4c9c46529f..5eb6c4c2692d4aafdd495db3294ef065fecf43a5 100644 (file)
@@ -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.  */
index 59e02b4800b264a2e534ea988adb21659819d85f..e9e03de86c4d8cc9b264304c3c336c9ebd8f98b0 100644 (file)
@@ -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 (file)
index 0000000..5b4b91e
--- /dev/null
@@ -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-0x0*4
+.*[    ]+R_X86_64_GOTPC32[     ]+_GLOBAL_OFFSET_TABLE_\+0x0*2
+.*[    ]+R_X86_64_GOTPC32[     ]+_GLOBAL_OFFSET_TABLE_-0x0*4
+.*[    ]+R_X86_64_GOTPC32[     ]+_GLOBAL_OFFSET_TABLE_-0x0*4
+.*[    ]+R_X86_64_GOTPC32[     ]+_GLOBAL_OFFSET_TABLE_\+0x0*2
+.*[    ]+R_X86_64_PLT32[       ]+xtrn
+.*[    ]+R_X86_64_PLT32[       ]+xtrn
+.*[    ]+R_X86_64_PLT32[       ]+xtrn-0x0*4
+.*[    ]+R_X86_64_TLSGD[       ]+xtrn
+.*[    ]+R_X86_64_TLSGD[       ]+xtrn
+.*[    ]+R_X86_64_TLSGD[       ]+xtrn-0x0*4
+.*[    ]+R_X86_64_GOTTPOFF[    ]+xtrn
+.*[    ]+R_X86_64_GOTTPOFF[    ]+xtrn
+.*[    ]+R_X86_64_GOTTPOFF[    ]+xtrn-0x0*4
+.*[    ]+R_X86_64_TLSLD[       ]+xtrn
+.*[    ]+R_X86_64_TLSLD[       ]+xtrn
+.*[    ]+R_X86_64_TLSLD[       ]+xtrn-0x0*4
+.*[    ]+R_X86_64_DTPOFF64[    ]+xtrn
+.*[    ]+R_X86_64_DTPOFF32[    ]+xtrn
+.*[    ]+R_X86_64_DTPOFF32[    ]+xtrn
+.*[    ]+R_X86_64_TPOFF64[     ]+xtrn
+.*[    ]+R_X86_64_TPOFF32[     ]+xtrn
+.*[    ]+R_X86_64_TPOFF32[     ]+xtrn
+.*[    ]+R_X86_64_TPOFF32[     ]+xtrn
+.*[    ]+R_X86_64_GOTPLT64[    ]+xtrn
+.*[    ]+R_X86_64_32S[         ]+xtrn
+.*[    ]+R_X86_64_32[  ]+xtrn
+.*[    ]+R_X86_64_32S[         ]+xtrn
+.*[    ]+R_X86_64_32[  ]+xtrn
+Disassembly of section \.data:
+#...
+.*[    ]+R_X86_64_64[  ]+xtrn
+.*[    ]+R_X86_64_PC64[        ]+xtrn
+.*[    ]+R_X86_64_GOT64[       ]+xtrn
+.*[    ]+R_X86_64_GOTOFF64[    ]+xtrn
+.*[    ]+R_X86_64_GOTPCREL64[  ]+xtrn
+.*[    ]+R_X86_64_DTPOFF64[    ]+xtrn
+.*[    ]+R_X86_64_TPOFF64[     ]+xtrn
+.*[    ]+R_X86_64_32[  ]+xtrn
+.*[    ]+R_X86_64_PC32[        ]+xtrn
+.*[    ]+R_X86_64_GOT32[       ]+xtrn
+.*[    ]+R_X86_64_GOTPCREL[    ]+xtrn
+.*[    ]+R_X86_64_GOTPC32[     ]+_GLOBAL_OFFSET_TABLE_
+.*[    ]+R_X86_64_GOTPC32[     ]+_GLOBAL_OFFSET_TABLE_
+.*[    ]+R_X86_64_PLT32[       ]+xtrn
+.*[    ]+R_X86_64_TLSGD[       ]+xtrn
+.*[    ]+R_X86_64_GOTTPOFF[    ]+xtrn
+.*[    ]+R_X86_64_TLSLD[       ]+xtrn
+.*[    ]+R_X86_64_DTPOFF32[    ]+xtrn
+.*[    ]+R_X86_64_TPOFF32[     ]+xtrn
+.*[    ]+R_X86_64_32S[         ]+xtrn
+.*[    ]+R_X86_64_PC32[        ]+xtrn
+.*[    ]+R_X86_64_GOT32[       ]+xtrn
+.*[    ]+R_X86_64_GOTPCREL[    ]+xtrn
+.*[    ]+R_X86_64_GOTPC32[     ]+_GLOBAL_OFFSET_TABLE_
+.*[    ]+R_X86_64_GOTPC32[     ]+_GLOBAL_OFFSET_TABLE_
+.*[    ]+R_X86_64_PLT32[       ]+xtrn
+.*[    ]+R_X86_64_TLSGD[       ]+xtrn
+.*[    ]+R_X86_64_GOTTPOFF[    ]+xtrn
+.*[    ]+R_X86_64_TLSLD[       ]+xtrn
+.*[    ]+R_X86_64_DTPOFF32[    ]+xtrn
+.*[    ]+R_X86_64_TPOFF32[     ]+xtrn
+.*[    ]+R_X86_64_16[  ]+xtrn
+.*[    ]+R_X86_64_PC16[        ]+xtrn
+.*[    ]+R_X86_64_8[   ]+xtrn
+.*[    ]+R_X86_64_PC8[         ]+xtrn
+.*[    ]+R_X86_64_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 (file)
index 0000000..e124ea8
--- /dev/null
@@ -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 (file)
index 0000000..861f1b4
--- /dev/null
@@ -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 (file)
index 0000000..0c30add
--- /dev/null
@@ -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+ <foo1-0xc>:
+[      ]*[a-f0-9]+:    f2 e8 00 00 00 00       bnd callq 6 <foo1-0x6>  2: R_X86_64_PC32        \*ABS\*\+0x10003c
+[      ]*[a-f0-9]+:    f2 e9 00 00 00 00       bnd jmpq c <foo1>       8: R_X86_64_PC32        \*ABS\*\+0x10003c
+
+0+c <foo1>:
+[      ]*[a-f0-9]+:    f2 eb fd                bnd jmp c <foo1>
+[      ]*[a-f0-9]+:    f2 72 fa                bnd jb c <foo1>
+[      ]*[a-f0-9]+:    f2 e8 f4 ff ff ff       bnd callq c <foo1>
+[      ]*[a-f0-9]+:    f2 eb 09                bnd jmp 24 <foo2>
+[      ]*[a-f0-9]+:    f2 72 06                bnd jb 24 <foo2>
+[      ]*[a-f0-9]+:    f2 e8 00 00 00 00       bnd callq 24 <foo2>
+
+0+24 <foo2>:
+[      ]*[a-f0-9]+:    f2 e9 00 00 00 00       bnd jmpq 2a <foo2\+0x6> 26: R_X86_64_PC32       foo-0x4
+[      ]*[a-f0-9]+:    f2 0f 82 00 00 00 00    bnd jb 31 <foo2\+0xd>   2d: R_X86_64_PC32       foo-0x4
+[      ]*[a-f0-9]+:    f2 e8 00 00 00 00       bnd callq 37 <foo2\+0x13>       33: R_X86_64_PC32       foo-0x4
+[      ]*[a-f0-9]+:    f2 e9 00 00 00 00       bnd jmpq 3d <foo2\+0x19>        39: R_X86_64_PLT32      foo-0x4
+[      ]*[a-f0-9]+:    f2 0f 82 00 00 00 00    bnd jb 44 <foo2\+0x20>  40: R_X86_64_PLT32      foo-0x4
+[      ]*[a-f0-9]+:    f2 e8 00 00 00 00       bnd callq 4a <foo2\+0x26>       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 (file)
index 0000000..db47ec6
--- /dev/null
@@ -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+ <foo1-0xc>:
+[      ]*[a-f0-9]+:    f2 e8 00 00 00 00       bnd callq 6 <foo1-0x6>  2: R_X86_64_PC32        \*ABS\*\+0x10003c
+[      ]*[a-f0-9]+:    f2 e9 00 00 00 00       bnd jmpq c <foo1>       8: R_X86_64_PC32        \*ABS\*\+0x10003c
+
+0+c <foo1>:
+[      ]*[a-f0-9]+:    f2 eb fd                bnd jmp c <foo1>
+[      ]*[a-f0-9]+:    f2 72 fa                bnd jb c <foo1>
+[      ]*[a-f0-9]+:    f2 e8 f4 ff ff ff       bnd callq c <foo1>
+[      ]*[a-f0-9]+:    f2 eb 09                bnd jmp 24 <foo2>
+[      ]*[a-f0-9]+:    f2 72 06                bnd jb 24 <foo2>
+[      ]*[a-f0-9]+:    f2 e8 00 00 00 00       bnd callq 24 <foo2>
+
+0+24 <foo2>:
+[      ]*[a-f0-9]+:    f2 e9 00 00 00 00       bnd jmpq 2a <foo2\+0x6> 26: R_X86_64_PC32       foo-0x4
+[      ]*[a-f0-9]+:    f2 0f 82 00 00 00 00    bnd jb 31 <foo2\+0xd>   2d: R_X86_64_PC32       foo-0x4
+[      ]*[a-f0-9]+:    f2 e8 00 00 00 00       bnd callq 37 <foo2\+0x13>       33: R_X86_64_PC32       foo-0x4
+[      ]*[a-f0-9]+:    f2 e9 00 00 00 00       bnd jmpq 3d <foo2\+0x19>        39: R_X86_64_PLT32      foo-0x4
+[      ]*[a-f0-9]+:    f2 0f 82 00 00 00 00    bnd jb 44 <foo2\+0x20>  40: R_X86_64_PLT32      foo-0x4
+[      ]*[a-f0-9]+:    f2 e8 00 00 00 00       bnd callq 4a <foo2\+0x26>       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 (file)
index 0000000..d16ad0a
--- /dev/null
@@ -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 (file)
index 0000000..14dae11
--- /dev/null
@@ -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 (file)
index 0000000..93c85ca
--- /dev/null
@@ -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 (file)
index 0000000..d719790
--- /dev/null
@@ -0,0 +1,34 @@
+#source: ../relax-3.s
+#as: -mshared
+#objdump: -dwr
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <foo>:
+[      ]*[a-f0-9]+:    eb 24                   jmp    26 <local>
+[      ]*[a-f0-9]+:    eb 1e                   jmp    22 <hidden_def>
+[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   9 <foo\+0x9>     5: R_X86_64_PC32        global_def-0x4
+[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   e <foo\+0xe>     a: R_X86_64_PLT32       global_def-0x4
+[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   13 <foo\+0x13>   f: R_X86_64_PC32        weak_def-0x4
+[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   18 <foo\+0x18>   14: R_X86_64_PC32       weak_hidden_undef-0x4
+[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   1d <foo\+0x1d>   19: R_X86_64_PC32       weak_hidden_def-0x4
+[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   22 <hidden_def>  1e: R_X86_64_PC32       hidden_undef-0x4
+
+0+22 <hidden_def>:
+[      ]*[a-f0-9]+:    c3                      retq   
+
+0+23 <weak_hidden_def>:
+[      ]*[a-f0-9]+:    c3                      retq   
+
+0+24 <global_def>:
+[      ]*[a-f0-9]+:    c3                      retq   
+
+0+25 <weak_def>:
+[      ]*[a-f0-9]+:    c3                      retq   
+
+0+26 <local>:
+[      ]*[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 (file)
index 0000000..86a6a65
--- /dev/null
@@ -0,0 +1,33 @@
+#source: ../relax-3.s
+#objdump: -dwr
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <foo>:
+[      ]*[a-f0-9]+:    eb 21                   jmp    23 <local>
+[      ]*[a-f0-9]+:    eb 1b                   jmp    1f <hidden_def>
+[      ]*[a-f0-9]+:    eb 1b                   jmp    21 <global_def>
+[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   b <foo\+0xb>     7: R_X86_64_PLT32       global_def-0x4
+[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   10 <foo\+0x10>   c: R_X86_64_PC32        weak_def-0x4
+[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   15 <foo\+0x15>   11: R_X86_64_PC32       weak_hidden_undef-0x4
+[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   1a <foo\+0x1a>   16: R_X86_64_PC32       weak_hidden_def-0x4
+[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   1f <hidden_def>  1b: R_X86_64_PC32       hidden_undef-0x4
+
+0+1f <hidden_def>:
+[      ]*[a-f0-9]+:    c3                      retq   
+
+0+20 <weak_hidden_def>:
+[      ]*[a-f0-9]+:    c3                      retq   
+
+0+21 <global_def>:
+[      ]*[a-f0-9]+:    c3                      retq   
+
+0+22 <weak_def>:
+[      ]*[a-f0-9]+:    c3                      retq   
+
+0+23 <local>:
+[      ]*[a-f0-9]+:    c3                      retq   
+#pass
index 9f7b4b48481f600760a0e11ab8a346b723bd9316..c771e5e0110e1a784e85928e8ec4c82989298f21 100644 (file)
@@ -1,5 +1,6 @@
 #objdump: -drw
 #name: x86-64 jump
+#notarget: *-*-solaris*
 
 .*: +file format .*
 
index d44841e7459d49464611958509689b1d5f0c8c18..7ee6c6b82fe0a8e68d916f7b2cb1bdcca460204a 100644 (file)
@@ -1,6 +1,7 @@
 #as: -J
 #objdump: -dwr
 #name: x86-64 MPX branch
+#notarget: *-*-solaris*
 
 .*: +file format .*
 
index 514c34363e6b01b7356336ba49343327507900aa..96e000936f131528ba1de56cff0a1cd85e740ece 100644 (file)
@@ -1,6 +1,7 @@
 #as: -J -madd-bnd-prefix
 #objdump: -dwr
 #name: x86-64 branch with BND prefix
+#notarget: *-*-solaris*
 
 .*: +file format .*
 
index 1dc9505b4f899e6455722138c010ebac5b07c667..8514c4d07735c08c93cb616516dae29572b5598a 100644 (file)
@@ -1,6 +1,7 @@
 #source: nop-3.s
 #objdump: -drw
 #name: x86-64 .nops 3
+#notarget: *-*-solaris*
 
 .*: +file format .*
 
index 25927ca2228fd44166b0ce7c5976c96f32b793ee..7b696624cf467ceb2032e887ab495d2889cce7e2 100644 (file)
@@ -1,6 +1,7 @@
 #source: nop-4.s
 #objdump: -drw
 #name: x86-64 .nops 4
+#notarget: *-*-solaris*
 
 .*: +file format .*
 
index 6036be30d3766fa86d02a3d886ddcc993d1867da..b0b7854f8a88dd4be13278d85c20f9f44c55331a 100644 (file)
@@ -1,6 +1,7 @@
 #source: nop-5.s
 #objdump: -drw
 #name: x86-64 .nops 5
+#notarget: *-*-solaris*
 
 .*: +file format .*
 
index c9eba8452aa370c5cf1e623dc447f374887016e2..8f432dff52696e6758406ab32194a010eab26953 100644 (file)
@@ -1,6 +1,7 @@
 #source: relax-3.s
 #as: -mshared
 #objdump: -dwr
+#notarget: *-*-solaris*
 
 .*: +file format .*
 
index 28ab5dd3f7fced6aa33c1faaf674e891f2725ccb..bb6050814522b954507977ced0a429f87ce8bb16 100644 (file)
@@ -1,5 +1,6 @@
 #source: relax-3.s
 #objdump: -dwr
+#notarget: *-*-solaris*
 
 .*: +file format .*