From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26889 invoked by alias); 26 Mar 2008 18:18:56 -0000 Received: (qmail 26878 invoked by uid 22791); 26 Mar 2008 18:18:55 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Mar 2008 18:18:37 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1JeaCX-0005pu-00; Wed, 26 Mar 2008 19:18:17 +0100 Date: Wed, 26 Mar 2008 18:25:00 -0000 From: Andrew Lunn To: Chris Zimman Cc: Andrew Lunn , ecos-discuss@sourceware.org Message-ID: <20080326181817.GB5705@lunn.ch> Mail-Followup-To: Chris Zimman , Andrew Lunn , ecos-discuss@sourceware.org References: <20080326180616.GA5705@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] ARM EABI port / static constructor priority removal X-SW-Source: 2008-03/txt/msg00154.txt.bz2 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