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: Andrew Lunn <andrew@lunn.ch>, ecos-discuss@sourceware.org
Subject: Re: [ECOS] ARM EABI port / static constructor priority removal
Date: Wed, 26 Mar 2008 18:25:00 -0000	[thread overview]
Message-ID: <20080326181817.GB5705@lunn.ch> (raw)
In-Reply-To: <F31C1582037F5041B0CD525FD870AE6A774245@ny2545.corp.bloomberg.com>

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

  reply	other threads:[~2008-03-26 18:18 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 [this message]
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
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=20080326181817.GB5705@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).