You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/04/05 12:40:19 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #3311: arm: fix the potential corruption in initialization

xiaoxiang781216 commented on pull request #3311:
URL: https://github.com/apache/incubator-nuttx/pull/3311#issuecomment-813372814


   > @xiaoxiang781216 - what was the motivation for these changes?
   > 
   > Isn't the SP is set from the Vector table on reset?
   > 
   
   No, only ARM-M will automatically initialize SP from vector table, other variants(old arm, ARM-A, ARM-R) need initialize manually.
    
   > If there are any alignment/overlap issues bss on to data, then zeroing after setting would cause an issues.
   
   Because the below loop copy 32 bytes in each iteration:
   ```
   ifdef CONFIG_BOOT_RUNFROMFLASH
   	adr		r3, .Ldatainit
   	ldmia		r3, {r0, r1, r2}
   
   1:	ldmia		r0!, {r3 - r10}
   	stmia		r1!, {r3 - r10}
   	cmp		r1, r2
   	blt		1b
   
   #endif
   ```
   The head of .bss section may initialze to nonzero value after loop.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org