summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2009-03-02 00:16:44 +0000
committerJens Arnold <amiconn@rockbox.org>2009-03-02 00:16:44 +0000
commitc21e2e686fce7a7df5a933fd3bf06aa20e66c78b (patch)
tree483500a54064c878fd12196ca7fd1fad1177c064 /apps/plugins/rockboy
parentce1c189d509b1b88044f9821fa36f2461af07219 (diff)
downloadrockbox-c21e2e686fce7a7df5a933fd3bf06aa20e66c78b.zip
rockbox-c21e2e686fce7a7df5a933fd3bf06aa20e66c78b.tar.gz
rockbox-c21e2e686fce7a7df5a933fd3bf06aa20e66c78b.tar.bz2
rockbox-c21e2e686fce7a7df5a933fd3bf06aa20e66c78b.tar.xz
Calculate the optimal memory location for overlay plugins, and use plugin.lds for linking them. This gets rid of hand-adjusted archos.lds, making it easy to use overlay plugins on other lowmem targets. * Fix some duplicate and incorrect dependencies. * Change the way libs are filtered, so that a lib can be specified more than once. This allows to get rid of explicitly linking gcc-support.o, fixing empty plugins on some simulator platforms.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20163 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockboy')
-rw-r--r--apps/plugins/rockboy/archos.lds44
-rw-r--r--apps/plugins/rockboy/rockboy.make22
2 files changed, 11 insertions, 55 deletions
diff --git a/apps/plugins/rockboy/archos.lds b/apps/plugins/rockboy/archos.lds
deleted file mode 100644
index fcc3e6f..0000000
--- a/apps/plugins/rockboy/archos.lds
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "config.h"
-
-/* linker script for rockboy as an overlay,
- * only used/ necessary for SH-based archos targets */
-
-OUTPUT_FORMAT(elf32-sh)
-
-#define DRAMORIG 0x09000000
-#define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
-
-#define OVERLAY_LENGTH 0x68000
-#define OVERLAY_ORIGIN (DRAMORIG + (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - OVERLAY_LENGTH)
-
-MEMORY
-{
- OVERLAY_RAM : ORIGIN = OVERLAY_ORIGIN, LENGTH = OVERLAY_LENGTH
-}
-
-SECTIONS
-{
- .header : {
- _plugin_start_addr = .;
- KEEP(*(.header))
- } > OVERLAY_RAM
-
- .text : {
- *(.text*)
- } > OVERLAY_RAM
-
- .rodata : {
- *(.rodata*)
- } > OVERLAY_RAM
-
- .data : {
- *(.data*)
- } > OVERLAY_RAM
-
- .bss : {
- *(.bss*)
- *(COMMON)
- . = ALIGN(0x4);
- _plugin_end_addr = .;
- } > OVERLAY_RAM
-}
diff --git a/apps/plugins/rockboy/rockboy.make b/apps/plugins/rockboy/rockboy.make
index bce549c..ca0ed17 100644
--- a/apps/plugins/rockboy/rockboy.make
+++ b/apps/plugins/rockboy/rockboy.make
@@ -18,30 +18,30 @@ OTHER_SRC += $(ROCKBOY_SRC)
ifndef SIMVER
ifneq (,$(findstring RECORDER,$(TARGET)))
- ## archos recorder targets
- ROCKBOY_INLDS := $(ROCKBOY_SRCDIR)/archos.lds
+ ## lowmem targets
ROCKS += $(ROCKBOY_OBJDIR)/rockboy.ovl
+ ROCKBOY_OUTLDS = $(ROCKBOY_OBJDIR)/rockboy.link
+ ROCKBOY_OVLFLAGS = -T$(ROCKBOY_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
else
### all other targets
- ROCKBOY_INLDS := $(APPSDIR)/plugins/plugin.lds
ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock
endif
- ROCKBOY_OVLFLAGS = -T$(ROCKBOY_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
- ROCKBOY_OUTLDS = $(ROCKBOY_OBJDIR)/rockboy.lds
else
### simulator
ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock
- ROCKBOY_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile
endif
-$(ROCKBOY_OUTLDS): $(ROCKBOY_INLDS) $(ROCKBOY_OBJ)
- $(call PRINTS,PP $(<F))$(call preprocess2file,$<,$@)
+$(ROCKBOY_OBJDIR)/rockboy.rock: $(ROCKBOY_OBJ)
+
+$(ROCKBOY_OBJDIR)/rockboy.refmap: $(ROCKBOY_OBJ)
-$(ROCKBOY_OBJDIR)/rockboy.rock: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS) $(PLUGINBITMAPLIB)
+$(ROCKBOY_OUTLDS): $(PLUGIN_LDS) $(ROCKBOY_OBJDIR)/rockboy.refmap
+ $(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
+ $(TOOLSDIR)/ovl_offset.pl $(ROCKBOY_OBJDIR)/rockboy.refmap))
-$(ROCKBOY_OBJDIR)/rockboy.ovl: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS) $(PLUGINBITMAPLIB)
+$(ROCKBOY_OBJDIR)/rockboy.ovl: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS)
$(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
$(filter %.o, $^) \
- $(filter %.a, $^) \
+ $(filter %.a, $+) \
-lgcc $(ROCKBOY_OVLFLAGS)
$(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@