From 21d026d1d649331ae67316e84635abba0ca31fc7 Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Sat, 18 Jan 2014 23:11:25 +0100 Subject: coldfire: fix rom build Properly handle .init section in rom build and accomodate the change in crt0.S introduced in b31c856 Change-Id: Icbf26a87162165da149232de264dc3671ca8ae96 --- firmware/rom.lds | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'firmware') diff --git a/firmware/rom.lds b/firmware/rom.lds index e0ce0b1728..abfa311839 100644 --- a/firmware/rom.lds +++ b/firmware/rom.lds @@ -54,13 +54,20 @@ STARTUP(crt0.o) /* End of the audio buffer, where the codec/plugin buffer starts */ #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) +#define CODECORIG ENDAUDIOADDR + +/* .init is copied to codec buffer */ +#define INITORIG CODECORIG +#define INITSIZE CODECSIZE MEMORY { DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE + INIT : ORIGIN = INITORIG, LENGTH = INITSIZE } + SECTIONS { .flashheader : @@ -101,6 +108,7 @@ SECTIONS .text LOADADDR(.data) + SIZEOF(.data) : { *(.init.text) + KEEP(*(.startup*)); *(.text*) . = ALIGN(0x4); } > FLASH @@ -123,6 +131,17 @@ SECTIONS _iramend = .; } > IRAM +#ifdef HAVE_INIT_ATTR + .init INITORIG : AT ( _iramcopy + SIZEOF(.iram) ) + { + _initstart = .; + *(.init*) + *(.initdata*) + _initend = .; + } > INIT + _initcopy = LOADADDR(.init); +#endif + .ibss (NOLOAD) : { _iedata = .; -- cgit v1.2.3