arch/arm: Clear .bss section after copying .data section

to avoid batch copy(32 bytes) overwrite the zeroed .bss section

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-04-01 18:31:11 +08:00 committed by David Sidrane
parent d1e06b4c09
commit be50a24e3d

View File

@ -68,15 +68,6 @@ __start:
showprogress 'A' showprogress 'A'
/* Clear system BSS section */
mov r0, #0
1: cmp r4, r5
strcc r0, [r4], #4
bcc 1b
showprogress 'B'
/* Copy system .data sections to new home in RAM. */ /* Copy system .data sections to new home in RAM. */
#ifdef CONFIG_BOOT_RUNFROMFLASH #ifdef CONFIG_BOOT_RUNFROMFLASH
@ -84,13 +75,22 @@ __start:
adr r3, .Ldatainit adr r3, .Ldatainit
ldmia r3, {r0, r1, r2} ldmia r3, {r0, r1, r2}
1: ldmia r0!, {r3 - r10} 1: ldmia r0!, {r3, r6 - r12}
stmia r1!, {r3 - r10} stmia r1!, {r3, r6 - r12}
cmp r1, r2 cmp r1, r2
blt 1b blt 1b
#endif #endif
showprogress 'B'
/* Clear system BSS section */
mov r0, #0
1: cmp r4, r5
strcc r0, [r4], #4
bcc 1b
/* Perform early serial initialization */ /* Perform early serial initialization */
mov fp, #0 mov fp, #0