public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Chris Zimman <czimman@bloomberg.com>
Cc: ecos-discuss@sourceware.org
Subject: Re: [ECOS] ARM EABI port / static constructor priority removal
Date: Wed, 26 Mar 2008 18:56:00 -0000	[thread overview]
Message-ID: <20080326185037.GD5705@lunn.ch> (raw)
In-Reply-To: <F31C1582037F5041B0CD525FD870AE6A774247@ny2545.corp.bloomberg.com>

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

  reply	other threads:[~2008-03-26 18:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-26 18:06 Chris Zimman
2008-03-26 18:09 ` Andrew Lunn
2008-03-26 18:18   ` Chris Zimman
2008-03-26 18:25     ` Andrew Lunn
2008-03-26 18:32       ` Chris Zimman
2008-03-26 18:38         ` Andrew Lunn
2008-03-26 18:42           ` Chris Zimman
2008-03-26 18:56             ` Andrew Lunn [this message]
2008-03-26 19:10               ` Chris Zimman
2008-04-02 14:20                 ` Jonathan Larmour
2008-04-02 14:52                   ` Chris Zimman
2008-03-26 20:47           ` Fabian Scheler
2008-03-27  1:53             ` Chris Zimman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080326185037.GD5705@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=czimman@bloomberg.com \
    --cc=ecos-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).