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.tar.gz
rockbox-c21e2e686fce7a7df5a933fd3bf06aa20e66c78b.zip
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 fcc3e6f922..0000000000
--- a/apps/plugins/rockboy/archos.lds
+++ /dev/null
@@ -1,44 +0,0 @@
1#include "config.h"
2
3/* linker script for rockboy as an overlay,
4 * only used/ necessary for SH-based archos targets */
5
6OUTPUT_FORMAT(elf32-sh)
7
8#define DRAMORIG 0x09000000
9#define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
10
11#define OVERLAY_LENGTH 0x68000
12#define OVERLAY_ORIGIN (DRAMORIG + (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - OVERLAY_LENGTH)
13
14MEMORY
15{
16 OVERLAY_RAM : ORIGIN = OVERLAY_ORIGIN, LENGTH = OVERLAY_LENGTH
17}
18
19SECTIONS
20{
21 .header : {
22 _plugin_start_addr = .;
23 KEEP(*(.header))
24 } > OVERLAY_RAM
25
26 .text : {
27 *(.text*)
28 } > OVERLAY_RAM
29
30 .rodata : {
31 *(.rodata*)
32 } > OVERLAY_RAM
33
34 .data : {
35 *(.data*)
36 } > OVERLAY_RAM
37
38 .bss : {
39 *(.bss*)
40 *(COMMON)
41 . = ALIGN(0x4);
42 _plugin_end_addr = .;
43 } > OVERLAY_RAM
44}
diff --git a/apps/plugins/rockboy/rockboy.make b/apps/plugins/rockboy/rockboy.make
index bce549c43c..ca0ed17a0a 100644
--- a/apps/plugins/rockboy/rockboy.make
+++ b/apps/plugins/rockboy/rockboy.make
@@ -18,30 +18,30 @@ OTHER_SRC += $(ROCKBOY_SRC)
18 18
19ifndef SIMVER 19ifndef SIMVER
20ifneq (,$(findstring RECORDER,$(TARGET))) 20ifneq (,$(findstring RECORDER,$(TARGET)))
21 ## archos recorder targets 21 ## lowmem targets
22 ROCKBOY_INLDS := $(ROCKBOY_SRCDIR)/archos.lds
23 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.ovl 22 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.ovl
23 ROCKBOY_OUTLDS = $(ROCKBOY_OBJDIR)/rockboy.link
24 ROCKBOY_OVLFLAGS = -T$(ROCKBOY_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
24else 25else
25 ### all other targets 26 ### all other targets
26 ROCKBOY_INLDS := $(APPSDIR)/plugins/plugin.lds
27 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock 27 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock
28endif 28endif
29 ROCKBOY_OVLFLAGS = -T$(ROCKBOY_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
30 ROCKBOY_OUTLDS = $(ROCKBOY_OBJDIR)/rockboy.lds
31else 29else
32 ### simulator 30 ### simulator
33 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock 31 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock
34 ROCKBOY_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile
35endif 32endif
36 33
37$(ROCKBOY_OUTLDS): $(ROCKBOY_INLDS) $(ROCKBOY_OBJ) 34$(ROCKBOY_OBJDIR)/rockboy.rock: $(ROCKBOY_OBJ)
38 $(call PRINTS,PP $(<F))$(call preprocess2file,$<,$@) 35
36$(ROCKBOY_OBJDIR)/rockboy.refmap: $(ROCKBOY_OBJ)
39 37
40$(ROCKBOY_OBJDIR)/rockboy.rock: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS) $(PLUGINBITMAPLIB) 38$(ROCKBOY_OUTLDS): $(PLUGIN_LDS) $(ROCKBOY_OBJDIR)/rockboy.refmap
39 $(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
40 $(TOOLSDIR)/ovl_offset.pl $(ROCKBOY_OBJDIR)/rockboy.refmap))
41 41
42$(ROCKBOY_OBJDIR)/rockboy.ovl: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS) $(PLUGINBITMAPLIB) 42$(ROCKBOY_OBJDIR)/rockboy.ovl: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS)
43 $(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \ 43 $(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
44 $(filter %.o, $^) \ 44 $(filter %.o, $^) \
45 $(filter %.a, $^) \ 45 $(filter %.a, $+) \
46 -lgcc $(ROCKBOY_OVLFLAGS) 46 -lgcc $(ROCKBOY_OVLFLAGS)
47 $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@ 47 $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@