• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂2d1d9ed8d3ccc8838531965557300c7b74069d8c (tree)
時間2015-10-22 08:45:47
作者H.J. Lu <hjl.tools@gmai...>
CommiterH.J. Lu

Log Message

Add "-z call-nop=PADDING" option to ld

The ld linker can transform indirect call to a locally defined function,
foo, via its GOT slot, to either "NOP call foo" or "call foo NOP" where
NOP is a 1-byte NOP padding. This patch adds a "-z call-nop=PADDING"
option to x86 ld to control 1-byte NOP padding for x86 call instruction.
PADDING is one of prefix-addr, prefix-nop, suffix-nop, prefix-NUMBER or
suffix-NUMBER.

bfd/

* elf32-i386.c (elf_i386_convert_load): Use call_nop_byte and
check call_nop_as_suffix for 1-byte NOP padding to pad call.
* elf64-x86-64.c (elf_x86_64_convert_load): Likewise.

include/

* bfdlink.h (bfd_link_info): Add call_nop_as_suffix and
call_nop_byte.

ld/

* ld/ld.texinfo: Document "-z call-nop=PADDING" option.
* emulparams/call_nop.sh: New file.
* emulparams/elf_i386_be.sh: Source
${srcdir}/emulparams/call_nop.sh.
* emulparams/elf_i386_chaos.sh: Likewise.
* emulparams/elf_i386_ldso.sh: Likewise.
* emulparams/elf_i386_vxworks.sh: Likewise.
* emulparams/elf_iamcu.sh: Likewise.
* emulparams/elf_k1om.sh: Likewise.
* emulparams/elf_l1om.sh: Likewise.
* emulparams/elf_x86_64.sh: Likewise.
* emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set
link_info.call_nop_byte if $CALL_NOP_BYTE isn't empty.

ld/testsuite/

* ld-i386/call3.s: New file.
* ld-i386/call3a.d: Likewise.
* ld-i386/call3b.d: Likewise.
* ld-i386/call3c.d: Likewise.
* ld-i386/call3d.d: Likewise.
* ld-i386/call3e.d: Likewise.
* ld-i386/call3f.d: Likewise.
* ld-i386/call3g.d: Likewise.
* ld-i386/call3h.d: Likewise.
* ld-i386/load1-nacl.d: Likewise.
* ld-x86-64/call1.s: Likewise.
* ld-x86-64/call1a.d: Likewise.
* ld-x86-64/call1b.d: Likewise.
* ld-x86-64/call1c.d: Likewise.
* ld-x86-64/call1d.d: Likewise.
* ld-x86-64/call1e.d: Likewise.
* ld-x86-64/call1f.d: Likewise.
* ld-x86-64/call1g.d: Likewise.
* ld-x86-64/call1h.d: Likewise.
* ld-x86-64/call1i.d: Likewise.
* ld-x86-64/load1a-nacl.d: Likewise.
* ld-x86-64/load1b-nacl.d: Likewise.
* ld-x86-64/load1c-nacl.d: Likewise.
* ld-x86-64/load1d-nacl.d: Likewise.

Change Summary

差異

--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2924,8 +2924,14 @@ convert_branch:
29242924 /* Convert to "nop call foo". ADDR_PREFIX_OPCODE
29252925 is a nop prefix. */
29262926 modrm = 0xe8;
2927- nop = ADDR_PREFIX_OPCODE;
2928- nop_offset = roff - 2;
2927+ nop = link_info->call_nop_byte;
2928+ if (link_info->call_nop_as_suffix)
2929+ {
2930+ nop_offset = roff + 3;
2931+ irel->r_offset -= 1;
2932+ }
2933+ else
2934+ nop_offset = roff - 2;
29292935 }
29302936 else
29312937 {
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -3217,6 +3217,7 @@ elf_x86_64_convert_load (bfd *abfd, asection *sec,
32173217 {
32183218 /* We have "call/jmp *foo@GOTPCREL(%rip)". */
32193219 unsigned int nop;
3220+ unsigned int disp;
32203221 bfd_vma nop_offset;
32213222
32223223 /* Convert R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX to
@@ -3224,7 +3225,6 @@ elf_x86_64_convert_load (bfd *abfd, asection *sec,
32243225 modrm = bfd_get_8 (abfd, contents + roff - 1);
32253226 if (modrm == 0x25)
32263227 {
3227- unsigned int disp;
32283228 /* Convert to "jmp foo nop". */
32293229 modrm = 0xe9;
32303230 nop = NOP_OPCODE;
@@ -3238,8 +3238,16 @@ elf_x86_64_convert_load (bfd *abfd, asection *sec,
32383238 /* Convert to "nop call foo". ADDR_PREFIX_OPCODE
32393239 is a nop prefix. */
32403240 modrm = 0xe8;
3241- nop = ADDR_PREFIX_OPCODE;
3242- nop_offset = irel->r_offset - 2;
3241+ nop = link_info->call_nop_byte;
3242+ if (link_info->call_nop_as_suffix)
3243+ {
3244+ nop_offset = irel->r_offset + 3;
3245+ disp = bfd_get_32 (abfd, contents + irel->r_offset);
3246+ irel->r_offset -= 1;
3247+ bfd_put_32 (abfd, disp, contents + irel->r_offset);
3248+ }
3249+ else
3250+ nop_offset = irel->r_offset - 2;
32433251 }
32443252 bfd_put_8 (abfd, nop, contents + nop_offset);
32453253 bfd_put_8 (abfd, modrm, contents + irel->r_offset - 1);
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -434,6 +434,12 @@ struct bfd_link_info
434434 /* TRUE if generation of .interp/PT_INTERP should be suppressed. */
435435 unsigned int nointerp: 1;
436436
437+ /* TRUE if generate a 1-byte NOP as suffix for x86 call instruction. */
438+ unsigned int call_nop_as_suffix : 1;
439+
440+ /* The 1-byte NOP for x86 call instruction. */
441+ char call_nop_byte;
442+
437443 /* Char that may appear as the first char of a symbol, but should be
438444 skipped (like symbol_leading_char) when looking up symbols in
439445 wrap_hash. Used by PowerPC Linux for 'dot' symbols. */
--- /dev/null
+++ b/ld/emulparams/call_nop.sh
@@ -0,0 +1,48 @@
1+PARSE_AND_LIST_OPTIONS_CALL_NOP='
2+ fprintf (file, _("\
3+ -z call-nop=PADDING Use PADDING as 1-byte NOP for branch\n"));
4+'
5+PARSE_AND_LIST_ARGS_CASE_Z_CALL_NOP='
6+ else if (strncmp (optarg, "call-nop=", 9) == 0)
7+ {
8+ if (strcmp (optarg + 9, "prefix-addr") == 0)
9+ {
10+ link_info.call_nop_as_suffix = FALSE;
11+ link_info.call_nop_byte = 0x67;
12+ }
13+ else if (strcmp (optarg + 9, "prefix-nop") == 0)
14+ {
15+ link_info.call_nop_as_suffix = FALSE;
16+ link_info.call_nop_byte = 0x90;
17+ }
18+ else if (strcmp (optarg + 9, "suffix-nop") == 0)
19+ {
20+ link_info.call_nop_as_suffix = TRUE;
21+ link_info.call_nop_byte = 0x90;
22+ }
23+ else if (strncmp (optarg + 9, "prefix-", 7) == 0)
24+ {
25+ char *end;
26+ link_info.call_nop_byte = strtoul (optarg + 16 , &end, 0);
27+ if (*end)
28+ einfo (_("%P%F: invalid number for -z call-nop=prefix-: %s\n"),
29+ optarg + 16);
30+ link_info.call_nop_as_suffix = FALSE;
31+ }
32+ else if (strncmp (optarg + 9, "suffix-", 7) == 0)
33+ {
34+ char *end;
35+ link_info.call_nop_byte = strtoul (optarg + 16, &end, 0);
36+ if (*end)
37+ einfo (_("%P%F: invalid number for -z call-nop=suffix-: %s\n"),
38+ optarg + 16);
39+ link_info.call_nop_as_suffix = TRUE;
40+ }
41+ else
42+ einfo (_("%P%F: unsupported option: -z %s\n"), optarg);
43+ }
44+'
45+
46+PARSE_AND_LIST_OPTIONS="$PARSE_AND_LIST_OPTIONS $PARSE_AND_LIST_OPTIONS_CALL_NOP"
47+PARSE_AND_LIST_ARGS_CASE_Z="$PARSE_AND_LIST_ARGS_CASE_Z $PARSE_AND_LIST_ARGS_CASE_Z_CALL_NOP"
48+CALL_NOP_BYTE=0x67
--- a/ld/emulparams/elf32_x86_64.sh
+++ b/ld/emulparams/elf32_x86_64.sh
@@ -1,5 +1,6 @@
11 . ${srcdir}/emulparams/plt_unwind.sh
22 . ${srcdir}/emulparams/extern_protected_data.sh
3+. ${srcdir}/emulparams/call_nop.sh
34 SCRIPT_NAME=elf
45 ELFSIZE=32
56 OUTPUT_FORMAT="elf32-x86-64"
--- a/ld/emulparams/elf_i386.sh
+++ b/ld/emulparams/elf_i386.sh
@@ -1,5 +1,6 @@
11 . ${srcdir}/emulparams/plt_unwind.sh
22 . ${srcdir}/emulparams/extern_protected_data.sh
3+. ${srcdir}/emulparams/call_nop.sh
34 SCRIPT_NAME=elf
45 OUTPUT_FORMAT="elf32-i386"
56 NO_RELA_RELOCS=yes
--- a/ld/emulparams/elf_i386_be.sh
+++ b/ld/emulparams/elf_i386_be.sh
@@ -1,4 +1,5 @@
11 . ${srcdir}/emulparams/extern_protected_data.sh
2+. ${srcdir}/emulparams/call_nop.sh
23 SCRIPT_NAME=elf
34 OUTPUT_FORMAT="elf32-i386"
45 NO_RELA_RELOCS=yes
--- a/ld/emulparams/elf_i386_chaos.sh
+++ b/ld/emulparams/elf_i386_chaos.sh
@@ -1,5 +1,6 @@
11 . ${srcdir}/emulparams/plt_unwind.sh
22 . ${srcdir}/emulparams/extern_protected_data.sh
3+. ${srcdir}/emulparams/call_nop.sh
34 SCRIPT_NAME=elf_chaos
45 OUTPUT_FORMAT="elf32-i386"
56 TEXT_START_ADDR=0x40000000
--- a/ld/emulparams/elf_i386_ldso.sh
+++ b/ld/emulparams/elf_i386_ldso.sh
@@ -1,5 +1,6 @@
11 . ${srcdir}/emulparams/plt_unwind.sh
22 . ${srcdir}/emulparams/extern_protected_data.sh
3+. ${srcdir}/emulparams/call_nop.sh
34 SCRIPT_NAME=elf
45 OUTPUT_FORMAT="elf32-i386"
56 NO_RELA_RELOCS=yes
--- a/ld/emulparams/elf_i386_vxworks.sh
+++ b/ld/emulparams/elf_i386_vxworks.sh
@@ -12,3 +12,4 @@ GENERATE_PIE_SCRIPT=yes
1212 NO_SMALL_DATA=yes
1313 . ${srcdir}/emulparams/vxworks.sh
1414 . ${srcdir}/emulparams/extern_protected_data.sh
15+. ${srcdir}/emulparams/call_nop.sh
--- a/ld/emulparams/elf_iamcu.sh
+++ b/ld/emulparams/elf_iamcu.sh
@@ -1,5 +1,6 @@
11 . ${srcdir}/emulparams/plt_unwind.sh
22 . ${srcdir}/emulparams/extern_protected_data.sh
3+. ${srcdir}/emulparams/call_nop.sh
34 SCRIPT_NAME=elf
45 OUTPUT_FORMAT="elf32-iamcu"
56 NO_RELA_RELOCS=yes
--- a/ld/emulparams/elf_k1om.sh
+++ b/ld/emulparams/elf_k1om.sh
@@ -1,5 +1,6 @@
11 . ${srcdir}/emulparams/plt_unwind.sh
22 . ${srcdir}/emulparams/extern_protected_data.sh
3+. ${srcdir}/emulparams/call_nop.sh
34 SCRIPT_NAME=elf
45 ELFSIZE=64
56 OUTPUT_FORMAT="elf64-k1om"
--- a/ld/emulparams/elf_l1om.sh
+++ b/ld/emulparams/elf_l1om.sh
@@ -1,5 +1,6 @@
11 . ${srcdir}/emulparams/plt_unwind.sh
22 . ${srcdir}/emulparams/extern_protected_data.sh
3+. ${srcdir}/emulparams/call_nop.sh
34 SCRIPT_NAME=elf
45 ELFSIZE=64
56 OUTPUT_FORMAT="elf64-l1om"
--- a/ld/emulparams/elf_x86_64.sh
+++ b/ld/emulparams/elf_x86_64.sh
@@ -1,5 +1,6 @@
11 . ${srcdir}/emulparams/plt_unwind.sh
22 . ${srcdir}/emulparams/extern_protected_data.sh
3+. ${srcdir}/emulparams/call_nop.sh
34 SCRIPT_NAME=elf
45 ELFSIZE=64
56 OUTPUT_FORMAT="elf64-x86-64"
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -103,6 +103,7 @@ gld${EMULATION_NAME}_before_parse (void)
103103 input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
104104 config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
105105 config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
106+ `if test -n "$CALL_NOP_BYTE" ; then echo link_info.call_nop_byte = $CALL_NOP_BYTE; fi`;
106107 }
107108
108109 EOF
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -1199,6 +1199,20 @@ generated by compiler. Updates on protected data symbols by another
11991199 module aren't visible to the resulting shared library. Supported for
12001200 i386 and x86-64.
12011201
1202+@item call-nop=prefix-addr
1203+@itemx call-nop=prefix-nop
1204+@itemx call-nop=suffix-nop
1205+@itemx call-nop=prefix-@var{byte}
1206+@itemx call-nop=suffix-@var{byte}
1207+Specify the 1-byte @code{NOP} padding when transforming indirect call
1208+to a locally defined function, foo, via its GOT slot.
1209+@option{call-nop=prefix-addr} generates @code{0x67 call foo}.
1210+@option{call-nop=prefix-nop} generates @code{0x90 call foo}.
1211+@option{call-nop=suffix-nop} generates @code{call foo 0x90}.
1212+@option{call-nop=prefix-@var{byte}} generates @code{@var{byte} call foo}.
1213+@option{call-nop=suffix-@var{byte}} generates @code{call foo @var{byte}}.
1214+Supported for i386 and x86_64.
1215+
12021216 @end table
12031217
12041218 Other keywords are ignored for Solaris compatibility.
--- /dev/null
+++ b/ld/testsuite/ld-i386/call3.s
@@ -0,0 +1,9 @@
1+ .text
2+ .globl foo
3+ .type foo, @function
4+foo:
5+ ret
6+ .globl _start
7+ .type _start, @function
8+_start:
9+ call *foo@GOT
--- /dev/null
+++ b/ld/testsuite/ld-i386/call3a.d
@@ -0,0 +1,13 @@
1+#source: call3.s
2+#as: --32
3+#ld: -melf_i386
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4} * addr16 call +[a-f0-9]+ <foo>
13+#pass
--- /dev/null
+++ b/ld/testsuite/ld-i386/call3b.d
@@ -0,0 +1,13 @@
1+#source: call3.s
2+#as: --32
3+#ld: -melf_i386 -z call-nop=prefix-addr
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4} * addr16 call +[a-f0-9]+ <foo>
13+#pass
--- /dev/null
+++ b/ld/testsuite/ld-i386/call3c.d
@@ -0,0 +1,14 @@
1+#source: call3.s
2+#as: --32
3+#ld: -melf_i386 -z call-nop=prefix-nop
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: 90 nop
13+[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * call +[a-f0-9]+ <foo>
14+#pass
--- /dev/null
+++ b/ld/testsuite/ld-i386/call3d.d
@@ -0,0 +1,14 @@
1+#source: call3.s
2+#as: --32
3+#ld: -melf_i386 -z call-nop=suffix-nop
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * call +[a-f0-9]+ <foo>
13+[ ]*[a-f0-9]+: 90 nop
14+#pass
--- /dev/null
+++ b/ld/testsuite/ld-i386/call3e.d
@@ -0,0 +1,13 @@
1+#source: call3.s
2+#as: --32
3+#ld: -melf_i386 -z call-nop=prefix-0x67
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4} * addr16 call +[a-f0-9]+ <foo>
13+#pass
--- /dev/null
+++ b/ld/testsuite/ld-i386/call3f.d
@@ -0,0 +1,14 @@
1+#source: call3.s
2+#as: --32
3+#ld: -melf_i386 -z call-nop=prefix-0x90
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: 90 nop
13+[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * call +[a-f0-9]+ <foo>
14+#pass
--- /dev/null
+++ b/ld/testsuite/ld-i386/call3g.d
@@ -0,0 +1,14 @@
1+#source: call3.s
2+#as: --32
3+#ld: -melf_i386 -z call-nop=suffix-0x90
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * call +[a-f0-9]+ <foo>
13+[ ]*[a-f0-9]+: 90 nop
14+#pass
--- /dev/null
+++ b/ld/testsuite/ld-i386/call3h.d
@@ -0,0 +1,14 @@
1+#source: call3.s
2+#as: --32
3+#ld: -melf_i386 -z call-nop=suffix-144
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * call +[a-f0-9]+ <foo>
13+[ ]*[a-f0-9]+: 90 nop
14+#pass
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -296,9 +296,18 @@ run_dump_test "mov1b"
296296 run_dump_test "branch1"
297297 run_dump_test "call1"
298298 run_dump_test "call2"
299+run_dump_test "call3a"
300+run_dump_test "call3b"
301+run_dump_test "call3c"
302+run_dump_test "call3d"
303+run_dump_test "call3e"
304+run_dump_test "call3f"
305+run_dump_test "call3g"
306+run_dump_test "call3h"
299307 run_dump_test "jmp1"
300308 run_dump_test "jmp2"
301309 run_dump_test "load1"
310+run_dump_test "load1-nacl"
302311 run_dump_test "load2"
303312 run_dump_test "load3"
304313 run_dump_test "load4a"
--- /dev/null
+++ b/ld/testsuite/ld-i386/load1-nacl.d
@@ -0,0 +1,59 @@
1+#source: load1.s
2+#as: --32
3+#ld: -melf_i386
4+#objdump: -dw --sym
5+#target: i?86-*-nacl* x86_64-*-nacl*
6+
7+.*: +file format .*
8+
9+SYMBOL TABLE:
10+#...
11+10030080 l O .data 0+1 bar
12+#...
13+10030081 g O .data 0+1 foo
14+#...
15+
16+Disassembly of section .text:
17+
18+0+20000 <_start>:
19+[ ]*[a-f0-9]+: 8d 05 80 00 03 10 lea 0x10030080,%eax
20+[ ]*[a-f0-9]+: 81 d0 80 00 03 10 adc \$0x10030080,%eax
21+[ ]*[a-f0-9]+: 81 c3 80 00 03 10 add \$0x10030080,%ebx
22+[ ]*[a-f0-9]+: 81 e1 80 00 03 10 and \$0x10030080,%ecx
23+[ ]*[a-f0-9]+: 81 fa 80 00 03 10 cmp \$0x10030080,%edx
24+[ ]*[a-f0-9]+: 81 cf 80 00 03 10 or \$0x10030080,%edi
25+[ ]*[a-f0-9]+: 81 de 80 00 03 10 sbb \$0x10030080,%esi
26+[ ]*[a-f0-9]+: 81 ed 80 00 03 10 sub \$0x10030080,%ebp
27+[ ]*[a-f0-9]+: 81 f4 80 00 03 10 xor \$0x10030080,%esp
28+[ ]*[a-f0-9]+: f7 c1 80 00 03 10 test \$0x10030080,%ecx
29+[ ]*[a-f0-9]+: 8d 05 80 00 03 10 lea 0x10030080,%eax
30+[ ]*[a-f0-9]+: 81 d0 80 00 03 10 adc \$0x10030080,%eax
31+[ ]*[a-f0-9]+: 81 c3 80 00 03 10 add \$0x10030080,%ebx
32+[ ]*[a-f0-9]+: 81 e1 80 00 03 10 and \$0x10030080,%ecx
33+[ ]*[a-f0-9]+: 81 fa 80 00 03 10 cmp \$0x10030080,%edx
34+[ ]*[a-f0-9]+: 81 cf 80 00 03 10 or \$0x10030080,%edi
35+[ ]*[a-f0-9]+: 81 de 80 00 03 10 sbb \$0x10030080,%esi
36+[ ]*[a-f0-9]+: 81 ed 80 00 03 10 sub \$0x10030080,%ebp
37+[ ]*[a-f0-9]+: 81 f4 80 00 03 10 xor \$0x10030080,%esp
38+[ ]*[a-f0-9]+: f7 c1 80 00 03 10 test \$0x10030080,%ecx
39+[ ]*[a-f0-9]+: 8d 05 81 00 03 10 lea 0x10030081,%eax
40+[ ]*[a-f0-9]+: 81 d0 81 00 03 10 adc \$0x10030081,%eax
41+[ ]*[a-f0-9]+: 81 c3 81 00 03 10 add \$0x10030081,%ebx
42+[ ]*[a-f0-9]+: 81 e1 81 00 03 10 and \$0x10030081,%ecx
43+[ ]*[a-f0-9]+: 81 fa 81 00 03 10 cmp \$0x10030081,%edx
44+[ ]*[a-f0-9]+: 81 cf 81 00 03 10 or \$0x10030081,%edi
45+[ ]*[a-f0-9]+: 81 de 81 00 03 10 sbb \$0x10030081,%esi
46+[ ]*[a-f0-9]+: 81 ed 81 00 03 10 sub \$0x10030081,%ebp
47+[ ]*[a-f0-9]+: 81 f4 81 00 03 10 xor \$0x10030081,%esp
48+[ ]*[a-f0-9]+: f7 c1 81 00 03 10 test \$0x10030081,%ecx
49+[ ]*[a-f0-9]+: 8d 05 81 00 03 10 lea 0x10030081,%eax
50+[ ]*[a-f0-9]+: 81 d0 81 00 03 10 adc \$0x10030081,%eax
51+[ ]*[a-f0-9]+: 81 c3 81 00 03 10 add \$0x10030081,%ebx
52+[ ]*[a-f0-9]+: 81 e1 81 00 03 10 and \$0x10030081,%ecx
53+[ ]*[a-f0-9]+: 81 fa 81 00 03 10 cmp \$0x10030081,%edx
54+[ ]*[a-f0-9]+: 81 cf 81 00 03 10 or \$0x10030081,%edi
55+[ ]*[a-f0-9]+: 81 de 81 00 03 10 sbb \$0x10030081,%esi
56+[ ]*[a-f0-9]+: 81 ed 81 00 03 10 sub \$0x10030081,%ebp
57+[ ]*[a-f0-9]+: 81 f4 81 00 03 10 xor \$0x10030081,%esp
58+[ ]*[a-f0-9]+: f7 c1 81 00 03 10 test \$0x10030081,%ecx
59+#pass
--- a/ld/testsuite/ld-i386/load1.d
+++ b/ld/testsuite/ld-i386/load1.d
@@ -1,6 +1,7 @@
11 #as: --32
22 #ld: -melf_i386
33 #objdump: -dw --sym
4+#notarget: i?86-*-nacl* x86_64-*-nacl*
45
56 .*: +file format .*
67
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/call1.s
@@ -0,0 +1,9 @@
1+ .text
2+ .globl foo
3+ .type foo, @function
4+foo:
5+ ret
6+ .globl _start
7+ .type _start, @function
8+_start:
9+ call *foo@GOTPCREL(%rip)
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/call1a.d
@@ -0,0 +1,13 @@
1+#source: call1.s
2+#as: --64
3+#ld: -melf_x86_64
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4} * addr32 callq +[a-f0-9]+ <foo>
13+#pass
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/call1b.d
@@ -0,0 +1,13 @@
1+#source: call1.s
2+#as: --64
3+#ld: -melf_x86_64 -z call-nop=prefix-addr
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4} * addr32 callq +[a-f0-9]+ <foo>
13+#pass
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/call1c.d
@@ -0,0 +1,14 @@
1+#source: call1.s
2+#as: --64
3+#ld: -melf_x86_64 -z call-nop=prefix-nop
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: 90 nop
13+[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * callq +[a-f0-9]+ <foo>
14+#pass
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/call1d.d
@@ -0,0 +1,14 @@
1+#source: call1.s
2+#as: --64
3+#ld: -melf_x86_64 -z call-nop=suffix-nop
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * callq +[a-f0-9]+ <foo>
13+[ ]*[a-f0-9]+: 90 nop
14+#pass
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/call1e.d
@@ -0,0 +1,13 @@
1+#source: call1.s
2+#as: --64
3+#ld: -melf_x86_64 -z call-nop=prefix-0x67
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4} * addr32 callq +[a-f0-9]+ <foo>
13+#pass
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/call1f.d
@@ -0,0 +1,14 @@
1+#source: call1.s
2+#as: --64
3+#ld: -melf_x86_64 -z call-nop=prefix-0x90
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: 90 nop
13+[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * callq +[a-f0-9]+ <foo>
14+#pass
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/call1g.d
@@ -0,0 +1,14 @@
1+#source: call1.s
2+#as: --64
3+#ld: -melf_x86_64 -z call-nop=suffix-0x90
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * callq +[a-f0-9]+ <foo>
13+[ ]*[a-f0-9]+: 90 nop
14+#pass
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/call1h.d
@@ -0,0 +1,14 @@
1+#source: call1.s
2+#as: --64
3+#ld: -melf_x86_64 -z call-nop=suffix-144
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * callq +[a-f0-9]+ <foo>
13+[ ]*[a-f0-9]+: 90 nop
14+#pass
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/call1i.d
@@ -0,0 +1,14 @@
1+#source: call1.s
2+#as: --x32
3+#ld: -melf32_x86_64 -z call-nop=suffix-0x90
4+#objdump: -dw
5+
6+.*: +file format .*
7+
8+
9+Disassembly of section .text:
10+
11+#...
12+[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * callq +[a-f0-9]+ <foo>
13+[ ]*[a-f0-9]+: 90 nop
14+#pass
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/load1a-nacl.d
@@ -0,0 +1,55 @@
1+#source: load1.s
2+#as: --64
3+#ld: -melf_x86_64
4+#objdump: -dw --sym
5+#target: x86_64-*-nacl*
6+
7+.*: +file format .*
8+
9+SYMBOL TABLE:
10+#...
11+0+100300c8 l O .data 0+1 bar
12+#...
13+0+100300c9 g O .data 0+1 foo
14+#...
15+
16+Disassembly of section .text:
17+
18+0+20000 <_start>:
19+[ ]*[a-f0-9]+: 81 d0 c8 00 03 10 adc \$0x100300c8,%eax
20+[ ]*[a-f0-9]+: 81 c3 c8 00 03 10 add \$0x100300c8,%ebx
21+[ ]*[a-f0-9]+: 81 e1 c8 00 03 10 and \$0x100300c8,%ecx
22+[ ]*[a-f0-9]+: 81 fa c8 00 03 10 cmp \$0x100300c8,%edx
23+[ ]*[a-f0-9]+: 81 ce c8 00 03 10 or \$0x100300c8,%esi
24+[ ]*[a-f0-9]+: 81 df c8 00 03 10 sbb \$0x100300c8,%edi
25+[ ]*[a-f0-9]+: 81 ed c8 00 03 10 sub \$0x100300c8,%ebp
26+[ ]*[a-f0-9]+: 41 81 f0 c8 00 03 10 xor \$0x100300c8,%r8d
27+[ ]*[a-f0-9]+: 41 f7 c7 c8 00 03 10 test \$0x100300c8,%r15d
28+[ ]*[a-f0-9]+: 48 81 d0 c8 00 03 10 adc \$0x100300c8,%rax
29+[ ]*[a-f0-9]+: 48 81 c3 c8 00 03 10 add \$0x100300c8,%rbx
30+[ ]*[a-f0-9]+: 48 81 e1 c8 00 03 10 and \$0x100300c8,%rcx
31+[ ]*[a-f0-9]+: 48 81 fa c8 00 03 10 cmp \$0x100300c8,%rdx
32+[ ]*[a-f0-9]+: 48 81 cf c8 00 03 10 or \$0x100300c8,%rdi
33+[ ]*[a-f0-9]+: 48 81 de c8 00 03 10 sbb \$0x100300c8,%rsi
34+[ ]*[a-f0-9]+: 48 81 ed c8 00 03 10 sub \$0x100300c8,%rbp
35+[ ]*[a-f0-9]+: 49 81 f0 c8 00 03 10 xor \$0x100300c8,%r8
36+[ ]*[a-f0-9]+: 49 f7 c7 c8 00 03 10 test \$0x100300c8,%r15
37+[ ]*[a-f0-9]+: 81 d0 c9 00 03 10 adc \$0x100300c9,%eax
38+[ ]*[a-f0-9]+: 81 c3 c9 00 03 10 add \$0x100300c9,%ebx
39+[ ]*[a-f0-9]+: 81 e1 c9 00 03 10 and \$0x100300c9,%ecx
40+[ ]*[a-f0-9]+: 81 fa c9 00 03 10 cmp \$0x100300c9,%edx
41+[ ]*[a-f0-9]+: 81 ce c9 00 03 10 or \$0x100300c9,%esi
42+[ ]*[a-f0-9]+: 81 df c9 00 03 10 sbb \$0x100300c9,%edi
43+[ ]*[a-f0-9]+: 81 ed c9 00 03 10 sub \$0x100300c9,%ebp
44+[ ]*[a-f0-9]+: 41 81 f0 c9 00 03 10 xor \$0x100300c9,%r8d
45+[ ]*[a-f0-9]+: 41 f7 c7 c9 00 03 10 test \$0x100300c9,%r15d
46+[ ]*[a-f0-9]+: 48 81 d0 c9 00 03 10 adc \$0x100300c9,%rax
47+[ ]*[a-f0-9]+: 48 81 c3 c9 00 03 10 add \$0x100300c9,%rbx
48+[ ]*[a-f0-9]+: 48 81 e1 c9 00 03 10 and \$0x100300c9,%rcx
49+[ ]*[a-f0-9]+: 48 81 fa c9 00 03 10 cmp \$0x100300c9,%rdx
50+[ ]*[a-f0-9]+: 48 81 cf c9 00 03 10 or \$0x100300c9,%rdi
51+[ ]*[a-f0-9]+: 48 81 de c9 00 03 10 sbb \$0x100300c9,%rsi
52+[ ]*[a-f0-9]+: 48 81 ed c9 00 03 10 sub \$0x100300c9,%rbp
53+[ ]*[a-f0-9]+: 49 81 f0 c9 00 03 10 xor \$0x100300c9,%r8
54+[ ]*[a-f0-9]+: 49 f7 c7 c9 00 03 10 test \$0x100300c9,%r15
55+#pass
--- a/ld/testsuite/ld-x86-64/load1a.d
+++ b/ld/testsuite/ld-x86-64/load1a.d
@@ -2,6 +2,7 @@
22 #as: --64
33 #ld: -melf_x86_64
44 #objdump: -dw --sym
5+#notarget: x86_64-*-nacl*
56
67 .*: +file format .*
78
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/load1b-nacl.d
@@ -0,0 +1,55 @@
1+#source: load1.s
2+#as: --x32
3+#ld: -melf32_x86_64
4+#objdump: -dw --sym
5+#target: x86_64-*-nacl*
6+
7+.*: +file format .*
8+
9+SYMBOL TABLE:
10+#...
11+1003008c l O .data 0+1 bar
12+#...
13+1003008d g O .data 0+1 foo
14+#...
15+
16+Disassembly of section .text:
17+
18+0+20000 <_start>:
19+[ ]*[a-f0-9]+: 81 d0 8c 00 03 10 adc \$0x1003008c,%eax
20+[ ]*[a-f0-9]+: 81 c3 8c 00 03 10 add \$0x1003008c,%ebx
21+[ ]*[a-f0-9]+: 81 e1 8c 00 03 10 and \$0x1003008c,%ecx
22+[ ]*[a-f0-9]+: 81 fa 8c 00 03 10 cmp \$0x1003008c,%edx
23+[ ]*[a-f0-9]+: 81 ce 8c 00 03 10 or \$0x1003008c,%esi
24+[ ]*[a-f0-9]+: 81 df 8c 00 03 10 sbb \$0x1003008c,%edi
25+[ ]*[a-f0-9]+: 81 ed 8c 00 03 10 sub \$0x1003008c,%ebp
26+[ ]*[a-f0-9]+: 41 81 f0 8c 00 03 10 xor \$0x1003008c,%r8d
27+[ ]*[a-f0-9]+: 41 f7 c7 8c 00 03 10 test \$0x1003008c,%r15d
28+[ ]*[a-f0-9]+: 48 81 d0 8c 00 03 10 adc \$0x1003008c,%rax
29+[ ]*[a-f0-9]+: 48 81 c3 8c 00 03 10 add \$0x1003008c,%rbx
30+[ ]*[a-f0-9]+: 48 81 e1 8c 00 03 10 and \$0x1003008c,%rcx
31+[ ]*[a-f0-9]+: 48 81 fa 8c 00 03 10 cmp \$0x1003008c,%rdx
32+[ ]*[a-f0-9]+: 48 81 cf 8c 00 03 10 or \$0x1003008c,%rdi
33+[ ]*[a-f0-9]+: 48 81 de 8c 00 03 10 sbb \$0x1003008c,%rsi
34+[ ]*[a-f0-9]+: 48 81 ed 8c 00 03 10 sub \$0x1003008c,%rbp
35+[ ]*[a-f0-9]+: 49 81 f0 8c 00 03 10 xor \$0x1003008c,%r8
36+[ ]*[a-f0-9]+: 49 f7 c7 8c 00 03 10 test \$0x1003008c,%r15
37+[ ]*[a-f0-9]+: 81 d0 8d 00 03 10 adc \$0x1003008d,%eax
38+[ ]*[a-f0-9]+: 81 c3 8d 00 03 10 add \$0x1003008d,%ebx
39+[ ]*[a-f0-9]+: 81 e1 8d 00 03 10 and \$0x1003008d,%ecx
40+[ ]*[a-f0-9]+: 81 fa 8d 00 03 10 cmp \$0x1003008d,%edx
41+[ ]*[a-f0-9]+: 81 ce 8d 00 03 10 or \$0x1003008d,%esi
42+[ ]*[a-f0-9]+: 81 df 8d 00 03 10 sbb \$0x1003008d,%edi
43+[ ]*[a-f0-9]+: 81 ed 8d 00 03 10 sub \$0x1003008d,%ebp
44+[ ]*[a-f0-9]+: 41 81 f0 8d 00 03 10 xor \$0x1003008d,%r8d
45+[ ]*[a-f0-9]+: 41 f7 c7 8d 00 03 10 test \$0x1003008d,%r15d
46+[ ]*[a-f0-9]+: 48 81 d0 8d 00 03 10 adc \$0x1003008d,%rax
47+[ ]*[a-f0-9]+: 48 81 c3 8d 00 03 10 add \$0x1003008d,%rbx
48+[ ]*[a-f0-9]+: 48 81 e1 8d 00 03 10 and \$0x1003008d,%rcx
49+[ ]*[a-f0-9]+: 48 81 fa 8d 00 03 10 cmp \$0x1003008d,%rdx
50+[ ]*[a-f0-9]+: 48 81 cf 8d 00 03 10 or \$0x1003008d,%rdi
51+[ ]*[a-f0-9]+: 48 81 de 8d 00 03 10 sbb \$0x1003008d,%rsi
52+[ ]*[a-f0-9]+: 48 81 ed 8d 00 03 10 sub \$0x1003008d,%rbp
53+[ ]*[a-f0-9]+: 49 81 f0 8d 00 03 10 xor \$0x1003008d,%r8
54+[ ]*[a-f0-9]+: 49 f7 c7 8d 00 03 10 test \$0x1003008d,%r15
55+#pass
--- a/ld/testsuite/ld-x86-64/load1b.d
+++ b/ld/testsuite/ld-x86-64/load1b.d
@@ -2,6 +2,7 @@
22 #as: --x32
33 #ld: -melf32_x86_64
44 #objdump: -dw --sym
5+#notarget: x86_64-*-nacl*
56
67 .*: +file format .*
78
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/load1c-nacl.d
@@ -0,0 +1,48 @@
1+#source: load1.s
2+#as: --64
3+#ld: -shared -melf_x86_64
4+#objdump: -dw
5+#target: x86_64-*-nacl*
6+
7+.*: +file format .*
8+
9+Disassembly of section .text:
10+
11+0+ <_start>:
12+[ ]*[a-f0-9]+: 13 05 22 03 01 10 adc 0x10010322\(%rip\),%eax # 10010328 <_DYNAMIC\+0xe0>
13+[ ]*[a-f0-9]+: 03 1d 1c 03 01 10 add 0x1001031c\(%rip\),%ebx # 10010328 <_DYNAMIC\+0xe0>
14+[ ]*[a-f0-9]+: 23 0d 16 03 01 10 and 0x10010316\(%rip\),%ecx # 10010328 <_DYNAMIC\+0xe0>
15+[ ]*[a-f0-9]+: 3b 15 10 03 01 10 cmp 0x10010310\(%rip\),%edx # 10010328 <_DYNAMIC\+0xe0>
16+[ ]*[a-f0-9]+: 0b 35 0a 03 01 10 or 0x1001030a\(%rip\),%esi # 10010328 <_DYNAMIC\+0xe0>
17+[ ]*[a-f0-9]+: 1b 3d 04 03 01 10 sbb 0x10010304\(%rip\),%edi # 10010328 <_DYNAMIC\+0xe0>
18+[ ]*[a-f0-9]+: 2b 2d fe 02 01 10 sub 0x100102fe\(%rip\),%ebp # 10010328 <_DYNAMIC\+0xe0>
19+[ ]*[a-f0-9]+: 44 33 05 f7 02 01 10 xor 0x100102f7\(%rip\),%r8d # 10010328 <_DYNAMIC\+0xe0>
20+[ ]*[a-f0-9]+: 44 85 3d f0 02 01 10 test %r15d,0x100102f0\(%rip\) # 10010328 <_DYNAMIC\+0xe0>
21+[ ]*[a-f0-9]+: 48 13 05 e9 02 01 10 adc 0x100102e9\(%rip\),%rax # 10010328 <_DYNAMIC\+0xe0>
22+[ ]*[a-f0-9]+: 48 03 1d e2 02 01 10 add 0x100102e2\(%rip\),%rbx # 10010328 <_DYNAMIC\+0xe0>
23+[ ]*[a-f0-9]+: 48 23 0d db 02 01 10 and 0x100102db\(%rip\),%rcx # 10010328 <_DYNAMIC\+0xe0>
24+[ ]*[a-f0-9]+: 48 3b 15 d4 02 01 10 cmp 0x100102d4\(%rip\),%rdx # 10010328 <_DYNAMIC\+0xe0>
25+[ ]*[a-f0-9]+: 48 0b 3d cd 02 01 10 or 0x100102cd\(%rip\),%rdi # 10010328 <_DYNAMIC\+0xe0>
26+[ ]*[a-f0-9]+: 48 1b 35 c6 02 01 10 sbb 0x100102c6\(%rip\),%rsi # 10010328 <_DYNAMIC\+0xe0>
27+[ ]*[a-f0-9]+: 48 2b 2d bf 02 01 10 sub 0x100102bf\(%rip\),%rbp # 10010328 <_DYNAMIC\+0xe0>
28+[ ]*[a-f0-9]+: 4c 33 05 b8 02 01 10 xor 0x100102b8\(%rip\),%r8 # 10010328 <_DYNAMIC\+0xe0>
29+[ ]*[a-f0-9]+: 4c 85 3d b1 02 01 10 test %r15,0x100102b1\(%rip\) # 10010328 <_DYNAMIC\+0xe0>
30+[ ]*[a-f0-9]+: 13 05 b3 02 01 10 adc 0x100102b3\(%rip\),%eax # 10010330 <_DYNAMIC\+0xe8>
31+[ ]*[a-f0-9]+: 03 1d ad 02 01 10 add 0x100102ad\(%rip\),%ebx # 10010330 <_DYNAMIC\+0xe8>
32+[ ]*[a-f0-9]+: 23 0d a7 02 01 10 and 0x100102a7\(%rip\),%ecx # 10010330 <_DYNAMIC\+0xe8>
33+[ ]*[a-f0-9]+: 3b 15 a1 02 01 10 cmp 0x100102a1\(%rip\),%edx # 10010330 <_DYNAMIC\+0xe8>
34+[ ]*[a-f0-9]+: 0b 35 9b 02 01 10 or 0x1001029b\(%rip\),%esi # 10010330 <_DYNAMIC\+0xe8>
35+[ ]*[a-f0-9]+: 1b 3d 95 02 01 10 sbb 0x10010295\(%rip\),%edi # 10010330 <_DYNAMIC\+0xe8>
36+[ ]*[a-f0-9]+: 2b 2d 8f 02 01 10 sub 0x1001028f\(%rip\),%ebp # 10010330 <_DYNAMIC\+0xe8>
37+[ ]*[a-f0-9]+: 44 33 05 88 02 01 10 xor 0x10010288\(%rip\),%r8d # 10010330 <_DYNAMIC\+0xe8>
38+[ ]*[a-f0-9]+: 44 85 3d 81 02 01 10 test %r15d,0x10010281\(%rip\) # 10010330 <_DYNAMIC\+0xe8>
39+[ ]*[a-f0-9]+: 48 13 05 7a 02 01 10 adc 0x1001027a\(%rip\),%rax # 10010330 <_DYNAMIC\+0xe8>
40+[ ]*[a-f0-9]+: 48 03 1d 73 02 01 10 add 0x10010273\(%rip\),%rbx # 10010330 <_DYNAMIC\+0xe8>
41+[ ]*[a-f0-9]+: 48 23 0d 6c 02 01 10 and 0x1001026c\(%rip\),%rcx # 10010330 <_DYNAMIC\+0xe8>
42+[ ]*[a-f0-9]+: 48 3b 15 65 02 01 10 cmp 0x10010265\(%rip\),%rdx # 10010330 <_DYNAMIC\+0xe8>
43+[ ]*[a-f0-9]+: 48 0b 3d 5e 02 01 10 or 0x1001025e\(%rip\),%rdi # 10010330 <_DYNAMIC\+0xe8>
44+[ ]*[a-f0-9]+: 48 1b 35 57 02 01 10 sbb 0x10010257\(%rip\),%rsi # 10010330 <_DYNAMIC\+0xe8>
45+[ ]*[a-f0-9]+: 48 2b 2d 50 02 01 10 sub 0x10010250\(%rip\),%rbp # 10010330 <_DYNAMIC\+0xe8>
46+[ ]*[a-f0-9]+: 4c 33 05 49 02 01 10 xor 0x10010249\(%rip\),%r8 # 10010330 <_DYNAMIC\+0xe8>
47+[ ]*[a-f0-9]+: 4c 85 3d 42 02 01 10 test %r15,0x10010242\(%rip\) # 10010330 <_DYNAMIC\+0xe8>
48+#pass
--- a/ld/testsuite/ld-x86-64/load1c.d
+++ b/ld/testsuite/ld-x86-64/load1c.d
@@ -2,6 +2,7 @@
22 #as: --64
33 #ld: -shared -melf_x86_64
44 #objdump: -dw
5+#notarget: x86_64-*-nacl*
56
67 .*: +file format .*
78
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/load1d-nacl.d
@@ -0,0 +1,48 @@
1+#source: load1.s
2+#as: --x32
3+#ld: -shared -melf32_x86_64
4+#objdump: -dw
5+#target: x86_64-*-nacl*
6+
7+.*: +file format .*
8+
9+Disassembly of section .text:
10+
11+0+ <_start>:
12+[ ]*[a-f0-9]+: 13 05 fa 01 01 10 adc 0x100101fa\(%rip\),%eax # 10010200 <_DYNAMIC\+0x70>
13+[ ]*[a-f0-9]+: 03 1d f4 01 01 10 add 0x100101f4\(%rip\),%ebx # 10010200 <_DYNAMIC\+0x70>
14+[ ]*[a-f0-9]+: 23 0d ee 01 01 10 and 0x100101ee\(%rip\),%ecx # 10010200 <_DYNAMIC\+0x70>
15+[ ]*[a-f0-9]+: 3b 15 e8 01 01 10 cmp 0x100101e8\(%rip\),%edx # 10010200 <_DYNAMIC\+0x70>
16+[ ]*[a-f0-9]+: 0b 35 e2 01 01 10 or 0x100101e2\(%rip\),%esi # 10010200 <_DYNAMIC\+0x70>
17+[ ]*[a-f0-9]+: 1b 3d dc 01 01 10 sbb 0x100101dc\(%rip\),%edi # 10010200 <_DYNAMIC\+0x70>
18+[ ]*[a-f0-9]+: 2b 2d d6 01 01 10 sub 0x100101d6\(%rip\),%ebp # 10010200 <_DYNAMIC\+0x70>
19+[ ]*[a-f0-9]+: 44 33 05 cf 01 01 10 xor 0x100101cf\(%rip\),%r8d # 10010200 <_DYNAMIC\+0x70>
20+[ ]*[a-f0-9]+: 44 85 3d c8 01 01 10 test %r15d,0x100101c8\(%rip\) # 10010200 <_DYNAMIC\+0x70>
21+[ ]*[a-f0-9]+: 48 13 05 c1 01 01 10 adc 0x100101c1\(%rip\),%rax # 10010200 <_DYNAMIC\+0x70>
22+[ ]*[a-f0-9]+: 48 03 1d ba 01 01 10 add 0x100101ba\(%rip\),%rbx # 10010200 <_DYNAMIC\+0x70>
23+[ ]*[a-f0-9]+: 48 23 0d b3 01 01 10 and 0x100101b3\(%rip\),%rcx # 10010200 <_DYNAMIC\+0x70>
24+[ ]*[a-f0-9]+: 48 3b 15 ac 01 01 10 cmp 0x100101ac\(%rip\),%rdx # 10010200 <_DYNAMIC\+0x70>
25+[ ]*[a-f0-9]+: 48 0b 3d a5 01 01 10 or 0x100101a5\(%rip\),%rdi # 10010200 <_DYNAMIC\+0x70>
26+[ ]*[a-f0-9]+: 48 1b 35 9e 01 01 10 sbb 0x1001019e\(%rip\),%rsi # 10010200 <_DYNAMIC\+0x70>
27+[ ]*[a-f0-9]+: 48 2b 2d 97 01 01 10 sub 0x10010197\(%rip\),%rbp # 10010200 <_DYNAMIC\+0x70>
28+[ ]*[a-f0-9]+: 4c 33 05 90 01 01 10 xor 0x10010190\(%rip\),%r8 # 10010200 <_DYNAMIC\+0x70>
29+[ ]*[a-f0-9]+: 4c 85 3d 89 01 01 10 test %r15,0x10010189\(%rip\) # 10010200 <_DYNAMIC\+0x70>
30+[ ]*[a-f0-9]+: 13 05 8b 01 01 10 adc 0x1001018b\(%rip\),%eax # 10010208 <_DYNAMIC\+0x78>
31+[ ]*[a-f0-9]+: 03 1d 85 01 01 10 add 0x10010185\(%rip\),%ebx # 10010208 <_DYNAMIC\+0x78>
32+[ ]*[a-f0-9]+: 23 0d 7f 01 01 10 and 0x1001017f\(%rip\),%ecx # 10010208 <_DYNAMIC\+0x78>
33+[ ]*[a-f0-9]+: 3b 15 79 01 01 10 cmp 0x10010179\(%rip\),%edx # 10010208 <_DYNAMIC\+0x78>
34+[ ]*[a-f0-9]+: 0b 35 73 01 01 10 or 0x10010173\(%rip\),%esi # 10010208 <_DYNAMIC\+0x78>
35+[ ]*[a-f0-9]+: 1b 3d 6d 01 01 10 sbb 0x1001016d\(%rip\),%edi # 10010208 <_DYNAMIC\+0x78>
36+[ ]*[a-f0-9]+: 2b 2d 67 01 01 10 sub 0x10010167\(%rip\),%ebp # 10010208 <_DYNAMIC\+0x78>
37+[ ]*[a-f0-9]+: 44 33 05 60 01 01 10 xor 0x10010160\(%rip\),%r8d # 10010208 <_DYNAMIC\+0x78>
38+[ ]*[a-f0-9]+: 44 85 3d 59 01 01 10 test %r15d,0x10010159\(%rip\) # 10010208 <_DYNAMIC\+0x78>
39+[ ]*[a-f0-9]+: 48 13 05 52 01 01 10 adc 0x10010152\(%rip\),%rax # 10010208 <_DYNAMIC\+0x78>
40+[ ]*[a-f0-9]+: 48 03 1d 4b 01 01 10 add 0x1001014b\(%rip\),%rbx # 10010208 <_DYNAMIC\+0x78>
41+[ ]*[a-f0-9]+: 48 23 0d 44 01 01 10 and 0x10010144\(%rip\),%rcx # 10010208 <_DYNAMIC\+0x78>
42+[ ]*[a-f0-9]+: 48 3b 15 3d 01 01 10 cmp 0x1001013d\(%rip\),%rdx # 10010208 <_DYNAMIC\+0x78>
43+[ ]*[a-f0-9]+: 48 0b 3d 36 01 01 10 or 0x10010136\(%rip\),%rdi # 10010208 <_DYNAMIC\+0x78>
44+[ ]*[a-f0-9]+: 48 1b 35 2f 01 01 10 sbb 0x1001012f\(%rip\),%rsi # 10010208 <_DYNAMIC\+0x78>
45+[ ]*[a-f0-9]+: 48 2b 2d 28 01 01 10 sub 0x10010128\(%rip\),%rbp # 10010208 <_DYNAMIC\+0x78>
46+[ ]*[a-f0-9]+: 4c 33 05 21 01 01 10 xor 0x10010121\(%rip\),%r8 # 10010208 <_DYNAMIC\+0x78>
47+[ ]*[a-f0-9]+: 4c 85 3d 1a 01 01 10 test %r15,0x1001011a\(%rip\) # 10010208 <_DYNAMIC\+0x78>
48+#pass
--- a/ld/testsuite/ld-x86-64/load1d.d
+++ b/ld/testsuite/ld-x86-64/load1d.d
@@ -2,6 +2,7 @@
22 #as: --x32
33 #ld: -shared -melf32_x86_64
44 #objdump: -dw
5+#notarget: x86_64-*-nacl*
56
67 .*: +file format .*
78
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -325,6 +325,19 @@ run_dump_test "load1a"
325325 run_dump_test "load1b"
326326 run_dump_test "load1c"
327327 run_dump_test "load1d"
328+run_dump_test "load1a-nacl"
329+run_dump_test "load1b-nacl"
330+run_dump_test "load1c-nacl"
331+run_dump_test "load1d-nacl"
332+run_dump_test "call1a"
333+run_dump_test "call1b"
334+run_dump_test "call1c"
335+run_dump_test "call1d"
336+run_dump_test "call1e"
337+run_dump_test "call1f"
338+run_dump_test "call1g"
339+run_dump_test "call1h"
340+run_dump_test "call1i"
328341 run_dump_test "pr17935-1"
329342 run_dump_test "pr17935-2"
330343 run_dump_test "pr18160"