[PATCH 8/10] powerpc: Set entry point and text address in linker script

Michael Ellerman michael at ellerman.id.au
Thu Oct 13 18:42:22 EST 2005


Currently we set the kernel entry point and the address of the text
section in the Makefile, using CONFIG_KERNEL_START.

But we've already got <asm/page.h> in the linker script, so we can just
use KERNELBASE directly. That means if we ever change KERNELBASE there's
one less place to change it.

And we can set the entry point with ENTRY().

Apart from linux_banner, there are zero differences from "readelf -a vmlinux"
before and after this patch.

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

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

Index: kexec/arch/powerpc/Makefile
===================================================================
--- kexec.orig/arch/powerpc/Makefile
+++ kexec/arch/powerpc/Makefile
@@ -12,9 +12,6 @@
 # Rewritten by Cort Dougan and Paul Mackerras
 #
 
-# This must match PAGE_OFFSET in include/asm-powerpc/page.h.
-KERNELLOAD	:= $(CONFIG_KERNEL_START)
-
 HAS_BIARCH	:= $(call cc-option-yn, -m32)
 
 ifeq ($(CONFIG_PPC64),y)
@@ -57,7 +54,7 @@ override LD	+= -m elf$(SZ)ppc
 override CC	+= -m$(SZ)
 endif
 
-LDFLAGS_vmlinux	:= -Ttext $(KERNELLOAD) -Bstatic -e $(KERNELLOAD)
+LDFLAGS_vmlinux	:= -Bstatic
 
 # The -Iarch/$(ARCH)/include is temporary while we are merging
 CPPFLAGS	+= -Iarch/$(ARCH) -Iarch/$(ARCH)/include
Index: kexec/arch/powerpc/kernel/vmlinux.lds.S
===================================================================
--- kexec.orig/arch/powerpc/kernel/vmlinux.lds.S
+++ kexec/arch/powerpc/kernel/vmlinux.lds.S
@@ -6,6 +6,8 @@
 #endif
 #include <asm-generic/vmlinux.lds.h>
 
+ENTRY(_stext)
+
 #ifdef CONFIG_PPC64
 OUTPUT_ARCH(powerpc:common64)
 jiffies = jiffies_64;
@@ -21,6 +23,7 @@ SECTIONS
     *(.exit.data)
   }
 
+  . = KERNELBASE;
 
   /* Read-only sections, merged into text segment: */
 #ifdef CONFIG_PPC32



More information about the Linuxppc64-dev mailing list