Open 4B5F5F4B opened 4 years ago
I can comfirm that the problem exists :(
And in fact changing the
/// getBranchTargetOpValue - Helper function to get the branch target operand,
/// which is either an immediate or requires a fixup.
static uint32_t getBranchTargetOpValue(const MCInst &MI, unsigned OpIdx,
unsigned FixupKind,
SmallVectorImpl<MCFixup> &Fixups,
const MCSubtargetInfo &STI) {
const MCOperand &MO = MI.getOperand(OpIdx);
// If the destination is an immediate, we have nothing to do.
if (MO.isImm()) return MO.getImm() - MI.getAddress() - 4;
assert(MO.isExpr() && "Unexpected branch target type!");
const MCExpr *Expr = MO.getExpr();
MCFixupKind Kind = MCFixupKind(FixupKind);
Fixups.push_back(MCFixup::create(0, Expr, Kind, MI.getLoc()));
// All of the information is in the fixup.
return 0;
}
should be an more elegant way. (Also tested)
Hi all,
I found keystone can not encode thumb2 bcc instructions correctlly.For example:
I invistigated this issue and foud out the following code my be wrong
I pathced the code in this way
and it worked well then.