diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2014-05-09 10:58:00 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2014-05-09 10:58:00 -0700 |
commit | df18fdba5dc9243d657c6e26a3a4e2c65e62b8bd (patch) | |
tree | 168d1f3dbbd68600d570e4b23a0e76965e14aef3 /ld/testsuite | |
parent | 0c263177a5123186a05b44d3d76b7a3f811e70b9 (diff) | |
download | gdb-df18fdba5dc9243d657c6e26a3a4e2c65e62b8bd.zip gdb-df18fdba5dc9243d657c6e26a3a4e2c65e62b8bd.tar.gz gdb-df18fdba5dc9243d657c6e26a3a4e2c65e62b8bd.tar.bz2 |
Properly display extra data/address size prefixes
X86 disassembler checks data and address size prefixes when displaying
instruction mnemonic and operands. For the extra data and address size
prefixes, their names depend only on the address mode, not the data and
address size prefixes. This patch changes x86 disassembler not to check
the data and address size prefix when printing extra data and address size
prefixes.
gas/testsuite/
* gas/i386/nops-1-core2.d: Replace data32 with data16.
* gas/i386/nops-4a-i686.d: Likewise.
* gas/i386/nops-5-i686.d: Likewise.
* gas/i386/nops-5.d: Likewise.
* gas/i386/x86-64-cbw-intel.d: Likewise.
* gas/i386/x86-64-cbw.d: Likewise.
* gas/i386/x86-64-io-intel.d: Likewise.
* gas/i386/x86-64-io-suffix.d: Likewise.
* gas/i386/x86-64-io.d: Likewise.
* gas/i386/x86-64-nops-1-core2.d: Likewise.
* gas/i386/x86-64-nops-1-g64.d: Likewise.
* gas/i386/x86-64-nops-1-nocona.d: Likewise.
* gas/i386/x86-64-nops-1.d: Likewise.
* gas/i386/x86-64-nops-2.d: Likewise.
* gas/i386/x86-64-nops-3.d: Likewise.
* gas/i386/x86-64-nops-4-core2.d: Likewise.
* gas/i386/x86-64-nops-4.d: Likewise.
* gas/i386/x86-64-nops-5-k8.d: Likewise.
* gas/i386/x86-64-nops-5.d: Likewise.
* gas/i386/x86-64-stack-intel.d: Likewise.
* gas/i386/x86-64-stack-suffix.d: Likewise.
* gas/i386/x86-64-stack.d: Likewise.
* gas/i386/ilp32/x86-64-cbw-intel.d: Likewise.
* gas/i386/ilp32/x86-64-cbw.d: Likewise.
* gas/i386/ilp32/x86-64-io-intel.d: Likewise.
* gas/i386/ilp32/x86-64-io-suffix.d: Likewise.
* gas/i386/ilp32/x86-64-io.d: Likewise.
* gas/i386/ilp32/x86-64-nops-1-core2.d:
* gas/i386/ilp32/x86-64-nops-1-nocona.d: Likewise.
* gas/i386/ilp32/x86-64-nops-1.d: Likewise.
* gas/i386/ilp32/x86-64-nops-2.d: Likewise.
* gas/i386/ilp32/x86-64-nops-3.d: Likewise.
* gas/i386/ilp32/x86-64-nops-4-core2.d: Likewise.
* gas/i386/ilp32/x86-64-nops-4.d: Likewise.
* gas/i386/ilp32/x86-64-nops-5-k8.d: Likewise.
* gas/i386/ilp32/x86-64-nops-5.: Likewise.
* gas/i386/ilp32/x86-64-stack-intel.d: Likewise.
* gas/i386/ilp32/x86-64-stack-suffix.: Likewise.
* gas/i386/ilp32/x86-64-stack.d: Likewise.
ld/testsuite/
* ld-x86-64/tlsbin.dd: Replace data32 with data16.
* ld-x86-64/tlsdesc-nacl.pd: Likewise.
* ld-x86-64/tlsgdesc.dd: Likewise.
* ld-x86-64/tlsld1.dd: Likewise.
* ld-x86-64/tlsld3.dd: Likewise.
* ld-x86-64/tlspic.dd: Likewise.
opcodes/
2014-05-09 H.J. Lu <hongjiu.lu@intel.com>
* i386-dis.c (ADDR16_PREFIX): Removed.
(ADDR32_PREFIX): Likewise.
(DATA16_PREFIX): Likewise.
(DATA32_PREFIX): Likewise.
(prefix_name): Updated.
(print_insn): Simplify data and address size prefixes processing.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/plt-nacl.pd | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/tlsbin.dd | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/tlsdesc-nacl.pd | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/tlsgdesc.dd | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/tlsld1.dd | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/tlsld3.dd | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/tlspic.dd | 16 |
8 files changed, 35 insertions, 26 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 7564025..ed50efa 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2014-05-09 H.J. Lu <hongjiu.lu@intel.com> + + * ld-x86-64/tlsbin.dd: Replace data32 with data16. + * ld-x86-64/tlsdesc-nacl.pd: Likewise. + * ld-x86-64/tlsgdesc.dd: Likewise. + * ld-x86-64/tlsld1.dd: Likewise. + * ld-x86-64/tlsld3.dd: Likewise. + * ld-x86-64/tlspic.dd: Likewise. + 2014-05-02 Max Filippov <jcmvbkbc@gmail.com> * ld-xtensa/diff_overflow.exp, * ld-xtensa/diff_overflow1.s, diff --git a/ld/testsuite/ld-x86-64/plt-nacl.pd b/ld/testsuite/ld-x86-64/plt-nacl.pd index 2f5bab5..b17bf71 100644 --- a/ld/testsuite/ld-x86-64/plt-nacl.pd +++ b/ld/testsuite/ld-x86-64/plt-nacl.pd @@ -16,10 +16,10 @@ Disassembly of section .plt: +[0-9a-f]+: 41 ff e3 jmpq \*%r11 +[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/ld/testsuite/ld-x86-64/tlsbin.dd b/ld/testsuite/ld-x86-64/tlsbin.dd index a9b1227..c89e7ee 100644 --- a/ld/testsuite/ld-x86-64/tlsbin.dd +++ b/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/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd b/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd index 61e6049..e2ba398 100644 --- a/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd +++ b/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd @@ -17,10 +17,10 @@ Disassembly of section .plt: +[0-9a-f]+: 41 ff e3 jmpq \*%r11 +[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 @@ -33,10 +33,10 @@ Disassembly of section .plt: +[0-9a-f]+: 41 ff e3 jmpq \*%r11 +[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/ld/testsuite/ld-x86-64/tlsgdesc.dd b/ld/testsuite/ld-x86-64/tlsgdesc.dd index 635974c..85b219f 100644 --- a/ld/testsuite/ld-x86-64/tlsgdesc.dd +++ b/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/ld/testsuite/ld-x86-64/tlsld1.dd b/ld/testsuite/ld-x86-64/tlsld1.dd index e91ce08..ec7467a 100644 --- a/ld/testsuite/ld-x86-64/tlsld1.dd +++ b/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/ld/testsuite/ld-x86-64/tlsld3.dd b/ld/testsuite/ld-x86-64/tlsld3.dd index 0b639c6..f9c8de2 100644 --- a/ld/testsuite/ld-x86-64/tlsld3.dd +++ b/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/ld/testsuite/ld-x86-64/tlspic.dd b/ld/testsuite/ld-x86-64/tlspic.dd index 2f85586..26d83e9 100644 --- a/ld/testsuite/ld-x86-64/tlspic.dd +++ b/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 * |