From c21e2e686fce7a7df5a933fd3bf06aa20e66c78b Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 2 Mar 2009 00:16:44 +0000 Subject: 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 --- apps/plugins/chessbox/archos.lds | 44 ------------------------------------- apps/plugins/chessbox/chessbox.make | 22 +++++++++---------- 2 files changed, 11 insertions(+), 55 deletions(-) delete mode 100644 apps/plugins/chessbox/archos.lds (limited to 'apps/plugins/chessbox') diff --git a/apps/plugins/chessbox/archos.lds b/apps/plugins/chessbox/archos.lds deleted file mode 100644 index a419fce..0000000 --- a/apps/plugins/chessbox/archos.lds +++ /dev/null @@ -1,44 +0,0 @@ -#include "config.h" - -/* linker script for chessbox 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 0x30000 -#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/chessbox/chessbox.make b/apps/plugins/chessbox/chessbox.make index 220f083..43df3ab 100644 --- a/apps/plugins/chessbox/chessbox.make +++ b/apps/plugins/chessbox/chessbox.make @@ -17,20 +17,17 @@ OTHER_SRC += $(CHESSBOX_SRC) ifndef SIMVER ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) - ## archos recorder targets - CHESSBOX_INLDS := $(CHESSBOX_SRCDIR)/archos.lds + ### lowmem targets ROCKS += $(CHESSBOX_OBJDIR)/chessbox.ovl + CHESSBOX_OUTLDS = $(CHESSBOX_OBJDIR)/chessbox.link + CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map else ### all other targets - CHESSBOX_INLDS := $(APPSDIR)/plugins/plugin.lds ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock endif - CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map - CHESSBOX_OUTLDS = $(CHESSBOX_OBJDIR)/chessbox.lds else ### simulator ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock - CHESSBOX_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile endif ifeq ($(CPU),sh) @@ -40,15 +37,18 @@ else CHESSBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2 endif -$(CHESSBOX_OUTLDS): $(CHESSBOX_INLDS) $(CHESSBOX_OBJ) - $(call PRINTS,PP $(