This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Main stack alignment
- From: "Daniel Lidsten" <Daniel dot Lidsten at combitechsystems dot com>
- To: "ecos discuss list" <ecos-discuss at sources dot redhat dot com>
- Date: Thu, 15 May 2003 18:02:38 +0200
- Subject: [ECOS] Main stack alignment
Hi,
When i allocate two structures in the main loop then they will be place
with an 8 bytes alignment in the main_stack. Why is that?
The stack is declared as:
static cyg_uint8 cyg_libc_main_stack[
CYGNUM_LIBC_MAIN_DEFAULT_STACK_SIZE ] in mainthread.cxx;
...and placed in the .bss section by the linker script.
The odd thing is that if i declare my structures as static or make them
global, then they are 2-byte aligned. How come? I want my structures to
be 2 byte aligned even when i declare them inside main.
Regards, Daniel
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss