From 2f285db8573f30f78a3a5a17329ae4d0ab097c86 Mon Sep 17 00:00:00 2001 From: Reiko Asakura Date: Wed, 17 Feb 2021 10:16:20 -0500 Subject: Fix wrong T bit in BLX(imm)->BLX(reg) transform --- lib/arm/dis-thumb2.inc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/arm/dis-thumb2.inc.h') diff --git a/lib/arm/dis-thumb2.inc.h b/lib/arm/dis-thumb2.inc.h index 4203c01..98ba5ac 100644 --- a/lib/arm/dis-thumb2.inc.h +++ b/lib/arm/dis-thumb2.inc.h @@ -175,7 +175,8 @@ static INLINE void P(t_bltarget_func_1_tBL)(tdis_ctx ctx, struct bitslice func) unsigned S = crap >> 24 & 1; if (!S) crap ^= (3 << 22); - return P(branch)(ctx, ctx->base.pc + 4 + sext(crap, 25), CC_CALL); + /* Set Thumb bit because this call will be transformed into a BLX (reg) */ + return P(branch)(ctx, (ctx->base.pc + 4 + sext(crap, 25)) | 1, CC_CALL); } static INLINE void P(t_blxtarget_func_1_tBLXi)(tdis_ctx ctx, struct bitslice func) { -- cgit v1.2.3