Fix loadables to honor size $RAMCODE from Makefile.inc

This commit is contained in:
Stefan `Sec` Zehl 2011-07-05 02:45:55 +02:00
parent a03f202e7c
commit 876ee2474f
3 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,4 @@
*.elf
*.bin
*.h
loadable.ld

View File

@ -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)

View File

@ -1,8 +1,3 @@
MEMORY
{
sram(rwx): ORIGIN = 0x10001800, LENGTH = 2K
}
sram_top = ORIGIN(sram) + LENGTH(sram);
ENTRY(boot_entry)