Attempt at addressing head*.S for modpost warnings

Kumar Gala galak at kernel.crashing.org
Wed Jul 25 16:49:04 EST 2007


Stephen,

Paul said you were looking into this issue as well.  Wanted to post what I
did on ppc32/e500 as a start for you to look at.  I think the other ppc32
head*.S can follow the same pattern if we like this.  However, wasn't sure
how to do _ENTRY() for ppc64.

- k

diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 1f155d3..d83cbbb 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -52,9 +52,9 @@
  *   r7 - End of kernel command line string
  *
  */
-	.text
-_GLOBAL(_stext)
-_GLOBAL(_start)
+	.section	.text.head, "ax"
+_ENTRY(_stext);
+_ENTRY(_start);
 	/*
 	 * Reserve a word at a fixed location to store the address
 	 * of abatron_pteptrs
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 0c45855..823a8cb 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -34,6 +34,8 @@ SECTIONS

 	/* Text and gots */
 	.text : {
+		ALIGN_FUNCTION();
+		*(.text.head)
 		_text = .;
 		TEXT_TEXT
 		SCHED_TEXT
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h
index fa083d8..7ec22d2 100644
--- a/include/asm-powerpc/ppc_asm.h
+++ b/include/asm-powerpc/ppc_asm.h
@@ -183,6 +183,11 @@ GLUE(.,name):

 #else /* 32-bit */

+#define _ENTRY(n)	\
+	.stabs __stringify(n:F-1),N_FUN,0,0,n;\
+	.globl n;	\
+n:
+
 #define _GLOBAL(n)	\
 	.text;		\
 	.stabs __stringify(n:F-1),N_FUN,0,0,n;\



More information about the Linuxppc-dev mailing list