aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog7
-rw-r--r--opcodes/i386-dis.c25
2 files changed, 27 insertions, 5 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index d00e549..b25132a 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,10 @@
+2020-11-14 Borislav Petkov <bp@suse.de>
+
+ * i386-dis.c (ckprefix): Do not assign active_seg_prefix in
+ 64-bit addressing mode.
+ (NOTRACK_Fixup): Test prefixes for PREFIX_DS, instead of
+ active_seg_prefix.
+
2020-11-11 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
* aarch64-tbl.h: Enable -march=armv8.6-a+ls64.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 9338b1f..58cf001 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -9141,22 +9141,34 @@ ckprefix (void)
case 0x2e:
prefixes |= PREFIX_CS;
last_seg_prefix = i;
- active_seg_prefix = PREFIX_CS;
+
+ if (address_mode != mode_64bit)
+ active_seg_prefix = PREFIX_CS;
+
break;
case 0x36:
prefixes |= PREFIX_SS;
last_seg_prefix = i;
- active_seg_prefix = PREFIX_SS;
+
+ if (address_mode != mode_64bit)
+ active_seg_prefix = PREFIX_SS;
+
break;
case 0x3e:
prefixes |= PREFIX_DS;
last_seg_prefix = i;
- active_seg_prefix = PREFIX_DS;
+
+ if (address_mode != mode_64bit)
+ active_seg_prefix = PREFIX_DS;
+
break;
case 0x26:
prefixes |= PREFIX_ES;
last_seg_prefix = i;
- active_seg_prefix = PREFIX_ES;
+
+ if (address_mode != mode_64bit)
+ active_seg_prefix = PREFIX_ES;
+
break;
case 0x64:
prefixes |= PREFIX_FS;
@@ -13656,7 +13668,10 @@ static void
NOTRACK_Fixup (int bytemode ATTRIBUTE_UNUSED,
int sizeflag ATTRIBUTE_UNUSED)
{
- if (active_seg_prefix == PREFIX_DS
+
+ /* Since active_seg_prefix is not set in 64-bit mode, check whether
+ we've seen a PREFIX_DS. */
+ if ((prefixes & PREFIX_DS) != 0
&& (address_mode != mode_64bit || last_data_prefix < 0))
{
/* NOTRACK prefix is only valid on indirect branch instructions.