Arm/Thumb entry points
PATCH 1/1 Arm/Thumb entry points
The patch fixes a bug in the arm usermode emulation. The CPU wasn't being correctly initialized when the entry point is a Thumb function.
Paul
=== linux-user/elfload.c
==================================================================
elfload.c +3 -1
@@ -100,7 +100,9 @@target_long *stack = (void *)infop->start_stack;memset (regs,0 ,sizeof (*regs)); regs->ARM_cpsr =0x10 ; - regs->ARM_pc = infop->entry; +if (infop->entry &1 ) + regs->ARM_cpsr |=CPSR_T ; + regs->ARM_pc = infop->entry &0xfffffffe ; regs->ARM_sp = infop->start_stack; regs->ARM_r2 =tswapl (stack[2 ]);/* envp */ regs->ARM_r1 =tswapl (stack[1 ]);/* argv */