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]

Re: Default init_priority for C++ c'tors ??


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


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