From: Andrew Lunn <andrew@lunn.ch>
To: taiyun@sunnorth.com.cn
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] A problem about constructor sequence
Date: Tue, 11 Sep 2007 16:48:00 -0000 [thread overview]
Message-ID: <20070911164832.GJ3557@lunn.ch> (raw)
In-Reply-To: <OFAE4F14C8.27D51BC9-ON48257352.0032BD6A-48257352.0032BD79@sunnorth.com.cn>
[-- Attachment #1: Type: text/plain, Size: 739 bytes --]
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
[-- Attachment #2: startup.diff --]
[-- Type: text/x-diff, Size: 1481 bytes --]
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 <andrew.lunn@ascom.ch>
+
+ * 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 <gary@mlbassoc.com>
* 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 )
[-- Attachment #3: Type: text/plain, Size: 148 bytes --]
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next prev parent reply other threads:[~2007-09-11 16:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-10 9:14 taiyun
2007-09-10 9:35 ` Andrew Lunn
2007-09-10 9:54 ` Jonathan Larmour
[not found] ` <OFD56A862C.7D2739A1-ON48257352.003F8CFF-48257352.003FE916@sunnorth.com.cn>
2007-09-10 12:58 ` [ECOS] Re: ????: " Andrew Lunn
2007-09-11 16:48 ` Andrew Lunn [this message]
2007-09-10 11:47 taiyun
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=20070911164832.GJ3557@lunn.ch \
--to=andrew@lunn.ch \
--cc=ecos-discuss@ecos.sourceware.org \
--cc=taiyun@sunnorth.com.cn \
/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).