aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2020-03-06 08:50:56 +0100
committerJan Beulich <jbeulich@suse.com>2020-03-06 08:50:56 +0100
commita23b33b3d131f240b2525d9a24831b33f2b43e26 (patch)
tree99add9964f55a4b6ed0acd13a14388b09537ed91 /opcodes
parenta04973848dc529f4eeb3bd198251da9faf01e2a2 (diff)
downloadgdb-a23b33b3d131f240b2525d9a24831b33f2b43e26.zip
gdb-a23b33b3d131f240b2525d9a24831b33f2b43e26.tar.gz
gdb-a23b33b3d131f240b2525d9a24831b33f2b43e26.tar.bz2
x86: correct MPX insn w/o base or index encoding in 16-bit mode
Since 16-bit addressing isn't allowed, Disp32 needs to be forced; Disp16 fails to match the templates. The SDM leaves open whether BNDC[LNU] with a GPR operand require an operand size override; this aspect is therefore left untouched here.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog6
-rw-r--r--opcodes/i386-dis.c17
2 files changed, 19 insertions, 4 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index eaf14b3..38f015d 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,11 @@
2020-03-06 Jan Beulich <jbeulich@suse.com>
+ * i386-dis.c (OP_E_memory): Exclude recording of used address
+ prefix for "bnd" modes only in 64-bit mode. Don't decode 16-bit
+ addressed memory operands for MPX insns.
+
+2020-03-06 Jan Beulich <jbeulich@suse.com>
+
* i386-opc.tbl (movmskps, mwait, vmread, vmwrite, invept,
invvpid, invpcid, rdfsbase, rdgsbase, wrfsbase, wrgsbase, adcx,
adox, mwaitx, rdpid, movdiri): Add IgnoreSize.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 734cfa6..9b20944 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -14272,10 +14272,11 @@ OP_E_memory (int bytemode, int sizeflag)
}
if ((havebase || haveindex || needindex || needaddr32 || riprel)
- && (bytemode != v_bnd_mode)
- && (bytemode != v_bndmk_mode)
- && (bytemode != bnd_mode)
- && (bytemode != bnd_swap_mode))
+ && (address_mode != mode_64bit
+ || ((bytemode != v_bnd_mode)
+ && (bytemode != v_bndmk_mode)
+ && (bytemode != bnd_mode)
+ && (bytemode != bnd_swap_mode))))
used_prefixes |= PREFIX_ADDR;
if (havedisp || (intel_syntax && riprel))
@@ -14356,6 +14357,14 @@ OP_E_memory (int bytemode, int sizeflag)
}
}
}
+ else if (bytemode == v_bnd_mode
+ || bytemode == v_bndmk_mode
+ || bytemode == bnd_mode
+ || bytemode == bnd_swap_mode)
+ {
+ oappend ("(bad)");
+ return;
+ }
else
{
/* 16 bit address mode */