From a957a1c8433f45452902de3060364122602e6e1c Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Sun, 28 Jan 2018 15:48:46 +0300 Subject: [PATCH] target: arm: disassembler: fix Thumb2 BLX decoding address Since BLX in Thumb2 always switches mode to ARM, the PC needs to be 4-bytes aligned. Change-Id: I4f4c194fe21093cecfd9872e1d30588f4adc7257 Signed-off-by: Paul Fertser Reviewed-on: http://openocd.zylin.com/4382 Reviewed-by: Philipp Guehring Tested-by: jenkins Reviewed-by: Paul Sokolovsky --- src/target/arm_disassembler.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/target/arm_disassembler.c b/src/target/arm_disassembler.c index ef69a203..8e783d34 100644 --- a/src/target/arm_disassembler.c +++ b/src/target/arm_disassembler.c @@ -2978,6 +2978,7 @@ static int t2ev_b_bl(uint32_t opcode, uint32_t address, case 0x4: inst = "BLX"; instruction->type = ARM_BLX; + address &= 0xfffffffc; break; case 0x5: inst = "BL"; -- 2.39.5