diff options
author | Olaf Hering <olh@suse.de> | 2005-10-28 20:46:49 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-29 01:11:00 -0400 |
commit | 67a1b68263d58a3ed5ce024468606044a1561312 (patch) | |
tree | 0e997ea83aa27cb2ceb622549acc8e47aefa6bb2 /arch/ppc64/boot | |
parent | a4497235f00d811943831c9d76995d36c4ffab2d (diff) |
[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: Olaf Hering <olh@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64/boot')
-rw-r--r-- | arch/ppc64/boot/Makefile | 4 | ||||
-rw-r--r-- | arch/ppc64/boot/crt0.S | 4 | ||||
-rw-r--r-- | arch/ppc64/boot/zImage.lds | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/arch/ppc64/boot/Makefile b/arch/ppc64/boot/Makefile index 9e19351f3df..301bc1536c4 100644 --- a/arch/ppc64/boot/Makefile +++ b/arch/ppc64/boot/Makefile | |||
@@ -24,7 +24,7 @@ | |||
24 | HOSTCC := gcc | 24 | HOSTCC := gcc |
25 | BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem $(shell $(CROSS32CC) -print-file-name=include) -fPIC | 25 | BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem $(shell $(CROSS32CC) -print-file-name=include) -fPIC |
26 | BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc | 26 | BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc |
27 | BOOTLFLAGS := -Ttext 0x00400000 -e _start -T $(srctree)/$(src)/zImage.lds | 27 | BOOTLFLAGS := -T $(srctree)/$(src)/zImage.lds |
28 | OBJCOPYFLAGS := contents,alloc,load,readonly,data | 28 | OBJCOPYFLAGS := contents,alloc,load,readonly,data |
29 | 29 | ||
30 | zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c | 30 | 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 | $(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) | 34 | $(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) |
35 | #$(addprefix $(obj)/,main.o): $(addprefix $(obj)/,zlib.h) | 35 | #$(addprefix $(obj)/,main.o): $(addprefix $(obj)/,zlib.h) |
36 | 36 | ||
37 | src-boot := crt0.S string.S prom.c main.c div64.S | 37 | src-boot := string.S prom.c main.c div64.S crt0.S |
38 | src-boot += $(zlib) | 38 | src-boot += $(zlib) |
39 | src-boot := $(addprefix $(obj)/, $(src-boot)) | 39 | src-boot := $(addprefix $(obj)/, $(src-boot)) |
40 | obj-boot := $(addsuffix .o, $(basename $(src-boot))) | 40 | obj-boot := $(addsuffix .o, $(basename $(src-boot))) |
diff --git a/arch/ppc64/boot/crt0.S b/arch/ppc64/boot/crt0.S index 5788a453a7a..8bfdeaf3be8 100644 --- a/arch/ppc64/boot/crt0.S +++ b/arch/ppc64/boot/crt0.S | |||
@@ -12,8 +12,8 @@ | |||
12 | #include "ppc_asm.h" | 12 | #include "ppc_asm.h" |
13 | 13 | ||
14 | .text | 14 | .text |
15 | .globl _start | 15 | .globl _zimage_start |
16 | _start: | 16 | _zimage_start: |
17 | bl reloc_offset | 17 | bl reloc_offset |
18 | 18 | ||
19 | reloc_offset: | 19 | reloc_offset: |
diff --git a/arch/ppc64/boot/zImage.lds b/arch/ppc64/boot/zImage.lds index 79d62c733ec..4b6bb3ffe3d 100644 --- a/arch/ppc64/boot/zImage.lds +++ b/arch/ppc64/boot/zImage.lds | |||
@@ -1,6 +1,9 @@ | |||
1 | OUTPUT_ARCH(powerpc:common) | 1 | OUTPUT_ARCH(powerpc:common) |
2 | ENTRY(_zimage_start) | ||
2 | SECTIONS | 3 | SECTIONS |
3 | { | 4 | { |
5 | . = (4*1024*1024); | ||
6 | _start = .; | ||
4 | .text : | 7 | .text : |
5 | { | 8 | { |
6 | *(.text) | 9 | *(.text) |