mirror of https://gitee.com/openkylin/qemu.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 <rob@landley.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
e432cef916
commit
7983f435e5
|
@ -512,31 +512,12 @@ do { \
|
||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop)
|
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;
|
_regs->gpr[1] = infop->start_stack;
|
||||||
#if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
|
#if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
|
||||||
entry = ldq_raw(infop->entry) + infop->load_addr;
|
_regs->gpr[2] = ldq_raw(infop->entry + 8) + infop->load_addr;
|
||||||
toc = ldq_raw(infop->entry + 8) + infop->load_addr;
|
infop->entry = ldq_raw(infop->entry) + infop->load_addr;
|
||||||
_regs->gpr[2] = toc;
|
|
||||||
infop->entry = entry;
|
|
||||||
#endif
|
#endif
|
||||||
_regs->nip = infop->entry;
|
_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. */
|
/* See linux kernel: arch/powerpc/include/asm/elf.h. */
|
||||||
|
|
Loading…
Reference in New Issue