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/05/19 20:41:44 UTC

[GitHub] [incubator-nuttx] patacongo commented on pull request #3747: mm:initialize ensure alignment.

patacongo commented on pull request #3747:
URL: https://github.com/apache/incubator-nuttx/pull/3747#issuecomment-844456703


   I don't believe this is a problem.  The alignment is handled at link time by the linker script.
   
   NOTE:
   
   > where HEAP_BASE is &_bss + CONFIG_IDLE_STACKSIZE.
   
   Actually _ebss, not _bss.  _ebss should be the end+1 address of .bss
   
   For stm32f4discovery:
   
       .bss : ALIGN(4) {
           _sbss = ABSOLUTE(.);
           *(.bss .bss.*)
           *(.gnu.linkonce.b.*)
           *(COMMON)
           . = ALIGN(4);
           _ebss = ABSOLUTE(.);
       } > sram
   
   So _ebss will always be aligned.  A three byte misalignment is impossible.  But there could still be an alignment issue since the stack requires 16-byte alignment.
   
   I would think that the correct fix might be to change this to ALIGN(16) in the linker script?
   
   


-- 
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