Skip to contentSkip to conversation

fix BLX

PATCH New Lauro Ramos Venancio 1 participant 1 message Jun 11, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix BLX

The attached patch fixes a bug in execution of "blx lr".

Current behavior:
lr <- pc
branch lr

Expected behavior:
temp <- lr
lr <- pc
branch temp

Lauro

Index: target-arm/translate.c
===================================================================
RCS file: /sources/qemu/qemu/target-arm/translate.c,v retrieving revision 1.51

translate.c +2 -2
diff -u -r1.51 translate.c
@@ -2325,9 +2325,9 @@
 
             /* branch link/exchange thumb (blx) */
             val = (uint32_t)s->pc;
-            gen_op_movl_T0_im(val);
-            gen_movl_reg_T0(s, 14);
+            gen_op_movl_T1_im(val);
             gen_movl_T0_reg(s, rm);
+            gen_movl_reg_T1(s, 14);
             gen_bx(s);
             break;
         case 0x5: /* saturating add/subtract */