diff -ur qemu-snapshot-2008-04-01_05-patch1/target-arm/helper.c qemu-snapshot-2008-04-01_05-patch2/target-arm/helper.c --- qemu-snapshot-2008-04-01_05-patch1/target-arm/helper.c 2008-04-12 23:07:46.000000000 +0200 +++ qemu-snapshot-2008-04-01_05-patch2/target-arm/helper.c 2008-04-12 23:15:22.000000000 +0200 @@ -562,6 +562,8 @@ env->regs[12] = v7m_pop(env); env->regs[14] = v7m_pop(env); env->regs[15] = v7m_pop(env); + env->thumb = env->regs[15] & 1; + env->regs[15] &= ~1; xpsr = v7m_pop(env); xpsr_write(env, xpsr, 0xfffffdff); /* Undo stack alignment. */ @@ -634,7 +636,7 @@ } /* Switch to the hander mode. */ v7m_push(env, xpsr); - v7m_push(env, env->regs[15]); + v7m_push(env, env->regs[15] | (env->thumb?1:0)); v7m_push(env, env->regs[14]); v7m_push(env, env->regs[12]); v7m_push(env, env->regs[3]);