[PATCH 2/6] x86/MPX: fix address size handling
Jan Beulich
JBeulich@suse.com
Tue Oct 8 14:41:00 GMT 2013
While address overrides are ignored in 64-bit mode (and hence shouldn't
result in an error), trying to use 16-bit addressing is documented to
result in #UD, and hence the assembler should reject the attempt.
gas/
2013-10-08 Jan Beulich <jbeulich@suse.com>
* tc-i386.c (md_assemble): Alter address size checking for MPX
instructions.
--- 2013-10-07/gas/config/tc-i386.c
+++ 2013-10-07/gas/config/tc-i386.c
@@ -3549,10 +3549,15 @@ md_assemble (char *line)
if (i.bnd_prefix && !i.tm.opcode_modifier.bndprefixok)
as_bad (_("expecting valid branch instruction after `bnd'"));
- if (i.tm.cpu_flags.bitfield.cpumpx
- && flag_code == CODE_64BIT
- && i.prefix[ADDR_PREFIX])
- as_bad (_("32-bit address isn't allowed in 64-bit MPX instructions."));
+ if (i.tm.cpu_flags.bitfield.cpumpx)
+ {
+ if (flag_code == CODE_64BIT && i.prefix[ADDR_PREFIX])
+ as_warn (_("32-bit addressing is ignored in 64-bit MPX instructions"));
+ else if (flag_code != CODE_16BIT
+ ? i.prefix[ADDR_PREFIX]
+ : i.mem_operands && !i.prefix[ADDR_PREFIX])
+ as_bad (_("16-bit addressing isn't allowed in MPX instructions"));
+ }
/* Insert BND prefix. */
if (add_bnd_prefix
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: binutils-mainline-x86-MPX-address-size.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20131008/c5a436d5/attachment.ksh>
More information about the Binutils
mailing list