powerpc: Set entry point and text address in linker script
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(). There are zero differences from "readelf -a vmlinux" with or without this patch. Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
This commit is contained in:
Родитель
358c86fda0
Коммит
e19e4ab415
|
@ -12,9 +12,6 @@
|
||||||
# Rewritten by Cort Dougan and Paul Mackerras
|
# 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)
|
HAS_BIARCH := $(call cc-option-yn, -m32)
|
||||||
|
|
||||||
ifeq ($(CONFIG_PPC64),y)
|
ifeq ($(CONFIG_PPC64),y)
|
||||||
|
@ -59,7 +56,7 @@ override LD += -m elf$(SZ)ppc
|
||||||
override CC += -m$(SZ)
|
override CC += -m$(SZ)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic -e $(KERNELLOAD)
|
LDFLAGS_vmlinux := -Bstatic
|
||||||
|
|
||||||
# The -Iarch/$(ARCH)/include is temporary while we are merging
|
# The -Iarch/$(ARCH)/include is temporary while we are merging
|
||||||
CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
|
CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
#include <linux/config.h>
|
#include <linux/config.h>
|
||||||
#ifdef CONFIG_PPC64
|
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
#else
|
|
||||||
#define PAGE_SIZE 4096
|
|
||||||
#endif
|
|
||||||
#include <asm-generic/vmlinux.lds.h>
|
#include <asm-generic/vmlinux.lds.h>
|
||||||
|
|
||||||
|
ENTRY(_stext)
|
||||||
|
|
||||||
#ifdef CONFIG_PPC64
|
#ifdef CONFIG_PPC64
|
||||||
OUTPUT_ARCH(powerpc:common64)
|
OUTPUT_ARCH(powerpc:common64)
|
||||||
jiffies = jiffies_64;
|
jiffies = jiffies_64;
|
||||||
|
@ -21,6 +19,7 @@ SECTIONS
|
||||||
*(.exit.data)
|
*(.exit.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
. = KERNELBASE;
|
||||||
|
|
||||||
/* Read-only sections, merged into text segment: */
|
/* Read-only sections, merged into text segment: */
|
||||||
#ifdef CONFIG_PPC32
|
#ifdef CONFIG_PPC32
|
||||||
|
|
Загрузка…
Ссылка в новой задаче