FS#10756 - Free unused init code

Introduce a new .init section for initialisation code, so that it can be copied to an area which is later overwritten before calling. The stack/bss can then overwrite that code, effectively freeing the code size that the initialisation routines need. Gives a few kB ram usage back.
Only implemented for PP and as3525 so far. More targets could be added, as well as more functions.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25013 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2010-03-03 23:20:32 +00:00
parent e479853f15
commit f8edc32589
33 changed files with 98 additions and 37 deletions

View file

@ -37,8 +37,8 @@ STARTUP(target/arm/crt0-pp.o)
MEMORY
{
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
}
SECTIONS
@ -126,6 +126,17 @@ SECTIONS
_iramcopy = LOADADDR(.iram);
.init ENDAUDIOADDR :
{
. = ALIGN(4);
_initstart = .;
*(.init)
_initend = .;
} AT> DRAM
_initcopy = LOADADDR(.init);
.idle_stacks (NOLOAD) :
{
*(.idle_stacks)
@ -175,6 +186,7 @@ SECTIONS
.audiobuf (NOLOAD) :
{
_audiobuffer = .;
. = ALIGN(0x4);
audiobuffer = .;
} > DRAM