diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-07-14 09:57:52 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-07-14 09:58:07 -0700 |
commit | 8e58ef803cf752cbde547a5064540f05470ea714 (patch) | |
tree | 9b809d30f1943d72b1a9d8c6c28dff2a3d1953aa /opcodes | |
parent | f63dcaf808b8e253e197446aeb318e49eddfd260 (diff) | |
download | gdb-8e58ef803cf752cbde547a5064540f05470ea714.zip gdb-8e58ef803cf752cbde547a5064540f05470ea714.tar.gz gdb-8e58ef803cf752cbde547a5064540f05470ea714.tar.bz2 |
x86-64: Zero-extend lower 32 bits displacement to 64 bits
Since the addr32 (0x67) prefix zero-extends the lower 32 bits address to
64 bits, change disassembler to zero-extend the lower 32 bits displacement
to 64 bits when there is no base nor index registers.
gas/
PR gas/26237
* testsuite/gas/i386/addr32.s: Add tests for 32-bit wrapped around
address.
* testsuite/gas/i386/x86-64-addr32.s: Likewise.
* testsuite/gas/i386/addr32.d: Updated.
* testsuite/gas/i386/x86-64-addr32-intel.d: Likewise.
* testsuite/gas/i386/x86-64-addr32.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-addr32-intel.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-addr32.d: Likewise.
opcodes/
PR gas/26237
* i386-dis.c (OP_E_memory): Without base nor index registers,
32-bit displacement to 64 bits.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 6 | ||||
-rw-r--r-- | opcodes/i386-dis.c | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index f571884..9a972d4 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2020-07-14 H.J. Lu <hongjiu.lu@intel.com> + + PR gas/26237 + * i386-dis.c (OP_E_memory): Without base nor index registers, + 32-bit displacement to 64 bits. + 2020-07-14 Claudiu Zissulescu <claziss@gmail.com> * arc-dis.c (print_insn_arc): Detect and emit a warning when a diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index a6cc013..511e632 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -11877,8 +11877,13 @@ OP_E_memory (int bytemode, int sizeflag) { if (address_mode == mode_64bit) { - /* Display eiz instead of addr32. */ - needindex = addr32flag; + if (addr32flag) + { + /* Without base nor index registers, zero-extend the + lower 32-bit displacement to 64 bits. */ + disp = (unsigned int) disp; + needindex = 1; + } needaddr32 = 1; } else |