target: arm: disassembler: fix Thumb2 BLX decoding address 82/4382/2
authorPaul Fertser <fercerpav@gmail.com>
Sun, 28 Jan 2018 12:48:46 +0000 (15:48 +0300)
committerPaul Fertser <fercerpav@gmail.com>
Tue, 13 Mar 2018 08:41:54 +0000 (08:41 +0000)
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 <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/4382
Reviewed-by: Philipp Guehring <pg@futureware.at>
Tested-by: jenkins
Reviewed-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
src/target/arm_disassembler.c

index ef69a20..8e783d3 100644 (file)
@@ -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";