RE: [Linux-ia64] [Patch] Fix in process.c

From: Siddha, Suresh B <suresh.b.siddha_at_intel.com>
Date: 2003-01-21 13:41:56
> > 
> > I understand that.  What I'm saying is that GCC does the sane thing.
> > There's got to be a way to get the address of a label without having
> > to materialize a function pointer.
> > 
> > 	--david
> > 
> 
> We can do that through the linker script vmlinux.lds.S.
> 

hi David,

Here is the patch which does this. Please apply.

thanks,
suresh

diff -Nru linux-2.5.52/arch/ia64/kernel/process.c linux/arch/ia64/kernel/process.c
--- linux-2.5.52/arch/ia64/kernel/process.c	Mon Jan 20 13:12:08 2003
+++ linux/arch/ia64/kernel/process.c	Mon Jan 20 09:45:21 2003
@@ -281,7 +281,10 @@
 {
 	unsigned long rbs, child_rbs, rbs_size, stack_offset, stack_top, stack_used;
 	struct switch_stack *child_stack, *stack;
-	extern char ia64_ret_from_clone, ia32_ret_from_clone;
+	extern int  __ia64_ret_from_clone;
+#ifdef CONFIG_IA32_SUPPORT
+	extern int __ia32_ret_from_clone;
+#endif
 	struct pt_regs *child_ptregs;
 	int retval = 0;
 
@@ -332,10 +335,12 @@
 		child_ptregs->r12 = (unsigned long) (child_ptregs + 1); /* kernel sp */
 		child_ptregs->r13 = (unsigned long) p;		/* set `current' pointer */
 	}
+#ifdef CONFIG_IA32_SUPPORT
 	if (IS_IA32_PROCESS(regs))
-		child_stack->b0 = (unsigned long) &ia32_ret_from_clone;
+		child_stack->b0 = (unsigned long) &__ia32_ret_from_clone;
 	else
-		child_stack->b0 = (unsigned long) &ia64_ret_from_clone;
+#endif
+		child_stack->b0 = (unsigned long) &__ia64_ret_from_clone;
 	child_stack->ar_bspstore = child_rbs + rbs_size;
 
 	/* copy parts of thread_struct: */
diff -Nru linux-2.5.52/arch/ia64/vmlinux.lds.S linux/arch/ia64/vmlinux.lds.S
--- linux-2.5.52/arch/ia64/vmlinux.lds.S	Mon Jan 20 13:12:09 2003
+++ linux/arch/ia64/vmlinux.lds.S	Mon Jan 20 18:31:14 2003
@@ -39,6 +39,14 @@
 #endif
   _etext = .;
 
+   /* We want to get the address of a label without having
+      to materialize a function pointer. "+0" is for changing
+      the symbol type */
+   __ia64_ret_from_clone = ia64_ret_from_clone + 0;
+#ifdef CONFIG_IA32_SUPPORT
+   __ia32_ret_from_clone = ia32_ret_from_clone + 0;
+#endif
+
   /* Read-only data */
 
   /* Global data */




Received on Mon Jan 20 18:41:59 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:11 EST