Commit 0240ded8bb1580147ed2ff1748df439a3b41e38f
1 parent
0fd14b72
Correctly initialize Arm CPU for Thumb entry points.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1739 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
3 additions
and
1 deletions
linux-user/elfload.c
... | ... | @@ -100,7 +100,9 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i |
100 | 100 | target_long *stack = (void *)infop->start_stack; |
101 | 101 | memset(regs, 0, sizeof(*regs)); |
102 | 102 | regs->ARM_cpsr = 0x10; |
103 | - regs->ARM_pc = infop->entry; | |
103 | + if (infop->entry & 1) | |
104 | + regs->ARM_cpsr |= CPSR_T; | |
105 | + regs->ARM_pc = infop->entry & 0xfffffffe; | |
104 | 106 | regs->ARM_sp = infop->start_stack; |
105 | 107 | regs->ARM_r2 = tswapl(stack[2]); /* envp */ |
106 | 108 | regs->ARM_r1 = tswapl(stack[1]); /* argv */ | ... | ... |