[PATCH 1/12] ppc64: Set entry point and text address in linker script

Michael Ellerman michael at ellerman.id.au
Fri Aug 26 12:53:20 EST 2005


Currently we set the kernel entry point and the address of the text
section in the Makefile, using a hard-coded 0xc000000000000000.

Instead we can #include <asm/page.h> in the linker script and use
KERNELBASE directly. Which means if we ever change KERNELBASE there's
one less place to change it.

There are zero differences from readelf of vmlinux before and after
this patch.

Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---

 arch/ppc64/Makefile             |    4 +---
 arch/ppc64/kernel/vmlinux.lds.S |    3 +++
 2 files changed, 4 insertions(+), 3 deletions(-)

Index: work/arch/ppc64/Makefile
===================================================================
--- work.orig/arch/ppc64/Makefile
+++ work/arch/ppc64/Makefile
@@ -13,8 +13,6 @@
 # Adjusted for PPC64 by Tom Gall
 #
 
-KERNELLOAD	:= 0xc000000000000000
-
 # Set default 32 bits cross compilers for vdso and boot wrapper
 CROSS32_COMPILE ?=
 
@@ -52,7 +50,7 @@ endif
 CHECKFLAGS	+= -m64 -D__powerpc__
 
 LDFLAGS		:= -m elf64ppc
-LDFLAGS_vmlinux	:= -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
+LDFLAGS_vmlinux	:= -Bstatic
 CFLAGS		+= -msoft-float -pipe -mminimal-toc -mtraceback=none \
 		   -mcall-aixdesc
 
Index: work/arch/ppc64/kernel/vmlinux.lds.S
===================================================================
--- work.orig/arch/ppc64/kernel/vmlinux.lds.S
+++ work/arch/ppc64/kernel/vmlinux.lds.S
@@ -1,5 +1,7 @@
 #include <asm-generic/vmlinux.lds.h>
+#include <asm/page.h>
 
+ENTRY(_stext)
 OUTPUT_ARCH(powerpc:common64)
 jiffies = jiffies_64;
 SECTIONS
@@ -9,6 +11,7 @@ SECTIONS
 	*(.exitcall.exit)
 	}
 
+  . = KERNELBASE;
 
   /* Read-only sections, merged into text segment: */
   .text : {



More information about the Linuxppc64-dev mailing list