From 97867f8717abc2b02bbea8c1ef625fe68f05700b Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Tue, 20 Nov 2012 12:17:41 +0000 Subject: ar71xx/image: relink loader.elf image to LOADADDR This allows to load the resulting image directly from RouterBOOT. Signed-off-by: Gabor Juhos SVN-Revision: 34271 --- target/linux/ar71xx/image/lzma-loader/src/Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'target/linux/ar71xx/image/lzma-loader/src/Makefile') diff --git a/target/linux/ar71xx/image/lzma-loader/src/Makefile b/target/linux/ar71xx/image/lzma-loader/src/Makefile index 3e6839c7c3..8038b2fba9 100644 --- a/target/linux/ar71xx/image/lzma-loader/src/Makefile +++ b/target/linux/ar71xx/image/lzma-loader/src/Makefile @@ -68,7 +68,7 @@ ifneq ($(BOARD_DEF),) CFLAGS += -DCONFIG_BOARD_$(BOARD_DEF) endif -all: loader.bin +all: loader.elf # Don't build dependencies, this may die if $(CC) isn't gcc dep: @@ -84,16 +84,22 @@ install: data.o: $(LOADER_DATA) $(LD) -r -b binary --oformat $(O_FORMAT) -T lzma-data.lds -o $@ $< -loader.bin: loader.elf +loader: $(OBJECTS) + $(LD) $(LDFLAGS) -o $@ $(OBJECTS) + +loader.bin: loader $(OBJCOPY) $(BIN_FLAGS) $< $@ -loader.elf: $(OBJECTS) - $(LD) $(LDFLAGS) -o $@ $(OBJECTS) +loader2.o: loader.bin + $(LD) -r -b binary --oformat $(O_FORMAT) -o $@ $< + +loader.elf: loader2.o + $(LD) -e startup -T loader2.lds -Ttext $(LOADADDR) -o $@ $< mrproper: clean clean: - rm -f *.elf *.bin *.o + rm -f loader *.elf *.bin *.o -- cgit v1.2.3