summaryrefslogtreecommitdiffstats
path: root/firmware/target/coldfire/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/crt0.S')
-rw-r--r--firmware/target/coldfire/crt0.S21
1 files changed, 12 insertions, 9 deletions
diff --git a/firmware/target/coldfire/crt0.S b/firmware/target/coldfire/crt0.S
index dbf01a347c..bc8a370823 100644
--- a/firmware/target/coldfire/crt0.S
+++ b/firmware/target/coldfire/crt0.S
@@ -234,15 +234,8 @@ start:
movec.l %d0,%acr1
#ifndef BOOTLOADER
- /* zero out .ibss */
- lea _iedata,%a2
- lea _iend,%a4
- bra.b .iedatastart
-.iedataloop:
- clr.l (%a2)+
-.iedatastart:
- cmp.l %a2,%a4
- bhi.b .iedataloop
+ /* .iram copy is done first since it is reclaimed for other
+ * uninitialized sections */
/* copy the .iram section */
lea _iramcopy,%a2
@@ -254,6 +247,16 @@ start:
.iramstart:
cmp.l %a3,%a4
bhi.b .iramloop
+
+ /* zero out .ibss */
+ lea _iedata,%a2
+ lea _iend,%a4
+ bra.b .iedatastart
+.iedataloop:
+ clr.l (%a2)+
+.iedatastart:
+ cmp.l %a2,%a4
+ bhi.b .iedataloop
#endif /* !BOOTLOADER */
#ifdef IRIVER_H300_SERIES