This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: order of calling for static initializers
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Tom Malcolmson <Tom at Malcolmson dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org, andrew at lunn dot ch
- Date: Wed, 29 Nov 2006 04:23:32 +0100
- Subject: Re: [ECOS] order of calling for static initializers
- References: <456B56ED.7040908@Malcolmson.com> <20061127222907.GA6436@lunn.ch> <456CC97B.9020903@Malcolmson.com>
On Tue, Nov 28, 2006 at 06:42:51PM -0500, Tom Malcolmson wrote:
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
> </head>
> <body bgcolor="#ffffff" text="#000000">
> Thanks Andrew.<br>
> <br>
> It seems to be working now, but, for the record, I'll list the changes
> that I had to make to get the initializers called in the right order
> using CodeSorcery tools.<br>
> <br>
> I know that these changes solved my problems, but my explanations are
> uncertain.<br>
> <br>
> 1. I had to change the linker script to use .init_array* and
> .fini_array* instead of .ctor and .dtor.<br>
> <br>
> 2. I had to reverse the order in which static initializers are called
> in the cyg_hal_invoke_constructors function my architectures'
> hal_misc.c. From what you (Andrew) say this is because the SORT linker
> command causes the sections to be sorted in reverse order with cygwin
> but not with CS.<br>
Just for the record, this has nothing to do with cygwin. Its plain gcc
verses CS. I was using the Linux version of the tools when i look at
the order SORT produces.
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