aboutsummaryrefslogtreecommitdiffstats
path: root/linux-user/elfload.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2010-03-28 16:51:43 +0200
committerAurelien Jarno <aurelien@aurel32.net>2010-03-28 16:52:27 +0200
commit7983f435e5306a4b17e1edcb408ba64b33e9c88f (patch)
treec4cc22677304496ace76ad55f93667c8387c1570 /linux-user/elfload.c
parente432cef9161685ea3dbb3f31a90820e53f74041e (diff)
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 <rob@landley.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r--linux-user/elfload.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index b721b107d..4d3dd89b2 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. */