[ECOS] Default init_priority for C++ c'tors ??

Jim Li jyl087@netscape.net
Sat Sep 28 17:36:00 GMT 2002


Jonathan,

Thanks for the tip on the linker map! Sometimes it takes a wacky problem 
to force one to learn something new about the system.

Turns out that I had several "user" (i.e. not eCos kernel) static 
constructors. It was a bug in an unrelated constructor which was 
failing, and furthermore, killing the "start" thread, thus preventing 
the remaining c'tors from executing.

When I set a higher priority to my other constructor, it was allowed to 
initialize before the buggy one killed the start chain.

Thanks again for the tip.

/Jim

Jonathan Larmour wrote:

> jyl087@netscape.net wrote:
>
>> I'm having some trouble with static C++ constructors. It seems that
>> without the __attribute__((init_priority (xxx)) modifier, my
>> C++ globals don't get initialized.
>
>
> Sounds like a GCC issue in some way. Creating a linker map should 
> identify where the ctors are going ( -Wl,-Map,foo to create a map file 
> named foo).
>
>> According to the eCos documentation, C++ globals without the 
>> init_priority attribute get initialized last. In my case, they're
>> never initialized.
>
>
> Are you sure _any_ are? Have you used the tools you've built 
> successfully before?
>
> Jifl




-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list