From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32132 invoked by alias); 11 Sep 2007 16:48:43 -0000 Received: (qmail 32117 invoked by uid 22791); 11 Sep 2007 16:48:43 -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; Tue, 11 Sep 2007 16:48:39 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1IV8ue-0000QS-00; Tue, 11 Sep 2007 18:48:32 +0200 Date: Tue, 11 Sep 2007 16:48:00 -0000 From: Andrew Lunn To: taiyun@sunnorth.com.cn Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20070911164832.GJ3557@lunn.ch> Mail-Followup-To: taiyun@sunnorth.com.cn, ecos-discuss@ecos.sourceware.org References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) 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] A problem about constructor sequence X-SW-Source: 2007-09/txt/msg00060.txt.bz2 --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 739 On Mon, Sep 10, 2007 at 05:14:13PM +0800, taiyun@sunnorth.com.cn wrote: > > Dear all: > > I want to discuss something about eCos kernel, BUT I am not sure whether my > opinion is correct or someone has reported this problem before. > I think there is a problem with global constructor sequence. There are two > global instances, not only they have the same initialized priority but also > they have some relationship between each other. They are: > > Cyg_Thread cyg_libc_main_thread CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_LIBC) = ... > AND > static cyg_libc_startup_dummy_constructor_class cyg_libc_startup_obj > CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_LIBC); Here is the patch i have committed to CVS. Andrew --nFreZHaLTZJo0R7j Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="startup.diff" Content-length: 1481 Index: language/c/libc/startup/current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/startup/current/ChangeLog,v retrieving revision 1.9 diff -u -r1.9 ChangeLog --- language/c/libc/startup/current/ChangeLog 2 Jul 2007 11:48:59 -0000 1.9 +++ language/c/libc/startup/current/ChangeLog 11 Sep 2007 16:47:46 -0000 @@ -1,3 +1,9 @@ +2007-09-11 Andrew Lunn + + * src/cstartup.cxx: Change the INIT priority of + cyg_libc_startup_obj so that it is always called after the thread + has been constructed. Reported by taiyun@sunnorth.com.cn + 2007-07-02 Gary Thomas * cdl/startup.cdl: Add (char *) casts to make GCC/4.2.x happy. Index: language/c/libc/startup/current/src/cstartup.cxx =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/startup/current/src/cstartup.cxx,v retrieving revision 1.3 diff -u -r1.3 cstartup.cxx --- language/c/libc/startup/current/src/cstartup.cxx 23 May 2002 23:07:11 -0000 1.3 +++ language/c/libc/startup/current/src/cstartup.cxx 11 Sep 2007 16:47:46 -0000 @@ -104,7 +104,7 @@ }; static cyg_libc_startup_dummy_constructor_class cyg_libc_startup_obj - CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_LIBC); + CYGBLD_ATTRIB_INIT_AFTER(CYG_INIT_LIBC); #elif defined( CYGSEM_LIBC_STARTUP_MAIN_INITCONTEXT ) --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-length: 148 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss --nFreZHaLTZJo0R7j--