Skip to content

Commit

Permalink
ARM: fix target address when disassembling Thumb BLX
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Brownell <[email protected]>
  • Loading branch information
npitre authored and David Brownell committed Oct 28, 2009
1 parent 993fe4a commit 39dd68b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/target/arm_disassembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 39dd68b

Please sign in to comment.