This is the mail archive of the ecos-discuss@sourceware.org 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: ARM EABI port / static constructor priority removal


On Wed, Mar 26, 2008 at 02:09:31PM -0400, Chris Zimman wrote:
> > Given that this is used in a number of places scattered all over the
> > code, how do you propose to do this? What is you concept to ensure the
> > constructors are called in the right order?
> 
> Ordering is preserved within one translation unit by C++ spec, just not
> between multiple translation units.

This won't work. For example, some watchdog drivers need the I2C
subsystem to be initialized before they can be initialized. The IO
layer must be initialised before libc etc. If you get these in the
wrong order, expect bad things to happen.

In general, it is assumed gcc is used and that the gcc extensions
work. There have been a few attempts to use compilers other than gcc,
but i don't remember anybody ever says they have it working well.

As a side question, how well does function sections work with your
compiler? This is another gcc extension which eCos heavily uses in
order to keep the image size down. Also HAL tables? These also rely on
sorting otherwise the start and end won't be in the right place.

      Andrew

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


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