Index: llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp =================================================================== --- llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp +++ llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp @@ -492,6 +492,7 @@ insn->addressSize = (insn->hasAdSize ? 4 : 8); insn->displacementSize = 4; insn->immediateSize = 4; + insn->hasOpSize = false; } else { insn->registerSize = (insn->hasOpSize ? 2 : 4); insn->addressSize = (insn->hasAdSize ? 4 : 8); Index: llvm/test/MC/Disassembler/X86/x86-64.txt =================================================================== --- llvm/test/MC/Disassembler/X86/x86-64.txt +++ llvm/test/MC/Disassembler/X86/x86-64.txt @@ -329,8 +329,9 @@ # CHECK: callw 32767 0x66 0xe8 0xff 0x7f -# CHECK: callw 32767 -0x66 0x66 0x48 0xe8 0xff 0x7f +# TODO: Should display data16 prefixes. +# CHECK: callq 32767 +0x66 0x66 0x48 0xe8 0xff 0x7f 0x00 0x00 # CHECK: jmp -32769 0xe9 0xff 0x7f 0xff 0xff @@ -338,8 +339,9 @@ # CHECK: jmp 32767 0x66 0xe9 0xff 0x7f +# TODO: Should display data16 prefixes. # CHECK: jmp 32767 -0x66 0x66 0x48 0xe9 0xff 0x7f +0x66 0x66 0x48 0xe9 0xff 0x7f 0x00 0x00 # CHECK: jo -32769 0x0f 0x80 0xff 0x7f 0xff 0xff Index: llvm/test/tools/llvm-objdump/X86/disassemble-gdtls.s =================================================================== --- /dev/null +++ llvm/test/tools/llvm-objdump/X86/disassemble-gdtls.s @@ -0,0 +1,19 @@ +# RUN: llvm-mc %s -filetype=obj -triple=x86_64 | llvm-objdump -d - | FileCheck %s + +# CHECK: : +# TODO: Should display data16 prefixes. +# CHECK-NEXT: 0: 66 48 8d 3d 00 00 00 00 leaq (%rip), %rdi # 8 +# CHECK-NEXT: 8: 66 66 48 e8 00 00 00 00 callq 0x10 +# CHECK-EMPTY: + +PR48901: + data16 + leaq bar@TLSGD(%rip),%rdi + data16 + data16 + rex64 + callq __tls_get_addr@PLT + +.section .tdata,"awT",@progbits +bar: +.long 42