This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: order of calling for static initializers


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.&nbsp; I had to change the linker script to use .init_array* and
> .fini_array* instead of .ctor and .dtor.<br>
> <br>
> 2.&nbsp; I had to reverse the order in which static initializers are called
> in the cyg_hal_invoke_constructors function my architectures'
> hal_misc.c.&nbsp; 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]