summaryrefslogtreecommitdiffstats
path: root/libcpu/i386_disasm.c
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2008-12-31 10:21:51 -0800
committerUlrich Drepper <[email protected]>2008-12-31 10:21:51 -0800
commit54a6d4b1b6828519ea707f2ce4d8c1829c9fe595 (patch)
treeaa59bd9fb4fdde90c792e5f5527f839fdb210947 /libcpu/i386_disasm.c
parent98c245eb57b7a95b8673031cb8562b36716a04f4 (diff)
Fix printing of rex prefix in x86-64 disassembler.
Diffstat (limited to 'libcpu/i386_disasm.c')
-rw-r--r--libcpu/i386_disasm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
index 9961e4d9..b99748b6 100644
--- a/libcpu/i386_disasm.c
+++ b/libcpu/i386_disasm.c
@@ -520,6 +520,23 @@ i386_disasm (const uint8_t **startp, const uint8_t *end, GElf_Addr addr,
case prefix_lock:
ADD_STRING ("lock");
break;
+#ifdef X86_64
+ case 0x40 ... 0x4f:
+ ADD_STRING ("rex");
+ if (byte != 0x40)
+ {
+ ADD_CHAR ('.');
+ if (byte & 0x8)
+ ADD_CHAR ('w');
+ if (byte & 0x4)
+ ADD_CHAR ('r');
+ if (byte & 0x3)
+ ADD_CHAR ('x');
+ if (byte & 0x1)
+ ADD_CHAR ('b');
+ }
+ break;
+#endif
default:
/* Cannot happen. */
puts ("unknown prefix");