http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770

--- Comment #9 from Mike Hommey <mh+gcc at glandium dot org> 2010-12-11 
14:36:36 UTC ---
(In reply to comment #7)
> Hi,
> thanks for testcase.  What I was concerned about is the static linking case.
> When you have static library with constructors and main program with
> constructors, my understanding was that the reverse execution order of .ctor
> section was designed in a way so library even in this case is initialized
> first.

This explanation doesn't stand: for instance, ARM EABI exclusively uses
.init_array, and the execution order for those is forward. And when linking
static libraries, the order of the function pointers in the section is strictly
growing, which means libraries are being initialized last.

Reply via email to