Skip to content

Commit

Permalink
[PATCH] powerpc: Don't blow away load_addr in start_thread
Browse files Browse the repository at this point in the history
The patch to make process.c work for 32-bit and 64-bit
(06d67d5) 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>
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Oct 21, 2005
1 parent 6cb7bfe commit 90eac72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/powerpc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand All @@ -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
Expand Down

0 comments on commit 90eac72

Please sign in to comment.