From 39dd68bca649e9275c602fa212f448ae8497f306 Mon Sep 17 00:00:00 2001
From: Nicolas Pitre <nico@fluxnic.net>
Date: Tue, 27 Oct 2009 21:19:42 -0400
Subject: ARM: fix target address when disassembling Thumb BLX

A Thumb BLX instruction is branching to ARM code, and therefore the
first 2 bits of the target address must be cleared.

Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
 src/target/arm_disassembler.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src')

diff --git a/src/target/arm_disassembler.c b/src/target/arm_disassembler.c
index 5b0046b7..ee087b12 100644
--- a/src/target/arm_disassembler.c
+++ b/src/target/arm_disassembler.c
@@ -1768,6 +1768,7 @@ static int evaluate_b_bl_blx_thumb(uint16_t opcode,
 		case 1:
 			instruction->type = ARM_BLX;
 			mnemonic = "BLX";
+			target_address &= 0xfffffffc;
 			break;
 		/* BL/BLX prefix */
 		case 2:
-- 
cgit v1.2.3