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:38:29PM -0400, Chris Zimman wrote:
> > So back to my original question, what is your concept for replacing
> > them with something else. How are you going to ensure things happen in
> > the right order.
> 
> One possibility is to put them all in one translation unit.  They are
> constructed in the order that they appear, although that's kind of a big
> kludge.

Agreed. So lets forget about that.

> Another is to add explicit initialization calls to the various bits to invoke
> the constructors at runtime.

Also ugly. You break the nice packing model. Say i have an out of tree
package, a device driver for the wall clock on my hardware. The
current code allows my code to have a static initializer with priority
that is after I2C is up and running and it is totally independent of
the in tree code. I don't need to modify the in tree code at all. The
linker sorts it all out. Your suggestion would force me to modify the
in tree list of constructors.

The same could be said for application code. My application wants a
static constructor called after the OS is up an running, but before
main() is called. Should i modify the OS to list my application
constructors?

        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]