In message <[EMAIL PROTECTED]>
          Lee Noar <[EMAIL PROTECTED]> wrote:

> alan buckley wrote:
> 
> [snip details of C++ program crash]
> 
> >> Basically, the order of execution is:
> >>
> >> 1) UnixLib initialisation
> >> 2) Global object constructors called (IIRC, the order the constructors
> >> are called is the same as the order they appear on the linker's command
> >> line).
> >> 3) main() called.
> > 
> > I tried creating dummy global classes in the first and last object files on
> > the linker command line that just did a printf and I still got nothing in
> > my redirected output file.
> > 
> > Do you know if global objects in the libraries may be being created first?
> 
> A quick google, for example:
> 
> <http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.12>
> 
> shows that it is impossible to create global static objects in a 
> specific order, so my memory in point 2 above was wrong. It may work one 
> day but not the next. It seems likely that the authors of wesnoth would 
> know this and avoid it, so perhaps that is not the problem.

FYI, from GCC 4.3 onwards the ARM EABI backend supports the GCC attribute
init_priority extension to define the order of initialisation of such
objects.  This was the change:
<URL:http://gcc.gnu.org/ml/gcc-patches/2006-11/msg00102.html>

John.
-- 
John Tytgat, in his comfy chair at home                                 BASS
[EMAIL PROTECTED]                             ARM powered, RISC OS driven

_______________________________________________
GCCSDK mailing list [email protected]
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

Reply via email to