diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2005-10-21 16:01:33 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-21 22:47:39 +1000 |
commit | 90eac727c6d7afbe707ce408edf97c33385fa08c (patch) | |
tree | 130fc6e078e82a3c8fd62d90105d346637d680ea /arch | |
parent | 6cb7bfebb145af5ea1d052512a2ae7ff07a47202 (diff) | |
download | talos-op-linux-90eac727c6d7afbe707ce408edf97c33385fa08c.tar.gz talos-op-linux-90eac727c6d7afbe707ce408edf97c33385fa08c.zip |
[PATCH] powerpc: Don't blow away load_addr in start_thread
The patch to make process.c work for 32-bit and 64-bit
(06d67d54741a5bfefa31945ef195dfa748c29025) 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: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/process.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 193c8c1bf132..047da1ae21fe 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -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) { +#ifdef CONFIG_PPC64 + unsigned long load_addr = regs->gpr[2]; /* saved by ELF_PLAT_INIT */ +#endif + set_fs(USER_DS); /* @@ -621,7 +625,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) regs->msr = MSR_USER; #else 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 * the elf _start routine. The first entry in the function |