Added a fix to LLVM that corrects PC-relative

branch address printing in the x86 disassembler.

<rdar://problem/11925357>

llvm-svn: 160588
This commit is contained in:
Sean Callanan 2012-07-20 22:47:19 +00:00
parent 20ea62527a
commit dff711ed75
1 changed files with 26 additions and 0 deletions

View File

@ -479,6 +479,32 @@ Index: lib/Target/ARM/Disassembler/ARMDisassembler.cpp
return MCDisassembler::Success;
}
Index: lib/Target/X86/Disassembler/X86Disassembler.cpp
===================================================================
--- lib/Target/X86/Disassembler/X86Disassembler.cpp (revision 152265)
+++ lib/Target/X86/Disassembler/X86Disassembler.cpp (working copy)
@@ -322,7 +322,12 @@
OperandType type = (OperandType)operand.type;
+ bool isBranch = false;
+ uint64_t pcrel = 0;
if (type == TYPE_RELv) {
+ isBranch = true;
+ pcrel = insn.startLocation +
+ insn.displacementOffset + insn.displacementSize;
switch (insn.displacementSize) {
default:
break;
@@ -373,8 +378,6 @@
}
}
- bool isBranch = false;
- uint64_t pcrel = 0;
switch (type) {
case TYPE_XMM128:
mcInst.addOperand(MCOperand::CreateReg(X86::XMM0 + (immediate >> 4)));
Index: lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
===================================================================
--- lib/Target/X86/Disassembler/X86DisassemblerDecoder.c (revision 152265)