mainthread.cxx - unaligned stack possible

Jonathan Larmour jifl@eCosCentric.com
Fri Mar 7 11:35:00 GMT 2003


Scott Furman wrote:
> 
> 
> eCos provides the stack for main() when building with libc startup 
> support and CYGSEM_LIBC_MAIN_STACK_FROM_SYSTEM is defined.  However, the 
> stack is declared as an array of  cyg_uint8, so there is the possibility 
> that it is unaligned.

Hmm.. I thought the linker was meant to do this for statics/globals. Oh 
well, let's err on the side of caution...

 > The attached trivial fix ensures that the stack
> is at least octlet-aligned.  (Does any architecture require an alignment 
> stricter than 8 bytes ?)

Some can. I've checked in a slightly better version (attached).

Jifl
-- 
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libc.stack.align.patch.txt
URL: <http://sourceware.org/pipermail/ecos-patches/attachments/20030307/9c5a147e/attachment.txt>


More information about the Ecos-patches mailing list