diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2012-10-18 00:54:13 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2012-10-18 00:54:13 +0000 |
commit | 3f87f497abcfedd91fbaf9854614cbba4abebe7a (patch) | |
tree | fa6c4439f226fee2e49d00fcb21096b2429a113a /gnu/usr.bin/binutils/opcodes/i386-dis.c | |
parent | 3d005fea62b6604db1aca053d8c0a73bafb8c987 (diff) |
Add support for stac/clac instructions to manipulate the flag
that controls the behaviour of Intel's Supervisor Mode Access Prevention
(SMAP) feature.
'looks correct' miod@ ok deraadt@
Diffstat (limited to 'gnu/usr.bin/binutils/opcodes/i386-dis.c')
-rw-r--r-- | gnu/usr.bin/binutils/opcodes/i386-dis.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/usr.bin/binutils/opcodes/i386-dis.c b/gnu/usr.bin/binutils/opcodes/i386-dis.c index cb52199b519..f33929fd8f8 100644 --- a/gnu/usr.bin/binutils/opcodes/i386-dis.c +++ b/gnu/usr.bin/binutils/opcodes/i386-dis.c @@ -4148,7 +4148,7 @@ SIMD_Fixup (int extrachar, int sizeflag ATTRIBUTE_UNUSED) static void PNI_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag) { - if (mod == 3 && reg == 1) + if (mod == 3 && reg == 1 && rm <= 1) { char *p = obuf + strlen (obuf); @@ -4166,6 +4166,16 @@ PNI_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag) codep++; } + else if (mod == 3 && reg == 1 && rm <= 3) + { + size_t olen = strlen (obuf); + char *p = obuf + olen - 4; + if (*codep == 0xca) + strcpy (p, "clac"); + else if (*codep == 0xcb) + strcpy (p, "stac"); + codep++; + } else OP_E (0, sizeflag); } |