From 0d892f60b72fc836e37ef3ac0bb079bd48ce88fb Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sun, 9 Jan 2011 02:23:47 +0100 Subject: [PATCH] Adjust load address of native stage2 to zero --- stage2/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stage2/Makefile b/stage2/Makefile index 2f874d5..6bc8190 100644 --- a/stage2/Makefile +++ b/stage2/Makefile @@ -42,7 +42,7 @@ OBJS_NATIVE = start_native.o $(CORE_OBJS) STUB_OBJS = uncompress/stub_start.o uncompress/unlzma.o -all: stage2.bin +all: stage2.bin stage2_native.bin .PRECIOUS: stage2_raw.bin @@ -66,7 +66,11 @@ uncompress/stub.elf: $(STUB_OBJS) uncompress/stub.ld stage2_native.elf: $(OBJS_NATIVE) stage2_native.ld @echo " LINK $@" - @$(PREFIX)gcc $(LDFLAGS) -Wl,-T,stage2_native.ld -o $@ $(OBJS_NATIVE) + @$(PREFIX)gcc $(LDFLAGS) -Wl,-T,stage2_native.ld -o tmp_$@ $(OBJS_NATIVE) + # move everything down to zero, it will relocate itself on startup + # this could be done in the linker script for lma, but Sony fails and needs it for vma. + @$(PREFIX)objcopy --adjust-vma -0xc00000 tmp_$@ $@ + @rm -f tmp_$@ stage2_raw.elf: $(OBJS) stage2.ld @echo " LINK $@" -- 2.11.4.GIT