]> git.sur5r.net Git - openocd/commitdiff
ARM: fix target address when disassembling Thumb BLX
authorNicolas Pitre <nico@fluxnic.net>
Wed, 28 Oct 2009 01:19:42 +0000 (21:19 -0400)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Wed, 28 Oct 2009 02:25:54 +0000 (19:25 -0700)
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

index 5b0046b7def80d1abc5cdd4840ff8af3b61c7a3b..ee087b1215372f044b79db41b003518b2102980e 100644 (file)
@@ -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: