Commit 67a1b682 authored by Olaf Hering's avatar Olaf Hering Committed by Paul Mackerras
Browse files

[PATCH] ppc64 boot: proof that reloc works



To prove that the relocation works, move the crt0.o away from the beginning.
Move linker options from command line into linker script.  rename entry point
because '_start' is referenced in printf output.
Signed-off-by: default avatarOlaf Hering <olh@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Anton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent a4497235
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
HOSTCC := gcc HOSTCC := gcc
BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem $(shell $(CROSS32CC) -print-file-name=include) -fPIC BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem $(shell $(CROSS32CC) -print-file-name=include) -fPIC
BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
BOOTLFLAGS := -Ttext 0x00400000 -e _start -T $(srctree)/$(src)/zImage.lds BOOTLFLAGS := -T $(srctree)/$(src)/zImage.lds
OBJCOPYFLAGS := contents,alloc,load,readonly,data OBJCOPYFLAGS := contents,alloc,load,readonly,data
zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c
...@@ -34,7 +34,7 @@ zliblinuxheader := zlib.h zconf.h zutil.h ...@@ -34,7 +34,7 @@ zliblinuxheader := zlib.h zconf.h zutil.h
$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) $(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
#$(addprefix $(obj)/,main.o): $(addprefix $(obj)/,zlib.h) #$(addprefix $(obj)/,main.o): $(addprefix $(obj)/,zlib.h)
src-boot := crt0.S string.S prom.c main.c div64.S src-boot := string.S prom.c main.c div64.S crt0.S
src-boot += $(zlib) src-boot += $(zlib)
src-boot := $(addprefix $(obj)/, $(src-boot)) src-boot := $(addprefix $(obj)/, $(src-boot))
obj-boot := $(addsuffix .o, $(basename $(src-boot))) obj-boot := $(addsuffix .o, $(basename $(src-boot)))
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
#include "ppc_asm.h" #include "ppc_asm.h"
.text .text
.globl _start .globl _zimage_start
_start: _zimage_start:
bl reloc_offset bl reloc_offset
reloc_offset: reloc_offset:
......
OUTPUT_ARCH(powerpc:common) OUTPUT_ARCH(powerpc:common)
ENTRY(_zimage_start)
SECTIONS SECTIONS
{ {
. = (4*1024*1024);
_start = .;
.text : .text :
{ {
*(.text) *(.text)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment