From: Rob Landley Date: Sun, 28 Mar 2010 14:51:43 +0000 (+0200) Subject: linux-user/ppc: use the Linux register layout X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7983f435e5306a4b17e1edcb408ba64b33e9c88f;p=qmiga%2Fqemu.git linux-user/ppc: use the Linux register layout The dynamic linker converts the Linux layout to the AIX layout and is reentrant so it won't do it a second time if it's already been converted. In short it work just fine with either register layout. OTOH, statically linked binaries expect a Linux layout. Remove code converting the Linux layout to AIX layout so that all binaries are presented the Linux Layout. Signed-off-by: Rob Landley Signed-off-by: Aurelien Jarno --- diff --git a/linux-user/elfload.c b/linux-user/elfload.c index b721b107d5..4d3dd89b2b 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -512,31 +512,12 @@ do { \ static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop) { - abi_ulong pos = infop->start_stack; - abi_ulong tmp; -#if defined(TARGET_PPC64) && !defined(TARGET_ABI32) - abi_ulong entry, toc; -#endif - _regs->gpr[1] = infop->start_stack; #if defined(TARGET_PPC64) && !defined(TARGET_ABI32) - entry = ldq_raw(infop->entry) + infop->load_addr; - toc = ldq_raw(infop->entry + 8) + infop->load_addr; - _regs->gpr[2] = toc; - infop->entry = entry; + _regs->gpr[2] = ldq_raw(infop->entry + 8) + infop->load_addr; + infop->entry = ldq_raw(infop->entry) + infop->load_addr; #endif _regs->nip = infop->entry; - /* Note that isn't exactly what regular kernel does - * but this is what the ABI wants and is needed to allow - * execution of PPC BSD programs. - */ - /* FIXME - what to for failure of get_user()? */ - get_user_ual(_regs->gpr[3], pos); - pos += sizeof(abi_ulong); - _regs->gpr[4] = pos; - for (tmp = 1; tmp != 0; pos += sizeof(abi_ulong)) - tmp = ldl(pos); - _regs->gpr[5] = pos; } /* See linux kernel: arch/powerpc/include/asm/elf.h. */