summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/ld/testsuite/ld-x86-64
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-12-09 17:57:18 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2014-12-09 19:50:14 +0800
commit5e8c1cf25beccac1d22d10dc866912394f42771b (patch)
treeee16b70f804484dc8e434e647e699ab50da2620f /binutils-2.25/ld/testsuite/ld-x86-64
parent8eebd7953384e6662ca926b003f2cdda8ccd3ee5 (diff)
downloadtoolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.tar.gz
toolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.tar.bz2
toolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.zip
[2.25] sync to a30720e3e633f275250e26f85ccae5dbdddfb6c6
local patches will be re-applied later commit a30720e3e633f275250e26f85ccae5dbdddfb6c6 Author: Alan Modra <amodra@gmail.com> Date: Wed Nov 19 10:30:16 2014 +1030 daily update Change-Id: Ieb2a3f4dd2ecb289ac5305ff08d428b2847494ab
Diffstat (limited to 'binutils-2.25/ld/testsuite/ld-x86-64')
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/bnd-branch-1.d19
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/bnd-branch-1.s9
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-1.d7
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-1.s16
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-2.d54
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-2.s28
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/bnd-plt-1.d55
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/dwarfreloc.exp2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/export-class.exp2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/ilp32-2.d2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/ilp32-3.d2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/ilp32-4.d2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/line.exp2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/lp64-2.d2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/lp64-3.d2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx.exp97
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx1.out2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx1a.c7
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx1a.rd3
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx1b.c7
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx1c.c10
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx1c.rd3
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx2.out2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx2a.c7
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx2a.rd3
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx2b.c7
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx2c.c10
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx2c.rd3
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx3.dd35
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx3a.s16
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx3b.s11
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx4.dd24
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx4a.s6
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/mpx4b.s5
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/plt-nacl.pd14
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/pr14207.d23
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/pr17306a.s9
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/pr17306b.s2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/split-by-file-nacl.rd2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/split-by-file.rd2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/tlsbin.dd4
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd16
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/tlsdesc.pd3
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/tlsgdesc.dd8
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/tlsie4.dd4
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/tlsld1.dd2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/tlsld3.dd2
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/tlspic.dd16
-rw-r--r--binutils-2.25/ld/testsuite/ld-x86-64/x86-64.exp15
49 files changed, 530 insertions, 54 deletions
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/bnd-branch-1.d b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-branch-1.d
new file mode 100644
index 00000000..8368f37b
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-branch-1.d
@@ -0,0 +1,19 @@
+#as: --64
+#ld: -shared -melf_x86_64
+#objdump: -dw
+
+.*: +file format .*
+
+
+#...
+Disassembly of section .text:
+
+#...
+[a-f0-9]+ <_start>:
+[ ]*[a-f0-9]+: f2 e9 [a-f0-9]+ ff ff ff bnd jmpq [a-f0-9]+ <foo1@plt>
+[ ]*[a-f0-9]+: e8 [a-f0-9]+ ff ff ff callq [a-f0-9]+ <foo2@plt>
+[ ]*[a-f0-9]+: e9 [a-f0-9]+ ff ff ff jmpq [a-f0-9]+ <foo3@plt>
+[ ]*[a-f0-9]+: e8 [a-f0-9]+ ff ff ff callq [a-f0-9]+ <foo4@plt>
+[ ]*[a-f0-9]+: f2 e8 [a-f0-9]+ ff ff ff bnd callq [a-f0-9]+ <foo3@plt>
+[ ]*[a-f0-9]+: e9 [a-f0-9]+ ff ff ff jmpq [a-f0-9]+ <foo4@plt>
+#pass
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/bnd-branch-1.s b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-branch-1.s
new file mode 100644
index 00000000..bf62981d
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-branch-1.s
@@ -0,0 +1,9 @@
+ .text
+ .globl _start
+_start:
+bnd jmp foo1@plt
+ call foo2@plt
+ jmp foo3@plt
+ call foo4@plt
+bnd call foo3@plt
+ jmp foo4@plt
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-1.d b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-1.d
new file mode 100644
index 00000000..11313ab1
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-1.d
@@ -0,0 +1,7 @@
+#as: --64 -madd-bnd-prefix
+#ld: -shared -melf_x86_64 -z bndplt
+#objdump: -dw
+
+#...
+[ ]*[a-f0-9]+: f2 e8 f0 ff ff ff bnd callq 220 <\*ABS\*\+0x228@plt>
+#pass
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-1.s b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-1.s
new file mode 100644
index 00000000..82b64f06
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-1.s
@@ -0,0 +1,16 @@
+ .type foo, %gnu_indirect_function
+ .global __GI_foo
+ .hidden __GI_foo
+ .set __GI_foo, foo
+ .text
+.globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+.globl bar
+ .type bar, @function
+bar:
+ call __GI_foo@PLT
+ ret
+ .size bar, .-bar
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-2.d b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-2.d
new file mode 100644
index 00000000..6be82902
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-2.d
@@ -0,0 +1,54 @@
+#as: --64 -madd-bnd-prefix
+#ld: -shared -melf_x86_64 -z bndplt
+#objdump: -dw
+
+#...
+0+2d0 <.plt>:
+[ ]*[a-f0-9]+: ff 35 7a 01 20 00 pushq 0x20017a\(%rip\) # 200450 <_GLOBAL_OFFSET_TABLE_\+0x8>
+[ ]*[a-f0-9]+: f2 ff 25 7b 01 20 00 bnd jmpq \*0x20017b\(%rip\) # 200458 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[ ]*[a-f0-9]+: 0f 1f 00 nopl \(%rax\)
+[ ]*[a-f0-9]+: 68 03 00 00 00 pushq \$0x3
+[ ]*[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 2d0 <\*ABS\*\+0x34c@plt-0x50>
+[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 68 00 00 00 00 pushq \$0x0
+[ ]*[a-f0-9]+: f2 e9 d5 ff ff ff bnd jmpq 2d0 <\*ABS\*\+0x34c@plt-0x50>
+[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 68 01 00 00 00 pushq \$0x1
+[ ]*[a-f0-9]+: f2 e9 c5 ff ff ff bnd jmpq 2d0 <\*ABS\*\+0x34c@plt-0x50>
+[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 68 02 00 00 00 pushq \$0x2
+[ ]*[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 2d0 <\*ABS\*\+0x34c@plt-0x50>
+[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+
+Disassembly of section .plt.bnd:
+
+0+320 <\*ABS\*\+0x34c@plt>:
+[ ]*[a-f0-9]+: f2 ff 25 39 01 20 00 bnd jmpq \*0x200139\(%rip\) # 200460 <_GLOBAL_OFFSET_TABLE_\+0x18>
+[ ]*[a-f0-9]+: 90 nop
+
+0+328 <func1@plt>:
+[ ]*[a-f0-9]+: f2 ff 25 39 01 20 00 bnd jmpq \*0x200139\(%rip\) # 200468 <_GLOBAL_OFFSET_TABLE_\+0x20>
+[ ]*[a-f0-9]+: 90 nop
+
+0+330 <func2@plt>:
+[ ]*[a-f0-9]+: f2 ff 25 39 01 20 00 bnd jmpq \*0x200139\(%rip\) # 200470 <_GLOBAL_OFFSET_TABLE_\+0x28>
+[ ]*[a-f0-9]+: 90 nop
+
+0+338 <\*ABS\*\+0x340@plt>:
+[ ]*[a-f0-9]+: f2 ff 25 39 01 20 00 bnd jmpq \*0x200139\(%rip\) # 200478 <_GLOBAL_OFFSET_TABLE_\+0x30>
+[ ]*[a-f0-9]+: 90 nop
+
+Disassembly of section .text:
+
+0+340 <resolve1>:
+[ ]*[a-f0-9]+: f2 e8 e2 ff ff ff bnd callq 328 <func1@plt>
+
+0+346 <g1>:
+[ ]*[a-f0-9]+: f2 e9 ec ff ff ff bnd jmpq 338 <\*ABS\*\+0x340@plt>
+
+0+34c <resolve2>:
+[ ]*[a-f0-9]+: f2 e8 de ff ff ff bnd callq 330 <func2@plt>
+
+0+352 <g2>:
+[ ]*[a-f0-9]+: f2 e9 c8 ff ff ff bnd jmpq 320 <\*ABS\*\+0x34c@plt>
+#pass
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-2.s b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-2.s
new file mode 100644
index 00000000..86470a2b
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-ifunc-2.s
@@ -0,0 +1,28 @@
+ .text
+ .globl fct1
+ .type fct1, @gnu_indirect_function
+ .set fct1,resolve1
+ .hidden int_fct1
+ .globl int_fct1
+ .set int_fct1,fct1
+ .type resolve1, @function
+resolve1:
+ call func1@PLT
+ .globl g1
+ .type g1, @function
+g1:
+ jmp int_fct1@PLT
+
+ .globl fct2
+ .type fct2, @gnu_indirect_function
+ .set fct2,resolve2
+ .hidden int_fct2
+ .globl int_fct2
+ .set int_fct2,fct2
+ .type resolve2, @function
+resolve2:
+ call func2@PLT
+ .globl g2
+ .type g2, @function
+g2:
+ jmp int_fct2@PLT
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/bnd-plt-1.d b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-plt-1.d
new file mode 100644
index 00000000..d76a7a7d
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/bnd-plt-1.d
@@ -0,0 +1,55 @@
+#source: bnd-branch-1.s
+#as: --64
+#ld: -shared -melf_x86_64 -z bndplt
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .plt:
+
+0+2b0 <.plt>:
+[ ]*[a-f0-9]+: ff 35 82 01 20 00 pushq 0x200182\(%rip\) # 200438 <_GLOBAL_OFFSET_TABLE_\+0x8>
+[ ]*[a-f0-9]+: f2 ff 25 83 01 20 00 bnd jmpq \*0x200183\(%rip\) # 200440 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[ ]*[a-f0-9]+: 0f 1f 00 nopl \(%rax\)
+[ ]*[a-f0-9]+: 68 00 00 00 00 pushq \$0x0
+[ ]*[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 2b0 <foo2@plt-0x50>
+[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 68 01 00 00 00 pushq \$0x1
+[ ]*[a-f0-9]+: f2 e9 d5 ff ff ff bnd jmpq 2b0 <foo2@plt-0x50>
+[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 68 02 00 00 00 pushq \$0x2
+[ ]*[a-f0-9]+: f2 e9 c5 ff ff ff bnd jmpq 2b0 <foo2@plt-0x50>
+[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 68 03 00 00 00 pushq \$0x3
+[ ]*[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 2b0 <foo2@plt-0x50>
+[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+
+Disassembly of section .plt.bnd:
+
+0+300 <foo2@plt>:
+[ ]*[a-f0-9]+: f2 ff 25 41 01 20 00 bnd jmpq \*0x200141\(%rip\) # 200448 <_GLOBAL_OFFSET_TABLE_\+0x18>
+[ ]*[a-f0-9]+: 90 nop
+
+0+308 <foo3@plt>:
+[ ]*[a-f0-9]+: f2 ff 25 41 01 20 00 bnd jmpq \*0x200141\(%rip\) # 200450 <_GLOBAL_OFFSET_TABLE_\+0x20>
+[ ]*[a-f0-9]+: 90 nop
+
+0+310 <foo1@plt>:
+[ ]*[a-f0-9]+: f2 ff 25 41 01 20 00 bnd jmpq \*0x200141\(%rip\) # 200458 <_GLOBAL_OFFSET_TABLE_\+0x28>
+[ ]*[a-f0-9]+: 90 nop
+
+0+318 <foo4@plt>:
+[ ]*[a-f0-9]+: f2 ff 25 41 01 20 00 bnd jmpq \*0x200141\(%rip\) # 200460 <_GLOBAL_OFFSET_TABLE_\+0x30>
+[ ]*[a-f0-9]+: 90 nop
+
+Disassembly of section .text:
+
+0+320 <_start>:
+[ ]*[a-f0-9]+: f2 e9 ea ff ff ff bnd jmpq 310 <foo1@plt>
+[ ]*[a-f0-9]+: e8 d5 ff ff ff callq 300 <foo2@plt>
+[ ]*[a-f0-9]+: e9 d8 ff ff ff jmpq 308 <foo3@plt>
+[ ]*[a-f0-9]+: e8 e3 ff ff ff callq 318 <foo4@plt>
+[ ]*[a-f0-9]+: f2 e8 cd ff ff ff bnd callq 308 <foo3@plt>
+[ ]*[a-f0-9]+: e9 d8 ff ff ff jmpq 318 <foo4@plt>
+#pass
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/dwarfreloc.exp b/binutils-2.25/ld/testsuite/ld-x86-64/dwarfreloc.exp
index b7e133e4..5cc7b926 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/dwarfreloc.exp
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/dwarfreloc.exp
@@ -1,5 +1,5 @@
# Expect script for DWARF relocation test.
-# Copyright 2008, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2008-2014 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/export-class.exp b/binutils-2.25/ld/testsuite/ld-x86-64/export-class.exp
index 7bad2a84..420b7a8c 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/export-class.exp
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/export-class.exp
@@ -1,6 +1,6 @@
# Expect script for symbol export classes, x86-64 variation.
#
-# Copyright 2012 Free Software Foundation, Inc.
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-2.d b/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-2.d
index 65b52984..fde3e8af 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-2.d
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-2.d
@@ -1,4 +1,4 @@
#source: dummy.s
#as: --x32
#ld: -m elf32_x86_64 tmpdir/startx32.o tmpdir/foo32.o
-#error: .*i386 architecture of input file `tmpdir/foo32.o' is incompatible with i386:x64-32.* output
+#error: .*i386(:.+)? architecture of input file `tmpdir/foo32.o' is incompatible with i386:x64-32.* output
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-3.d b/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-3.d
index b05e531c..a9080a05 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-3.d
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-3.d
@@ -1,4 +1,4 @@
#source: dummy.s
#as: --x32
#ld: -m elf32_x86_64 tmpdir/startx32.o tmpdir/foo64.o
-#error: .*i386:x86-64 architecture of input file `tmpdir/foo64.o' is incompatible with i386:x64-32.* output
+#error: .*i386:x86-64(:.+)? architecture of input file `tmpdir/foo64.o' is incompatible with i386:x64-32.* output
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-4.d b/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-4.d
index 94c1e82e..df3e94c3 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-4.d
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/ilp32-4.d
@@ -3,7 +3,7 @@
#readelf: -d -S --wide
#target: x86_64-*-linux*
-There are 9 section headers, starting at offset 0x1d4:
+There are 9 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/line.exp b/binutils-2.25/ld/testsuite/ld-x86-64/line.exp
index 3ddaf178..17e48c0d 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/line.exp
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/line.exp
@@ -1,6 +1,6 @@
# Test that the linker reports undefined symbol line number correctly.
#
-# Copyright 2007, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2007-2014 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/lp64-2.d b/binutils-2.25/ld/testsuite/ld-x86-64/lp64-2.d
index 7515881a..af7582ad 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/lp64-2.d
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/lp64-2.d
@@ -1,4 +1,4 @@
#source: dummy.s
#as: --64
#ld: -m elf_x86_64 tmpdir/start64.o tmpdir/foo32.o
-#error: .*i386 architecture of input file `tmpdir/foo32.o' is incompatible with i386:x86-64.* output
+#error: .*i386(:.+)? architecture of input file `tmpdir/foo32.o' is incompatible with i386:x86-64.* output
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/lp64-3.d b/binutils-2.25/ld/testsuite/ld-x86-64/lp64-3.d
index e60efeb9..0e995c87 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/lp64-3.d
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/lp64-3.d
@@ -1,4 +1,4 @@
#source: dummy.s
#as: --64
#ld: -m elf_x86_64 tmpdir/start64.o tmpdir/foox32.o
-#error: .*i386:x64-32 architecture of input file `tmpdir/foox32.o' is incompatible with i386:x86-64.* output
+#error: .*i386:x64-32(:.+)? architecture of input file `tmpdir/foox32.o' is incompatible with i386:x86-64.* output
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx.exp b/binutils-2.25/ld/testsuite/ld-x86-64/mpx.exp
new file mode 100644
index 00000000..bdf95935
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx.exp
@@ -0,0 +1,97 @@
+# Expect script for ELF MPX tests.
+# Copyright (C) 2013-2014 Free Software Foundation, Inc.
+#
+# This file is part of the GNU Binutils.
+#
+# 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.
+#
+
+# The following tests require running the executable generated by ld,
+# or enough of a build environment to create a fully linked executable.
+# This is not commonly available when testing a cross-built linker.
+if ![isnative] {
+ return
+}
+
+# Only on Linux for now.
+if ![istarget "x86_64-*-linux*"] {
+ return
+}
+
+# Check to see if the C compiler works
+if { [which $CC] == 0 } {
+ return
+}
+
+set build_tests {
+ {"Build libmpx1a.a"
+ "" "-Wa,-madd-bnd-prefix -fPIC"
+ {mpx1a.c} {{readelf {-r --wide} mpx1a.rd}} "libmpx1a.a"}
+ {"Build libmpx1b.a"
+ "" ""
+ {mpx1b.c} {} "libmpx1b.a"}
+ {"Build libmpx1c.a"
+ "" "-Wa,-madd-bnd-prefix"
+ {mpx1c.c} {{readelf {-r --wide} mpx1c.rd}} "libmpx1c.a"}
+ {"Build libmpx2a.a"
+ "" "-Wa,-madd-bnd-prefix -fPIE"
+ {mpx2a.c} {{readelf {-r --wide} mpx2a.rd}} "libmpx2a.a"}
+ {"Build libmpx2b.a"
+ "" "-fPIE"
+ {mpx2b.c} {} "libmpx2b.a"}
+ {"Build libmpx2c.a"
+ "" "-Wa,-madd-bnd-prefix -fPIE"
+ {mpx2c.c} {{readelf {-r --wide} mpx2c.rd}} "libmpx2c.a"}
+}
+
+run_cc_link_tests $build_tests
+
+set run_tests {
+ {"Run mpx1"
+ "tmpdir/mpx1a.o tmpdir/mpx1b.o tmpdir/mpx1c.o" ""
+ {dummy.s} "mpx1" "mpx1.out"}
+ {"Run mpx1 with -static"
+ "tmpdir/mpx1a.o tmpdir/mpx1b.o tmpdir/mpx1c.o -static" ""
+ {dummy.s} "mpx1static" "mpx1.out"}
+ {"Run mpx2"
+ "tmpdir/mpx2a.o tmpdir/mpx2b.o tmpdir/mpx2c.o -pie" ""
+ {dummy.s} "mpx2" "mpx2.out"}
+ {"Run mpx2 with -static"
+ "tmpdir/mpx2a.o tmpdir/mpx2b.o tmpdir/mpx2c.o -static" ""
+ {dummy.s} "mpx2static" "mpx2.out"}
+}
+
+run_ld_link_tests {
+ {"Build libcall.so"
+ "-m elf_x86_64 -shared -z bndplt" "" "--64"
+ {mpx3b.s} {} "libcall.so"}
+ {"Build mpx3"
+ "-m elf_x86_64 -z bndplt tmpdir/libcall.so" "" "--64"
+ {mpx3a.s} {{objdump -dw mpx3.dd}} "mpx3"}
+ {"Build libcall1.so"
+ "-m elf_x86_64 -shared -z bndplt" "" "--64"
+ {mpx4b.s} {} "libcall1.so"}
+ {"Build mpx4"
+ "-m elf_x86_64 -z bndplt tmpdir/libcall1.so" "" "--64"
+ {mpx4a.s} {{objdump -dw mpx4.dd}} "mpx4"}
+}
+
+run_ld_link_exec_tests [] $run_tests
+
+run_dump_test "bnd-branch-1"
+run_dump_test "bnd-ifunc-1"
+run_dump_test "bnd-ifunc-2"
+run_dump_test "bnd-plt-1"
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx1.out b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1.out
new file mode 100644
index 00000000..46302115
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1.out
@@ -0,0 +1,2 @@
+foo1
+foo2
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx1a.c b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1a.c
new file mode 100644
index 00000000..e1185b5f
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1a.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+void
+foo1 (void)
+{
+ printf ("foo1\n");
+}
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx1a.rd b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1a.rd
new file mode 100644
index 00000000..d66524c8
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1a.rd
@@ -0,0 +1,3 @@
+#...
+[0-9a-f ]+R_X86_64_PLT32 +0+ +.*
+#...
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx1b.c b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1b.c
new file mode 100644
index 00000000..389ac101
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1b.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+void
+foo2 (void)
+{
+ printf ("foo2\n");
+}
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx1c.c b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1c.c
new file mode 100644
index 00000000..12c7806f
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1c.c
@@ -0,0 +1,10 @@
+extern void foo1 (void);
+extern void foo2 (void);
+
+int
+main (void)
+{
+ foo1 ();
+ foo2 ();
+ return 0;
+}
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx1c.rd b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1c.rd
new file mode 100644
index 00000000..d3b292cb
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx1c.rd
@@ -0,0 +1,3 @@
+#...
+[0-9a-f ]+R_X86_64_PC32 +0+ +.*
+#...
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx2.out b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2.out
new file mode 100644
index 00000000..46302115
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2.out
@@ -0,0 +1,2 @@
+foo1
+foo2
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx2a.c b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2a.c
new file mode 100644
index 00000000..e1185b5f
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2a.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+void
+foo1 (void)
+{
+ printf ("foo1\n");
+}
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx2a.rd b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2a.rd
new file mode 100644
index 00000000..d66524c8
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2a.rd
@@ -0,0 +1,3 @@
+#...
+[0-9a-f ]+R_X86_64_PLT32 +0+ +.*
+#...
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx2b.c b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2b.c
new file mode 100644
index 00000000..389ac101
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2b.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+void
+foo2 (void)
+{
+ printf ("foo2\n");
+}
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx2c.c b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2c.c
new file mode 100644
index 00000000..12c7806f
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2c.c
@@ -0,0 +1,10 @@
+extern void foo1 (void);
+extern void foo2 (void);
+
+int
+main (void)
+{
+ foo1 ();
+ foo2 ();
+ return 0;
+}
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx2c.rd b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2c.rd
new file mode 100644
index 00000000..d66524c8
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx2c.rd
@@ -0,0 +1,3 @@
+#...
+[0-9a-f ]+R_X86_64_PLT32 +0+ +.*
+#...
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx3.dd b/binutils-2.25/ld/testsuite/ld-x86-64/mpx3.dd
new file mode 100644
index 00000000..2a8356d9
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx3.dd
@@ -0,0 +1,35 @@
+.*: +file format .*
+
+
+Disassembly of section .plt:
+
+0+400290 <.plt>:
+[ ]*[a-f0-9]+: ff 35 6a 01 20 00 pushq 0x20016a\(%rip\) # 600400 <_GLOBAL_OFFSET_TABLE_\+0x8>
+[ ]*[a-f0-9]+: f2 ff 25 6b 01 20 00 bnd jmpq \*0x20016b\(%rip\) # 600408 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[ ]*[a-f0-9]+: 0f 1f 00 nopl \(%rax\)
+[ ]*[a-f0-9]+: 68 00 00 00 00 pushq \$0x0
+[ ]*[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 400290 <call1@plt-0x30>
+[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 68 01 00 00 00 pushq \$0x1
+[ ]*[a-f0-9]+: f2 e9 d5 ff ff ff bnd jmpq 400290 <call1@plt-0x30>
+[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+
+Disassembly of section .plt.bnd:
+
+0+4002c0 <call1@plt>:
+[ ]*[a-f0-9]+: f2 ff 25 49 01 20 00 bnd jmpq \*0x200149\(%rip\) # 600410 <_GLOBAL_OFFSET_TABLE_\+0x18>
+[ ]*[a-f0-9]+: 90 nop
+
+0+4002c8 <call2@plt>:
+[ ]*[a-f0-9]+: f2 ff 25 49 01 20 00 bnd jmpq \*0x200149\(%rip\) # 600418 <_GLOBAL_OFFSET_TABLE_\+0x20>
+[ ]*[a-f0-9]+: 90 nop
+
+Disassembly of section .text:
+
+0+4002d0 <_start>:
+[ ]*[a-f0-9]+: bf c0 02 40 00 mov \$0x4002c0,%edi
+[ ]*[a-f0-9]+: f2 ff d7 bnd callq \*%rdi
+[ ]*[a-f0-9]+: 48 8b 3d 41 01 20 00 mov 0x200141\(%rip\),%rdi # 600420 <func>
+[ ]*[a-f0-9]+: f2 ff d7 bnd callq \*%rdi
+[ ]*[a-f0-9]+: c3 retq
+#pass
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx3a.s b/binutils-2.25/ld/testsuite/ld-x86-64/mpx3a.s
new file mode 100644
index 00000000..28cb580b
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx3a.s
@@ -0,0 +1,16 @@
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ movl $call1, %edi
+ bnd call *%rdi
+ movq func(%rip), %rdi
+ bnd call *%rdi
+ ret
+ .size _start, .-_start
+ .globl func
+ .data
+ .type func, @object
+ .size func, 8
+func:
+ .quad call2
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx3b.s b/binutils-2.25/ld/testsuite/ld-x86-64/mpx3b.s
new file mode 100644
index 00000000..1ee2557a
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx3b.s
@@ -0,0 +1,11 @@
+ .text
+ .globl call1
+ .type call1, @function
+call1:
+ ret
+ .size call1, .-call1
+ .globl call2
+ .type call2, @function
+call2:
+ ret
+ .size call2, .-call2
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx4.dd b/binutils-2.25/ld/testsuite/ld-x86-64/mpx4.dd
new file mode 100644
index 00000000..0cf0f758
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx4.dd
@@ -0,0 +1,24 @@
+.*: +file format .*
+
+
+Disassembly of section .plt:
+
+0+400260 <.plt>:
+[ ]*[a-f0-9]+: ff 35 42 01 20 00 pushq 0x200142\(%rip\) # 6003a8 <_GLOBAL_OFFSET_TABLE_\+0x8>
+[ ]*[a-f0-9]+: f2 ff 25 43 01 20 00 bnd jmpq \*0x200143\(%rip\) # 6003b0 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[ ]*[a-f0-9]+: 0f 1f 00 nopl \(%rax\)
+[ ]*[a-f0-9]+: 68 00 00 00 00 pushq \$0x0
+[ ]*[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 400260 <call1@plt-0x20>
+[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+
+Disassembly of section .plt.bnd:
+
+0+400280 <call1@plt>:
+[ ]*[a-f0-9]+: f2 ff 25 31 01 20 00 bnd jmpq \*0x200131\(%rip\) # 6003b8 <_GLOBAL_OFFSET_TABLE_\+0x18>
+[ ]*[a-f0-9]+: 90 nop
+
+Disassembly of section .text:
+
+0+400288 <_start>:
+[ ]*[a-f0-9]+: bf 80 02 40 00 mov \$0x400280,%edi
+[ ]*[a-f0-9]+: f2 ff d7 bnd callq \*%rdi
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx4a.s b/binutils-2.25/ld/testsuite/ld-x86-64/mpx4a.s
new file mode 100644
index 00000000..0ee2723b
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx4a.s
@@ -0,0 +1,6 @@
+.text
+ .globl _start
+ .type _start, @function
+_start:
+ movl $call1, %edi
+ bnd call *%rdi
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/mpx4b.s b/binutils-2.25/ld/testsuite/ld-x86-64/mpx4b.s
new file mode 100644
index 00000000..0e9ac14e
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/mpx4b.s
@@ -0,0 +1,5 @@
+.text
+ .globl call1
+ .type call1, @function
+call1:
+ ret
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/plt-nacl.pd b/binutils-2.25/ld/testsuite/ld-x86-64/plt-nacl.pd
index 9a9363ee..b17bf714 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/plt-nacl.pd
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/plt-nacl.pd
@@ -14,12 +14,12 @@ Disassembly of section .plt:
+[0-9a-f]+: 41 83 e3 e0 and \$0xffffffe0,%r11d
+[0-9a-f]+: 4d 01 fb add %r15,%r11
+[0-9a-f]+: 41 ff e3 jmpq \*%r11
- +[0-9a-f]+: 2e 0f 1f 84 00 00 00 nopl %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 0f 1f 84 00 00 00 nopw 0x0\(%rax,%rax,1\)
+[0-9a-f]+: 00 00 *
- +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 nopw %cs:0x0\(%rax,%rax,1\)
+[0-9a-f]+: 0f 1f 84 00 00 00 00 *
+[0-9a-f]+: 00 *
- +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 nopw %cs:0x0\(%rax,%rax,1\)
+[0-9a-f]+: 0f 1f 84 00 00 00 00 *
+[0-9a-f]+: 00 *
+[0-9a-f]+: 66 90 xchg %ax,%ax
@@ -29,12 +29,12 @@ Disassembly of section .plt:
+[0-9a-f]+: 41 83 e3 e0 and \$0xffffffe0,%r11d
+[0-9a-f]+: 4d 01 fb add %r15,%r11
+[0-9a-f]+: 41 ff e3 jmpq \*%r11
- +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 nopw %cs:0x0\(%rax,%rax,1\)
+[0-9a-f]+: 0f 1f 84 00 00 00 00 *
+[0-9a-f]+: 00 *
+[0-9a-f]+: 68 00 00 00 00 pushq \$0x0
+[0-9a-f]+: e9 ([0-9a-f]{2} ){4} * jmpq [0-9a-f]+ <fn1@plt-0x40>
- +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 nopw %cs:0x0\(%rax,%rax,1\)
+[0-9a-f]+: 0f 1f 84 00 00 00 00 *
+[0-9a-f]+: 00 *
+[0-9a-f]+: 0f 1f 80 00 00 00 00 nopl 0x0\(%rax\)
@@ -44,12 +44,12 @@ Disassembly of section .plt:
+[0-9a-f]+: 41 83 e3 e0 and \$0xffffffe0,%r11d
+[0-9a-f]+: 4d 01 fb add %r15,%r11
+[0-9a-f]+: 41 ff e3 jmpq \*%r11
- +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 nopw %cs:0x0\(%rax,%rax,1\)
+[0-9a-f]+: 0f 1f 84 00 00 00 00 *
+[0-9a-f]+: 00 *
+[0-9a-f]+: 68 01 00 00 00 pushq \$0x1
+[0-9a-f]+: e9 ([0-9a-f]{2} ){4} * jmpq [0-9a-f]+ <fn1@plt-0x40>
- +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 nopw %cs:0x0\(%rax,%rax,1\)
+[0-9a-f]+: 0f 1f 84 00 00 00 00 *
+[0-9a-f]+: 00 *
+[0-9a-f]+: 0f 1f 80 00 00 00 00 nopl 0x0\(%rax\)
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/pr14207.d b/binutils-2.25/ld/testsuite/ld-x86-64/pr14207.d
index 2362e88b..d4e22a1b 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/pr14207.d
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/pr14207.d
@@ -2,8 +2,23 @@
#as: --64
#ld: -melf_x86_64 -shared -z relro -z now
#readelf: -l --wide
+#target: x86_64-*-linux*
-#failif
-#...
- NULL +.*
-#...
+Elf file type is DYN \(Shared object file\)
+Entry point 0x1d9
+There are 4 program headers, starting at offset 64
+
+Program Headers:
+ Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
+ LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x0001e0 0x0001e0 R 0x200000
+ LOAD 0x000b48 0x0000000000200b48 0x0000000000200b48 0x0004b0 0x000cf8 RW 0x200000
+ DYNAMIC 0x000b90 0x0000000000200b90 0x0000000000200b90 0x0001c0 0x0001c0 RW 0x8
+ GNU_RELRO 0x000b48 0x0000000000200b48 0x0000000000200b48 0x0004b8 0x0004b8 R 0x1
+
+ Section to Segment mapping:
+ Segment Sections...
+ 00 .hash .dynsym .dynstr
+ 01 .init_array .fini_array .jcr .data.rel.ro .dynamic .got .bss
+ 02 .dynamic
+ 03 .init_array .fini_array .jcr .data.rel.ro .dynamic .got
+#pass
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/pr17306a.s b/binutils-2.25/ld/testsuite/ld-x86-64/pr17306a.s
new file mode 100644
index 00000000..a2ee48d3
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/pr17306a.s
@@ -0,0 +1,9 @@
+ .data
+ .globl foo
+foo:
+ .quad -1
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ pushq foo@GOTPCREL(%rip)
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/pr17306b.s b/binutils-2.25/ld/testsuite/ld-x86-64/pr17306b.s
new file mode 100644
index 00000000..c63bd2af
--- /dev/null
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/pr17306b.s
@@ -0,0 +1,2 @@
+ .text
+ movq foo@GOTPCREL(%rip), %rax
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/split-by-file-nacl.rd b/binutils-2.25/ld/testsuite/ld-x86-64/split-by-file-nacl.rd
index 6cc81013..edc3e0b4 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/split-by-file-nacl.rd
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/split-by-file-nacl.rd
@@ -1,4 +1,4 @@
-There are 9 section headers, starting at offset 0x80:
+There are 9 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Address Off Size ES Flg Lk Inf Al
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/split-by-file.rd b/binutils-2.25/ld/testsuite/ld-x86-64/split-by-file.rd
index 6cc81013..edc3e0b4 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/split-by-file.rd
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/split-by-file.rd
@@ -1,4 +1,4 @@
-There are 9 section headers, starting at offset 0x80:
+There are 9 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Address Off Size ES Flg Lk Inf Al
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/tlsbin.dd b/binutils-2.25/ld/testsuite/ld-x86-64/tlsbin.dd
index a9b1227e..c89e7ee1 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/tlsbin.dd
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/tlsbin.dd
@@ -68,7 +68,7 @@ Disassembly of section .text:
+[0-9a-f]+: 90[ ]+nop *
+[0-9a-f]+: 90[ ]+nop *
# LD -> LE
- +[0-9a-f]+: 66 66 66 64 48 8b 04[ ]+data32 data32 data32 mov %fs:0x0,%rax
+ +[0-9a-f]+: 66 66 66 64 48 8b 04[ ]+data16 data16 data16 mov %fs:0x0,%rax
+[0-9a-f]+: 25 00 00 00 00 *
+[0-9a-f]+: 90[ ]+nop *
+[0-9a-f]+: 90[ ]+nop *
@@ -83,7 +83,7 @@ Disassembly of section .text:
+[0-9a-f]+: 90[ ]+nop *
+[0-9a-f]+: 90[ ]+nop *
# LD -> LE against hidden variables
- +[0-9a-f]+: 66 66 66 64 48 8b 04[ ]+data32 data32 data32 mov %fs:0x0,%rax
+ +[0-9a-f]+: 66 66 66 64 48 8b 04[ ]+data16 data16 data16 mov %fs:0x0,%rax
+[0-9a-f]+: 25 00 00 00 00 *
+[0-9a-f]+: 90[ ]+nop *
+[0-9a-f]+: 90[ ]+nop *
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd b/binutils-2.25/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd
index e3903c49..eff90a85 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd
@@ -9,34 +9,32 @@
Disassembly of section .plt:
-[0-9a-f]+ <.*@plt-0x40>:
+[0-9a-f]+ <.plt>:
+[0-9a-f]+: ff 35 .. .. .. .. pushq 0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+[0-9a-f]+: 4c 8b 1d .. .. .. .. mov 0x[0-9a-f]+\(%rip\),%r11 +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
+[0-9a-f]+: 41 83 e3 e0 and \$0xffffffe0,%r11d
+[0-9a-f]+: 4d 01 fb add %r15,%r11
+[0-9a-f]+: 41 ff e3 jmpq \*%r11
- +[0-9a-f]+: 2e 0f 1f 84 00 00 00 nopl %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 0f 1f 84 00 00 00 nopw 0x0\(%rax,%rax,1\)
+[0-9a-f]+: 00 00 *
- +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 nopw %cs:0x0\(%rax,%rax,1\)
+[0-9a-f]+: 0f 1f 84 00 00 00 00 *
+[0-9a-f]+: 00 *
- +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 nopw %cs:0x0\(%rax,%rax,1\)
+[0-9a-f]+: 0f 1f 84 00 00 00 00 *
+[0-9a-f]+: 00 *
+[0-9a-f]+: 66 90 xchg %ax,%ax
-
-[0-9a-f]+ <.*@plt>:
+[0-9a-f]+: ff 35 .. .. .. .. pushq 0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+[0-9a-f]+: 4c 8b 1d .. .. .. .. mov 0x[0-9a-f]+\(%rip\),%r11 +# [0-9a-f]+ <_DYNAMIC\+0x190>
+[0-9a-f]+: 41 83 e3 e0 and \$0xffffffe0,%r11d
+[0-9a-f]+: 4d 01 fb add %r15,%r11
+[0-9a-f]+: 41 ff e3 jmpq \*%r11
- +[0-9a-f]+: 2e 0f 1f 84 00 00 00 nopl %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 0f 1f 84 00 00 00 nopw 0x0\(%rax,%rax,1\)
+[0-9a-f]+: 00 00 *
- +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 nopw %cs:0x0\(%rax,%rax,1\)
+[0-9a-f]+: 0f 1f 84 00 00 00 00 *
+[0-9a-f]+: 00 *
- +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\)
+ +[0-9a-f]+: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 nopw %cs:0x0\(%rax,%rax,1\)
+[0-9a-f]+: 0f 1f 84 00 00 00 00 *
+[0-9a-f]+: 00 *
+[0-9a-f]+: 66 90 xchg %ax,%ax
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/tlsdesc.pd b/binutils-2.25/ld/testsuite/ld-x86-64/tlsdesc.pd
index 2176576b..c24403c1 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/tlsdesc.pd
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/tlsdesc.pd
@@ -9,11 +9,10 @@
Disassembly of section .plt:
-[0-9a-f]+ <.*@plt-0x10>:
+[0-9a-f]+ <.plt>:
[0-9a-f]+: ff 35 .. .. 20 00 pushq .*\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8>
[0-9a-f]+: ff 25 .. .. 20 00 jmpq \*.*\(%rip\) # 201360 <_GLOBAL_OFFSET_TABLE_\+0x10>
[0-9a-f]+: 0f 1f 40 00 nopl 0x0\(%rax\)
-[0-9a-f]+ <.*@plt>:
[0-9a-f]+: ff 35 .. .. 20 00 pushq .*\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8>
[0-9a-f]+: ff 25 .. .. 20 00 jmpq \*.*\(%rip\) # 201348 <_DYNAMIC\+0x190>
[0-9a-f]+: 0f 1f 40 00 nopl 0x0\(%rax\)
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/tlsgdesc.dd b/binutils-2.25/ld/testsuite/ld-x86-64/tlsgdesc.dd
index 635974c4..85b219fd 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/tlsgdesc.dd
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/tlsgdesc.dd
@@ -38,10 +38,10 @@ Disassembly of section .text:
+[0-9a-f]+: 90[ ]+nop *
+[0-9a-f]+: 90[ ]+nop *
# GD, gd first
- +[0-9a-f]+: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x180>
+ +[0-9a-f]+: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data16 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x180>
+[0-9a-f]+: [0-9a-f]{2} *
# -> R_X86_64_DTPMOD64 sG1
- +[0-9a-f]+: 66 66 48 e8 ([0-9a-f]{2} ){3}[ ]+data32 data32 callq [0-9a-f]+ <__tls_get_addr@plt>
+ +[0-9a-f]+: 66 66 48 e8 ([0-9a-f]{2} ){3}[ ]+data16 data16 callq [0-9a-f]+ <__tls_get_addr@plt>
+[0-9a-f]+: [0-9a-f]{2} *
# -> R_X86_64_JUMP_SLOT __tls_get_addr
+[0-9a-f]+: 90[ ]+nop *
@@ -63,10 +63,10 @@ Disassembly of section .text:
+[0-9a-f]+: 90[ ]+nop *
+[0-9a-f]+: 90[ ]+nop *
+[0-9a-f]+: 90[ ]+nop *
- +[0-9a-f]+: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x160>
+ +[0-9a-f]+: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data16 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x160>
+[0-9a-f]+: [0-9a-f]{2} *
# -> R_X86_64_DTPMOD64 sG2
- +[0-9a-f]+: 66 66 48 e8 ([0-9a-f]{2} ){3}[ ]+data32 data32 callq [0-9a-f]+ <__tls_get_addr@plt>
+ +[0-9a-f]+: 66 66 48 e8 ([0-9a-f]{2} ){3}[ ]+data16 data16 callq [0-9a-f]+ <__tls_get_addr@plt>
+[0-9a-f]+: [0-9a-f]{2} *
# -> R_X86_64_JUMP_SLOT __tls_get_addr
+[0-9a-f]+: 90[ ]+nop *
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/tlsie4.dd b/binutils-2.25/ld/testsuite/ld-x86-64/tlsie4.dd
index d52e337a..e40b9177 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/tlsie4.dd
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/tlsie4.dd
@@ -9,8 +9,8 @@
Disassembly of section .text:
[a-f0-9]+ <_start>:
-[ ]*[a-f0-9]+: c7 c0 fc ff ff ff mov \$0xfffffffc,%eax
-[ ]*[a-f0-9]+: 8d 80 fc ff ff ff lea -0x4\(%rax\),%eax
+[ ]*[a-f0-9]+: 40 c7 c0 fc ff ff ff rex mov \$0xfffffffc,%eax
+[ ]*[a-f0-9]+: 40 8d 80 fc ff ff ff rex lea -0x4\(%rax\),%eax
[ ]*[a-f0-9]+: 41 c7 c0 fc ff ff ff mov \$0xfffffffc,%r8d
[ ]*[a-f0-9]+: 45 8d 80 fc ff ff ff lea -0x4\(%r8\),%r8d
[ ]*[a-f0-9]+: 41 c7 c4 fc ff ff ff mov \$0xfffffffc,%r12d
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/tlsld1.dd b/binutils-2.25/ld/testsuite/ld-x86-64/tlsld1.dd
index e91ce08b..ec7467ab 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/tlsld1.dd
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/tlsld1.dd
@@ -9,5 +9,5 @@
Disassembly of section .text:
[a-f0-9]+ <_start>:
-[ ]*[a-f0-9]+: 66 66 66 64 48 8b 04 25 00 00 00 00 data32 data32 data32 mov %fs:0x0,%rax
+[ ]*[a-f0-9]+: 66 66 66 64 48 8b 04 25 00 00 00 00 data16 data16 data16 mov %fs:0x0,%rax
#pass
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/tlsld3.dd b/binutils-2.25/ld/testsuite/ld-x86-64/tlsld3.dd
index 0b639c69..f9c8de28 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/tlsld3.dd
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/tlsld3.dd
@@ -14,7 +14,7 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 53 push %rbx
[ ]*[a-f0-9]+: 48 8d 1d ed ff ff ff lea -0x13\(%rip\),%rbx # [0-9a-f]+ <_start>
[ ]*[a-f0-9]+: 4c 01 db add %r11,%rbx
-[ ]*[a-f0-9]+: 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data16 data16 data16 nopw %cs:0x0\(%rax,%rax,1\)
[ ]*[a-f0-9]+: 64 48 8b 04 25 00 00 00 00 mov %fs:0x0,%rax
[ ]*[a-f0-9]+: 8b 80 fc ff ff ff mov -0x4\(%rax\),%eax
[ ]*[a-f0-9]+: 5b pop %rbx
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/tlspic.dd b/binutils-2.25/ld/testsuite/ld-x86-64/tlspic.dd
index 2f85586b..26d83e97 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/tlspic.dd
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/tlspic.dd
@@ -17,10 +17,10 @@ Disassembly of section .text:
+1006: 90[ ]+nop *
+1007: 90[ ]+nop *
# GD
- +1008: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x180>
+ +1008: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data16 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x180>
+100f: [0-9a-f ]+
# -> R_X86_64_DTPMOD64 sg1
- +1010: 66 66 48 e8 [0-9a-f ]+data32 data32 callq [0-9a-f]+ <.*>
+ +1010: 66 66 48 e8 [0-9a-f ]+data16 data16 callq [0-9a-f]+ <.*>
# -> R_X86_64_JUMP_SLOT __tls_get_addr
+1017: [0-9a-f ]+
+1018: 90[ ]+nop *
@@ -37,10 +37,10 @@ Disassembly of section .text:
+102e: 90[ ]+nop *
+102f: 90[ ]+nop *
# GD against local variable
- +1030: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x130>
+ +1030: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data16 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x130>
+1037: [0-9a-f ]+
# -> R_X86_64_DTPMOD64 [0 0x2000000000000000]
- +1038: 66 66 48 e8 [0-9a-f ]+data32 data32 callq [0-9a-f]+ <.*>
+ +1038: 66 66 48 e8 [0-9a-f ]+data16 data16 callq [0-9a-f]+ <.*>
# -> R_X86_64_JUMP_SLOT __tls_get_addr
+103f: [0-9a-f ]+
+1040: 90[ ]+nop *
@@ -57,10 +57,10 @@ Disassembly of section .text:
+1056: 90[ ]+nop *
+1057: 90[ ]+nop *
# GD against hidden and local variable
- +1058: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x1a8>
+ +1058: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data16 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x1a8>
+105f: [0-9a-f ]+
# -> R_X86_64_DTPMOD64 [0 0x4000000000000000]
- +1060: 66 66 48 e8 [0-9a-f ]+data32 data32 callq [0-9a-f]+ <.*>
+ +1060: 66 66 48 e8 [0-9a-f ]+data16 data16 callq [0-9a-f]+ <.*>
# -> R_X86_64_JUMP_SLOT __tls_get_addr
+1067: [0-9a-f ]+
+1068: 90[ ]+nop *
@@ -77,10 +77,10 @@ Disassembly of section .text:
+107e: 90[ ]+nop *
+107f: 90[ ]+nop *
# GD against hidden but not local variable
- +1080: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x160>
+ +1080: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data16 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x160>
+1087: [0-9a-f ]+
# -> R_X86_64_DTPMOD64 [0 0x6000000000000000]
- +1088: 66 66 48 e8 [0-9a-f ]+data32 data32 callq [0-9a-f]+ <.*>
+ +1088: 66 66 48 e8 [0-9a-f ]+data16 data16 callq [0-9a-f]+ <.*>
# -> R_X86_64_JUMP_SLOT __tls_get_addr
+108f: [0-9a-f ]+
+1090: 90[ ]+nop *
diff --git a/binutils-2.25/ld/testsuite/ld-x86-64/x86-64.exp b/binutils-2.25/ld/testsuite/ld-x86-64/x86-64.exp
index 3ddce846..54786a78 100644
--- a/binutils-2.25/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/binutils-2.25/ld/testsuite/ld-x86-64/x86-64.exp
@@ -1,6 +1,5 @@
# Expect script for ld-x86_64 tests
-# Copyright (C) 2002, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
-# Free Software Foundation
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
@@ -137,6 +136,14 @@ set x86_64tests {
{"build 32-bit object with 33 locals" "-melf_x86_64 -e 0" "" "--32" {32bit.s} {{ ld incompatible.l }} "dummy" }
{"build 64-bit object" "-melf_x86_64 -e 0 --defsym foo=1" "" "--64" {64bit.s} {} "dummy" }
{"link mixed objects" "-melf_x86_64 -e 0 tmpdir/32bit.o tmpdir/64bit.o" "" "" {} { { ld incompatible.l } } "mixed"}
+ {"PR ld/17313 (1)" "-melf_x86_64" ""
+ "--64" {dummy.s} {} ""}
+ {"PR ld/17313 (2)" "-melf_x86_64 -shared --just-symbols=tmpdir/dummy.o" ""
+ "--64" {lea1.s} {} "libpr17313.so"}
+ {"PR ld/17306 (1)" "-melf_x86_64" ""
+ "--64" {pr17306b.s} {} ""}
+ {"PR ld/17306 (2)" "-melf_x86_64 -shared -Bsymbolic --just-symbols=tmpdir/pr17306b.o" ""
+ "--64" {pr17306a.s} {} "libpr17306.so"}
}
# So as to avoid rewriting every last test case here in a nacl variant,
@@ -172,7 +179,7 @@ global ld
set test_name "Mixed x86_64 and i386 input test 1"
set test mixed1
if { ![ld_simple_link $ld tmpdir/$test "-m$emul tmpdir/${test}a.o tmpdir/${test}b.o"] } {
- if [string match "*i386 architecture of input file `tmpdir/${test}b.o' is incompatible with i386:x86-64* output*" $link_output] {
+ if [string match "*i386* architecture of input file `tmpdir/${test}b.o' is incompatible with i386:x86-64* output*" $link_output] {
pass "$test_name"
} {
fail "$test_name"
@@ -182,7 +189,7 @@ if { ![ld_simple_link $ld tmpdir/$test "-m$emul tmpdir/${test}a.o tmpdir/${test}
set test_name "Mixed x86_64 and i386 input test 2"
set test mixed2
if { ![ld_simple_link $ld tmpdir/$test "-m$emul tmpdir/${test}a.o tmpdir/${test}b.o"] } {
- if [string match "*i386 architecture of input file `tmpdir/${test}b.o' is incompatible with i386:x86-64* output*" $link_output] {
+ if [string match "*i386* architecture of input file `tmpdir/${test}b.o' is incompatible with i386:x86-64* output*" $link_output] {
pass "$test_name"
} {
fail "$test_name"