diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2009-12-11 09:04:47 -0800 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2009-12-19 20:29:18 +0100 |
commit | d049e626ad38be8b88246076398dbadbcf2e0f65 (patch) | |
tree | 47160b75a5ae1fb10062870b44f117a510bf3a84 | |
parent | 21e807fadb8a16608875551fd313cb471ab315ce (diff) |
linux-user: fix ARM core dumps on opposite-endian hosts
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r-- | linux-user/elfload.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 7e591aa235..b3eb8f9f45 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -291,25 +291,25 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) { - (*regs)[0] = env->regs[0]; - (*regs)[1] = env->regs[1]; - (*regs)[2] = env->regs[2]; - (*regs)[3] = env->regs[3]; - (*regs)[4] = env->regs[4]; - (*regs)[5] = env->regs[5]; - (*regs)[6] = env->regs[6]; - (*regs)[7] = env->regs[7]; - (*regs)[8] = env->regs[8]; - (*regs)[9] = env->regs[9]; - (*regs)[10] = env->regs[10]; - (*regs)[11] = env->regs[11]; - (*regs)[12] = env->regs[12]; - (*regs)[13] = env->regs[13]; - (*regs)[14] = env->regs[14]; - (*regs)[15] = env->regs[15]; - - (*regs)[16] = cpsr_read((CPUState *)env); - (*regs)[17] = env->regs[0]; /* XXX */ + (*regs)[0] = tswapl(env->regs[0]); + (*regs)[1] = tswapl(env->regs[1]); + (*regs)[2] = tswapl(env->regs[2]); + (*regs)[3] = tswapl(env->regs[3]); + (*regs)[4] = tswapl(env->regs[4]); + (*regs)[5] = tswapl(env->regs[5]); + (*regs)[6] = tswapl(env->regs[6]); + (*regs)[7] = tswapl(env->regs[7]); + (*regs)[8] = tswapl(env->regs[8]); + (*regs)[9] = tswapl(env->regs[9]); + (*regs)[10] = tswapl(env->regs[10]); + (*regs)[11] = tswapl(env->regs[11]); + (*regs)[12] = tswapl(env->regs[12]); + (*regs)[13] = tswapl(env->regs[13]); + (*regs)[14] = tswapl(env->regs[14]); + (*regs)[15] = tswapl(env->regs[15]); + + (*regs)[16] = tswapl(cpsr_read((CPUState *)env)); + (*regs)[17] = tswapl(env->regs[0]); /* XXX */ } #define USE_ELF_CORE_DUMP |