From 8aa84f4a6404d94dbd3d62aee50c18756c163dee Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Sat, 24 Jul 2004 17:56:38 +0000 Subject: Major fixes to please newer versions of the linker git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4936 a1c6a512-1295-4272-9138-f99709370657 --- firmware/app.lds | 58 +++++++++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 30 deletions(-) (limited to 'firmware') diff --git a/firmware/app.lds b/firmware/app.lds index bacc645044..015ed70bd8 100644 --- a/firmware/app.lds +++ b/firmware/app.lds @@ -104,39 +104,53 @@ SECTIONS { *(.resetvectors); *(.vectors); - . = ALIGN(0x200); - *(.init.text) } > DRAM .text : { + . = ALIGN(0x200); + *(.init.text) *(.text) . = ALIGN(0x4); } > DRAM - .data : + .rodata : { - *(.data) + *(.rodata) + *(.rodata.str1.4) . = ALIGN(0x4); - _datacopy = .; /* dummy here, only for ROM based */ - _datastart = .; - _dataend = .; + + /* Pseudo-allocate the copies of the data sections */ + _datacopy = .; } > DRAM - .rodata : + /* TRICK ALERT! For RAM execution, we put the .data section at the + same load address as the copy. Thus, we don't waste extra RAM + when we don't actually need the copy. */ + .data : AT ( _datacopy ) { - *(.rodata) - *(.rodata.str1.4) + _datastart = .; + *(.data) . = ALIGN(0x4); + _dataend = .; + _iramcopy = .; } > DRAM - .stack : + .iram 0xf000000 : AT ( _iramcopy) + { + _iramstart = .; + *(.icode) + *(.idata) + _iramend = .; + } > IRAM + + /* TRICK ALERT! We want 0x2000 bytes of stack, but we set the section + size smaller, and allow the stack to grow into the .iram copy */ + .stack ADDR(.data)+SIZEOF(.data) + SIZEOF(.iram): { *(.stack) _stackbegin = .; - /* We put the copy of the .iram section here to save space */ - _iramcopy = .; - . += 0x2000; + . += 0x2000-SIZEOF(.iram); _stackend = .; } > DRAM @@ -148,15 +162,6 @@ SECTIONS _end = .; } > DRAM -#ifdef DEBUG - .heap : - { - _poolstart = .; - . = 0x20000; - _poolend = .; - } > DRAM -#endif - .mp3buf : { _mp3buffer = .; @@ -172,12 +177,5 @@ SECTIONS _pluginbuf = .; } - .iram 0xf000000 : AT ( _iramcopy ) - { - _iramstart = .; - *(.icode) - *(.idata) - _iramend = .; - } > IRAM #endif } -- cgit v1.2.3