[Bug other/46770] Replace .ctors/.dtors with .init_array/.fini_array on targets supporting them

ian at airs dot com gcc-bugzilla@gcc.gnu.org
Sun Apr 22 22:28:00 GMT 2012


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

--- Comment #104 from Ian Lance Taylor <ian at airs dot com> 2012-04-22 22:26:50 UTC ---
I'm not sure what you mean.  Each object file will have a .init_array section. 
The linker will assemble those sections in the usual manner.

The order of global constructors in a single translation unit is fixed by the
language standard.  The thing that is not fixed is the order between
translation units.  So each object file will have a .init_array section that
will typically contain only a single pointer.  The order in which those input
.init_array sections are combined into an output .init_array section will
determine the order in which the constructors are run.



More information about the Gcc-bugs mailing list