]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/process.c
[PATCH] powerpc: Don't blow away load_addr in start_thread
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / process.c
index 193c8c1bf132a4d8ab97f5ad94e73b6391724454..047da1ae21fe3c8757f39e256a5c80b42a5783d7 100644 (file)
@@ -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