Commit 90eac727 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[PATCH] powerpc: Don't blow away load_addr in start_thread

The patch to make process.c work for 32-bit and 64-bit
(06d67d54) broke some 64-bit binaries.
We were blowing away load_addr in gpr[2], so we weren't properly relocating
the entry point.
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 6cb7bfeb
...@@ -595,6 +595,10 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, ...@@ -595,6 +595,10 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
*/ */
void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
{ {
#ifdef CONFIG_PPC64
unsigned long load_addr = regs->gpr[2]; /* saved by ELF_PLAT_INIT */
#endif
set_fs(USER_DS); set_fs(USER_DS);
/* /*
...@@ -621,7 +625,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) ...@@ -621,7 +625,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
regs->msr = MSR_USER; regs->msr = MSR_USER;
#else #else
if (!test_thread_flag(TIF_32BIT)) { if (!test_thread_flag(TIF_32BIT)) {
unsigned long entry, toc, load_addr = regs->gpr[2]; unsigned long entry, toc;
/* start is a relocated pointer to the function descriptor for /* start is a relocated pointer to the function descriptor for
* the elf _start routine. The first entry in the function * the elf _start routine. The first entry in the function
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment