diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-02-17 05:20:42 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-02-17 05:20:57 -0800 |
commit | 62a02d25b6e5d9f92c205260daa11355d0c62532 (patch) | |
tree | 9fa0855fa0acd81d5d855b01a865cdfb3456254a /gas/testsuite | |
parent | bb57c12e551e7b66db9d5d8623e2f294091f03c1 (diff) | |
download | gdb-62a02d25b6e5d9f92c205260daa11355d0c62532.zip gdb-62a02d25b6e5d9f92c205260daa11355d0c62532.tar.gz gdb-62a02d25b6e5d9f92c205260daa11355d0c62532.tar.bz2 |
Add .nop assembler directive
Implement the '.nop SIZE[, CONTROL]' assembler directive, which emits
SIZE bytes filled with no-op instructions. SIZE is absolute expression.
The optional CONTROL byte controls how no-op instructions should be
generated. If the comma and @var{control} are omitted, CONTROL is
assumed to be zero.
For Intel 80386 and AMD x86-64 targets, CONTROL byte specifies the size
limit of a single no-op instruction. The valid values of CONTROL byte
are between 0 and 8 for 16-bit mode, between 0 and 10 for 32-bit mode,
between 0 and 11 for 64-bit mode. When 0 is used, the no-op size limit
is set to the maximum supported size.
2 new relax states, rs_space_nop and rs_fill_nop, are added to enum
_relax_state, which are similar to rs_space and rs_fill, respectively,
but they fill with no-op instructions, instead of a single byte. A
target backend must override the default md_generate_nops to generate
proper no-op instructions. Otherwise, an error of unimplemented .nop
directive will be issued whenever .nop directive is used.
* NEWS: Mention .nop directive.
* as.h (_relax_state): Add rs_space_nop and rs_fill_nop.
* read.c (potable): Add .nop.
(s_nop): New function.
* read.h (s_nop): New prototype.
* write.c (cvt_frag_to_fill): Handle rs_space_nop and
rs_fill_nop.
(md_generate_nops): New function.
(relax_segment): Likewise.
(write_contents): Use md_generate_nops for rs_fill_nop.
* config/tc-i386.c (alt64_11): New.
(alt64_patt): Likewise.
(md_convert_frag): Handle rs_space_nop.
(i386_output_nops): New function.
(i386_generate_nops): Likewise.
(i386_align_code): Call i386_output_nops.
* config/tc-i386.h (i386_generate_nops): New.
(md_generate_nops): Likewise.
* doc/as.texinfo: Document .nop directive.
* testsuite/gas/i386/i386.exp: Run .nop directive tests.
* testsuite/gas/i386/nop-1.d: New file.
* testsuite/gas/i386/nop-1.s: Likewise.
* testsuite/gas/i386/nop-2.d: Likewise.
* testsuite/gas/i386/nop-2.s: Likewise.
* testsuite/gas/i386/nop-3.d: Likewise.
* testsuite/gas/i386/nop-3.s: Likewise.
* testsuite/gas/i386/nop-4.d: Likewise.
* testsuite/gas/i386/nop-4.s: Likewise.
* testsuite/gas/i386/nop-5.d: Likewise.
* testsuite/gas/i386/nop-5.s: Likewise.
* testsuite/gas/i386/nop-6.d: Likewise.
* testsuite/gas/i386/nop-6.s: Likewise.
* testsuite/gas/i386/nop-bad-1.l: Likewise.
* testsuite/gas/i386/nop-bad-1.s: Likewise.
* testsuite/gas/i386/x86-64-nop-1.d: Likewise.
* testsuite/gas/i386/x86-64-nop-2.d: Likewise.
* testsuite/gas/i386/x86-64-nop-3.d: Likewise.
* testsuite/gas/i386/x86-64-nop-4.d: Likewise.
* testsuite/gas/i386/x86-64-nop-5.d: Likewise.
* testsuite/gas/i386/x86-64-nop-6.d: Likewise.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/i386/i386.exp | 13 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-1.d | 31 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-1.s | 21 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-2.d | 40 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-2.s | 22 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-3.d | 20 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-3.s | 15 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-4.d | 23 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-4.s | 18 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-5.d | 25 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-5.s | 19 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-6.d | 17 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-6.s | 25 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-bad-1.l | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-bad-1.s | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-nop-1.d | 32 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-nop-2.d | 41 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-nop-3.d | 21 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-nop-4.d | 24 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-nop-5.d | 26 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-nop-6.d | 18 |
21 files changed, 459 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index a21ef84..0ca49ea 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -431,6 +431,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]] run_dump_test "align-1a" run_dump_test "align-1b" run_list_test "inval-pseudo" "-al" + run_dump_test "nop-1" + run_dump_test "nop-2" # These tests require support for 8 and 16 bit relocs, # so we only run them for ELF and COFF targets. @@ -494,6 +496,10 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]] run_dump_test "got-no-relax" run_dump_test "addend" + run_dump_test "nop-3" + run_dump_test "nop-4" + run_dump_test "nop-5" + run_dump_test "nop-6" if { [gas_64_check] } then { run_dump_test "att-regs" @@ -538,6 +544,7 @@ if [expr [istarget "i*86-*-*"] || [istarget "x86_64-*-*"]] then { run_list_test "space1" "-al" run_dump_test rept run_dump_test pr19498 + run_list_test "nop-bad-1" "" if [is_elf_format] then { run_list_test_stdin "list-1" "-al" run_list_test_stdin "list-2" "-al" @@ -904,6 +911,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t run_list_test "x86-64-notrackbad" "-al" run_dump_test "x86-64-movd" run_dump_test "x86-64-movd-intel" + run_dump_test "x86-64-nop-1" + run_dump_test "x86-64-nop-2" if { ![istarget "*-*-aix*"] && ![istarget "*-*-beos*"] @@ -961,6 +970,10 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t run_dump_test "x86-64-gotpcrel-no-relax" run_dump_test "x86-64-addend" + run_dump_test "x86-64-nop-3" + run_dump_test "x86-64-nop-4" + run_dump_test "x86-64-nop-5" + run_dump_test "x86-64-nop-6" } set ASFLAGS "$old_ASFLAGS" diff --git a/gas/testsuite/gas/i386/nop-1.d b/gas/testsuite/gas/i386/nop-1.d new file mode 100644 index 0000000..46422c8 --- /dev/null +++ b/gas/testsuite/gas/i386/nop-1.d @@ -0,0 +1,31 @@ +#objdump: -drw +#name: i386 .nop 1 + +.*: +file format .* + + +Disassembly of section .text: + +0+ <single>: + +[a-f0-9]+: 90 nop + +0+1 <pseudo_1>: + +[a-f0-9]+: 90 nop + +0+2 <pseudo_8>: + +[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl 0x0\(%eax,%eax,1\) + +0+a <pseudo_8_4>: + +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\) + +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\) + +0+12 <pseudo_20>: + +[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\) + +[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\) + +0+26 <pseudo_30>: + +[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\) + +[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\) + +[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\) + +[a-f0-9]+: 31 c0 xor %eax,%eax +#pass diff --git a/gas/testsuite/gas/i386/nop-1.s b/gas/testsuite/gas/i386/nop-1.s new file mode 100644 index 0000000..891783d --- /dev/null +++ b/gas/testsuite/gas/i386/nop-1.s @@ -0,0 +1,21 @@ + .text +single: + .nop 0 + nop + +pseudo_1: + .nop 1 + +pseudo_8: + .nop 8 + +pseudo_8_4: + .nop 8, 4 + +pseudo_20: + .nop 20 + +pseudo_30: + .nop 30 + + xor %eax, %eax diff --git a/gas/testsuite/gas/i386/nop-2.d b/gas/testsuite/gas/i386/nop-2.d new file mode 100644 index 0000000..332b990 --- /dev/null +++ b/gas/testsuite/gas/i386/nop-2.d @@ -0,0 +1,40 @@ +#objdump: -drw -Mi8086 +#name: i386 .nop 2 + +.*: +file format .* + + +Disassembly of section .text: + +0+ <single>: + +[a-f0-9]+: 90 nop + +0+1 <pseudo_1>: + +[a-f0-9]+: 90 nop + +0+2 <pseudo_8>: + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +0+a <pseudo_8_4>: + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +0+12 <pseudo_20>: + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +0+26 <pseudo_30>: + +[a-f0-9]+: 89 f6 mov %si,%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +[a-f0-9]+: 66 31 c0 xor %eax,%eax +#pass diff --git a/gas/testsuite/gas/i386/nop-2.s b/gas/testsuite/gas/i386/nop-2.s new file mode 100644 index 0000000..2b71b97 --- /dev/null +++ b/gas/testsuite/gas/i386/nop-2.s @@ -0,0 +1,22 @@ + .text + .code16 +single: + .nop 0 + nop + +pseudo_1: + .nop 1 + +pseudo_8: + .nop 8 + +pseudo_8_4: + .nop 8, 4 + +pseudo_20: + .nop 20 + +pseudo_30: + .nop 30 + + xor %eax, %eax diff --git a/gas/testsuite/gas/i386/nop-3.d b/gas/testsuite/gas/i386/nop-3.d new file mode 100644 index 0000000..bebd24b --- /dev/null +++ b/gas/testsuite/gas/i386/nop-3.d @@ -0,0 +1,20 @@ +#objdump: -drw +#name: i386 .nop 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 \(%eax\) + +[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 fc ff ff ff jmp 1 <.altinstr_replacement\+0x1> 1: (R_386_PC)?(DISP)?32 foo +#pass diff --git a/gas/testsuite/gas/i386/nop-3.s b/gas/testsuite/gas/i386/nop-3.s new file mode 100644 index 0000000..57370ff --- /dev/null +++ b/gas/testsuite/gas/i386/nop-3.s @@ -0,0 +1,15 @@ + .text +_start: + xor %eax, %eax +140: + testl %eax, %eax +141: + .nop -(((144f-143f)-(141b-140b)) > 0)*((144f-143f)-(141b-140b)),7 +142: + xor %eax, %eax + .pushsection .altinstr_replacement,"ax" +143: + jmp foo +144: + .popsection + xor %eax, %eax diff --git a/gas/testsuite/gas/i386/nop-4.d b/gas/testsuite/gas/i386/nop-4.d new file mode 100644 index 0000000..99ddcd3 --- /dev/null +++ b/gas/testsuite/gas/i386/nop-4.d @@ -0,0 +1,23 @@ +#objdump: -drw +#name: i386 .nop 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\(%eax,%eax,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 fc ff ff ff jmp 7 <.altinstr_replacement\+0x7> 7: (R_386_PC)?(DISP)?32 foo +#pass diff --git a/gas/testsuite/gas/i386/nop-4.s b/gas/testsuite/gas/i386/nop-4.s new file mode 100644 index 0000000..f7aa111 --- /dev/null +++ b/gas/testsuite/gas/i386/nop-4.s @@ -0,0 +1,18 @@ + .text +_start: + xor %eax, %eax +140: + testl %eax, %eax +141: + .nop -(((144f-143f)-(141b-140b)) > 0)*((144f-143f)-(141b-140b)) +142: + xor %eax, %eax + .pushsection .altinstr_replacement,"ax" +143: + mov %eax, %eax + mov %eax, %eax + mov %eax, %eax + jmp foo +144: + .popsection + xor %eax, %eax diff --git a/gas/testsuite/gas/i386/nop-5.d b/gas/testsuite/gas/i386/nop-5.d new file mode 100644 index 0000000..aab4258 --- /dev/null +++ b/gas/testsuite/gas/i386/nop-5.d @@ -0,0 +1,25 @@ +#objdump: -drw +#name: i386 .nop 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\(%eax,%eax,1\) + +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,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]+: 89 c0 mov %eax,%eax + +[a-f0-9]+: e9 fc ff ff ff jmp 9 <.altinstr_replacement\+0x9> 9: (R_386_PC)?(DISP)?32 foo +#pass diff --git a/gas/testsuite/gas/i386/nop-5.s b/gas/testsuite/gas/i386/nop-5.s new file mode 100644 index 0000000..4f563ce --- /dev/null +++ b/gas/testsuite/gas/i386/nop-5.s @@ -0,0 +1,19 @@ + .text +_start: + xor %eax, %eax +140: + testl %eax, %eax +141: + .nop -(((144f-143f)-(141b-140b)) > 0)*((144f-143f)-(141b-140b)),6 +142: + xor %eax, %eax + .pushsection .altinstr_replacement,"ax" +143: + mov %eax, %eax + mov %eax, %eax + mov %eax, %eax + mov %eax, %eax + jmp foo +144: + .popsection + xor %eax, %eax diff --git a/gas/testsuite/gas/i386/nop-6.d b/gas/testsuite/gas/i386/nop-6.d new file mode 100644 index 0000000..93ee8de --- /dev/null +++ b/gas/testsuite/gas/i386/nop-6.d @@ -0,0 +1,17 @@ +#objdump: -drw +#name: i386 .nop 6 + +.*: +file format .* + + +Disassembly of section .text: + +0+ <_start>: + +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\) + +Disassembly of section .altinstr_replacement: + +0+ <.altinstr_replacement>: + +[a-f0-9]+: 75 fe jne 0 <_start> + +[a-f0-9]+: 89 c4 mov %eax,%esp +#pass diff --git a/gas/testsuite/gas/i386/nop-6.s b/gas/testsuite/gas/i386/nop-6.s new file mode 100644 index 0000000..c7b1e2c --- /dev/null +++ b/gas/testsuite/gas/i386/nop-6.s @@ -0,0 +1,25 @@ +.macro mknops nr_bytes + .nop \nr_bytes, 9 +.endm + +.macro ALTERNATIVE +.L\@_orig_s: +.L\@_orig_e: + mknops (-(((.L\@_repl_e\()1 - .L\@_repl_s\()1) - (.L\@_orig_e - .L\@_orig_s)) > 0) * ((.L\@_repl_e\()1 - .L\@_repl_s\()1) - (.L\@_orig_e - .L\@_orig_s))) +.L\@_orig_p: + + .section .discard, "a", @progbits + .byte (.L\@_orig_p - .L\@_orig_s) + .byte 0xff + (.L\@_repl_e\()1 - .L\@_repl_s\()1) - (.L\@_orig_p - .L\@_orig_s) + + .section .altinstr_replacement, "ax", @progbits +.L\@_repl_s\()1: +.L\@_fill_rsb_loop: + jnz .L\@_fill_rsb_loop + mov %eax, %esp +.L\@_repl_e\()1: +.endm + + .text +_start: +ALTERNATIVE diff --git a/gas/testsuite/gas/i386/nop-bad-1.l b/gas/testsuite/gas/i386/nop-bad-1.l new file mode 100644 index 0000000..34be496 --- /dev/null +++ b/gas/testsuite/gas/i386/nop-bad-1.l @@ -0,0 +1,4 @@ +.*: Assembler messages: +.*:2: Warning: negative nop control byte, ignored +.*:4: Warning: \.space, \.nop or \.fill with negative value, ignored +.*:3: Error: invalide single nop size: 20 \(expect within \[0, [0-9]+\]\) diff --git a/gas/testsuite/gas/i386/nop-bad-1.s b/gas/testsuite/gas/i386/nop-bad-1.s new file mode 100644 index 0000000..53cc7d5 --- /dev/null +++ b/gas/testsuite/gas/i386/nop-bad-1.s @@ -0,0 +1,4 @@ + .text + .nop 100, -2 + .nop 100, 20 + .nop -1 diff --git a/gas/testsuite/gas/i386/x86-64-nop-1.d b/gas/testsuite/gas/i386/x86-64-nop-1.d new file mode 100644 index 0000000..f3edc7d --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-nop-1.d @@ -0,0 +1,32 @@ +#source: nop-1.s +#objdump: -drw +#name: x86-64 .nop 1 + +.*: +file format .* + + +Disassembly of section .text: + +0+ <single>: + +[a-f0-9]+: 90 nop + +0+1 <pseudo_1>: + +[a-f0-9]+: 90 nop + +0+2 <pseudo_8>: + +[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl 0x0\(%rax,%rax,1\) + +0+a <pseudo_8_4>: + +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\) + +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\) + +0+12 <pseudo_20>: + +[a-f0-9]+: 66 0f 1f 84 00 00 00 00 00 nopw 0x0\(%rax,%rax,1\) + +[a-f0-9]+: 67 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\) + +0+26 <pseudo_30>: + +[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl 0x0\(%rax,%rax,1\) + +[a-f0-9]+: 67 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\) + +[a-f0-9]+: 67 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\) + +[a-f0-9]+: 31 c0 xor %eax,%eax +#pass diff --git a/gas/testsuite/gas/i386/x86-64-nop-2.d b/gas/testsuite/gas/i386/x86-64-nop-2.d new file mode 100644 index 0000000..e894d2c --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-nop-2.d @@ -0,0 +1,41 @@ +#source: nop-2.s +#objdump: -drw -Mi8086 +#name: x86-64 .nop 2 + +.*: +file format .* + + +Disassembly of section .text: + +0+ <single>: + +[a-f0-9]+: 90 nop + +0+1 <pseudo_1>: + +[a-f0-9]+: 90 nop + +0+2 <pseudo_8>: + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +0+a <pseudo_8_4>: + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +0+12 <pseudo_20>: + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +0+26 <pseudo_30>: + +[a-f0-9]+: 89 f6 mov %si,%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si + +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di + +[a-f0-9]+: 66 31 c0 xor %eax,%eax +#pass diff --git a/gas/testsuite/gas/i386/x86-64-nop-3.d b/gas/testsuite/gas/i386/x86-64-nop-3.d new file mode 100644 index 0000000..b43239a --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-nop-3.d @@ -0,0 +1,21 @@ +#source: nop-3.s +#objdump: -drw +#name: x86-64 .nop 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_PLT32 foo-0x4 +#pass diff --git a/gas/testsuite/gas/i386/x86-64-nop-4.d b/gas/testsuite/gas/i386/x86-64-nop-4.d new file mode 100644 index 0000000..a910171 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-nop-4.d @@ -0,0 +1,24 @@ +#source: nop-4.s +#objdump: -drw +#name: x86-64 .nop 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_PLT32 foo-0x4 +#pass diff --git a/gas/testsuite/gas/i386/x86-64-nop-5.d b/gas/testsuite/gas/i386/x86-64-nop-5.d new file mode 100644 index 0000000..57493cf --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-nop-5.d @@ -0,0 +1,26 @@ +#source: nop-5.s +#objdump: -drw +#name: x86-64 .nop 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]+: 66 0f 1f 44 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]+: 89 c0 mov %eax,%eax + +[a-f0-9]+: e9 00 00 00 00 jmpq d <_start\+0xd> 9: R_X86_64_PLT32 foo-0x4 +#pass diff --git a/gas/testsuite/gas/i386/x86-64-nop-6.d b/gas/testsuite/gas/i386/x86-64-nop-6.d new file mode 100644 index 0000000..520f590 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-nop-6.d @@ -0,0 +1,18 @@ +#source: nop-6.s +#objdump: -drw +#name: x86-64 .nop 6 + +.*: +file format .* + + +Disassembly of section .text: + +0+ <_start>: + +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\) + +Disassembly of section .altinstr_replacement: + +0+ <.altinstr_replacement>: + +[a-f0-9]+: 75 fe jne 0 <_start> + +[a-f0-9]+: 89 c4 mov %eax,%esp +#pass |