From 876ee2474f28a9b508cefd57bc24b9b52bd722c2 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Tue, 5 Jul 2011 02:45:55 +0200 Subject: [PATCH] Fix loadables to honor size $RAMCODE from Makefile.inc --- firmware/loadable/.gitignore | 1 + firmware/loadable/Makefile.sub | 10 ++++++++++ firmware/loadable/{loadable.ld => ram.ld} | 5 ----- 3 files changed, 11 insertions(+), 5 deletions(-) rename firmware/loadable/{loadable.ld => ram.ld} (93%) diff --git a/firmware/loadable/.gitignore b/firmware/loadable/.gitignore index 60ca729..7652361 100644 --- a/firmware/loadable/.gitignore +++ b/firmware/loadable/.gitignore @@ -1,3 +1,4 @@ *.elf *.bin *.h +loadable.ld diff --git a/firmware/loadable/Makefile.sub b/firmware/loadable/Makefile.sub index a4763af..e513bb4 100644 --- a/firmware/loadable/Makefile.sub +++ b/firmware/loadable/Makefile.sub @@ -22,12 +22,20 @@ include $(ROOT_PATH)/Makefile.inc # Compiler settings, parameters and flags ########################################################################## FIRMWARE=$(ROOT_PATH)/$(OUTFILE).elf +LDSRCFILE=$(DIR)/ram.ld LDFILE=$(DIR)/loadable.ld CFLAGS+=-mlong-calls LDFLAGS+= -R $(FIRMWARE) all: $(OBJS) $(ELFS) $(BINS) $(HDRS) +$(LDFILE): + -@echo "MEMORY" > $(LDFILE) + -@echo "{" >> $(LDFILE) + -@echo " sram(rwx): ORIGIN = 0x10002000 - $(RAMCODE), LENGTH = $(RAMCODE)" >> $(LDFILE) + -@echo "}" >> $(LDFILE) + -@echo "INCLUDE $(LDSRCFILE)" >> $(LDFILE) + %.o : %.c $(CC) $(CFLAGS) -o $@ $< @@ -45,3 +53,5 @@ clean: cd $(DIR) && rm -f *.o *.elf *.bin .SUFFIXES: + +.PHONY: $(LDFILE) diff --git a/firmware/loadable/loadable.ld b/firmware/loadable/ram.ld similarity index 93% rename from firmware/loadable/loadable.ld rename to firmware/loadable/ram.ld index 2666465..db3b236 100644 --- a/firmware/loadable/loadable.ld +++ b/firmware/loadable/ram.ld @@ -1,8 +1,3 @@ -MEMORY -{ - sram(rwx): ORIGIN = 0x10001800, LENGTH = 2K -} - sram_top = ORIGIN(sram) + LENGTH(sram); ENTRY(boot_entry)