From b0c6276b40a53c5ca96474c6f76fa566d81cf1c6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 26 Feb 2003 16:05:30 +0000 Subject: Moved to one single .lds file for ALL builds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3347 a1c6a512-1295-4272-9138-f99709370657 --- apps/Makefile | 7 +++---- firmware/app.lds | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/apps/Makefile b/apps/Makefile index 9c2b961a5a..dfd1ae2710 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -31,12 +31,11 @@ ifndef MEM MEM=2 endif +LDS := $(FIRMWARE)/app.lds + ifdef DEBUG DEFINES := -DDEBUG CFLAGS += -g - LDS := $(FIRMWARE)/gdb.lds -else - LDS := $(FIRMWARE)/app.lds endif SRC := $(wildcard *.c) @@ -76,7 +75,7 @@ $(OBJDIR)/librockbox.a: # MEM should be passed on to this makefile with the chosen memory size given # in number of MB $(LINKFILE): $(LDS) - cat $< | $(CC) -DMEMORYSIZE=$(MEM) -E -P - >$@ + cat $< | $(CC) -DMEMORYSIZE=$(MEM) $(DEFINES) -E -P - >$@ $(OBJDIR)/rockbox.elf : $(OBJS) $(LINKFILE) $(OBJDIR)/librockbox.a $(CC) -Os -nostdlib -o $(OBJDIR)/rockbox.elf $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMWARE) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockbox.map diff --git a/firmware/app.lds b/firmware/app.lds index c6149252cb..4a8ae724fa 100644 --- a/firmware/app.lds +++ b/firmware/app.lds @@ -2,11 +2,17 @@ ENTRY(start) OUTPUT_FORMAT(elf32-sh) INPUT(crt0.o) +#ifdef DEBUG +#define DRAMSIZE 0x1f0000 +#define ORIGADDR 0x09010000 +#else #define DRAMSIZE (MEMORYSIZE * 0x100000) +#define ORIGADDR 0x09000000 +#endif MEMORY { - DRAM : ORIGIN = 0x09000000, LENGTH = DRAMSIZE + DRAM : ORIGIN = ORIGADDR, LENGTH = DRAMSIZE IRAM : ORIGIN = 0x0f000000, LENGTH = 0x1000 } @@ -56,6 +62,15 @@ SECTIONS _end = .; } > DRAM +#ifdef DEBUG + .heap : + { + _poolstart = .; + . = 0x20000; + _poolend = .; + } > DRAM +#endif + .mp3buf : { _mp3buf = .; -- cgit v1.2.3