path: root/firmware/target/arm/crt0-pp.S
diff options
authorThomas Martitz <>2010-03-03 23:20:32 +0000
committerThomas Martitz <>2010-03-03 23:20:32 +0000
commitf8edc325896c9c24d7f32f4861a0b0d2a8b9f4cd (patch)
treeb2682307d01fffb54dd68e54b8f2e2986fe6bcc6 /firmware/target/arm/crt0-pp.S
parente479853f1542616dab56817c8f5326364b663c7c (diff)
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:// a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/crt0-pp.S')
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/target/arm/crt0-pp.S b/firmware/target/arm/crt0-pp.S
index 9c996960cc..4e16df0f7a 100644
--- a/firmware/target/arm/crt0-pp.S
+++ b/firmware/target/arm/crt0-pp.S
@@ -213,6 +213,19 @@ cpu_init:
strhi r5, [r3], #4
bhi 1b
+#ifdef INIT_ATTR
+ /* copy init code to codec buffer */
+ ldr r2, =_initstart
+ ldr r3, =_initend
+ ldr r4, =_initcopy
+ cmp r3, r2
+ ldrhi r5, [r4], #4
+ strhi r5, [r2], #4
+ bhi 1b
/* Zero out IBSS */
ldr r2, =_iedata
ldr r3, =_iend