diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2019-04-26 10:19:53 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2019-04-26 10:19:53 -0700 |
commit | 7cb22ff84745da0856bf74578b9bd7dff4379ed5 (patch) | |
tree | dfabab348a1df3900215b53045792e1a7f827cd0 /gas/config/tc-i386.c | |
parent | c54f15248ee990df6cea0b4730cd61b227a0e082 (diff) | |
download | fsf-binutils-gdb-7cb22ff84745da0856bf74578b9bd7dff4379ed5.zip fsf-binutils-gdb-7cb22ff84745da0856bf74578b9bd7dff4379ed5.tar.gz fsf-binutils-gdb-7cb22ff84745da0856bf74578b9bd7dff4379ed5.tar.bz2 |
i386: Don't add 0x66 prefix to IRET for .code16gcc
The .code16gcc directive supports 16bit mode with 32-bit address. Since
IRET (opcode 0xcf) in 16bit mode returns from an interrupt in 16bit mode,
we shouldn't add 0x66 prefix for IRET.
PR gas/24485
* config/tc-i386.c (process_suffix): Don't add DATA_PREFIX_OPCODE
to IRET for .code16gcc.
* testsuite/gas/i386/jump16.s: Add IRET tests.
* testsuite/gas/i386/jump16.d: Updated.
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r-- | gas/config/tc-i386.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 5eb6c4c..032b1d3 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -6352,7 +6352,13 @@ process_suffix (void) if (!add_prefix (ADDR_PREFIX_OPCODE)) return 0; } + /* stackop_size is set to LONG_MNEM_SUFFIX for the .code16gcc + directive to support 16bit mode with 32-bit address. Since + IRET (opcode 0xcf) in 16bit mode returns from an interrupt + in 16bit mode, we shouldn't add DATA_PREFIX_OPCODE here. */ else if (i.suffix != QWORD_MNEM_SUFFIX + && (stackop_size != LONG_MNEM_SUFFIX + || i.tm.base_opcode != 0xcf) && !i.tm.opcode_modifier.ignoresize && !i.tm.opcode_modifier.floatmf && !i.tm.opcode_modifier.vex |