This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]