http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770
--- Comment #89 from Taras Glek <tglek at mozilla dot com> 2012-04-17 23:58:00 UTC --- (In reply to comment #87) > > Just as a quick reminder, the reversed ctor execution order is big > > performance > > problem for C++ Apps inlcuding Mozilla and Chrome ;) > > So whatever we do, I would preffer to not have it by default. > > If the issue is the iteration over the contents of the final > .init_array section, this solution won't have that problem -- the > loader will still execute .init_array entries in forward order (we'll > be reversing them at link time). Your solution will reverse order of reference of .init_array entries with regards to the linker commandline. Linking translation units A B C, will result in C B A execution order. Unless you also change the linker to combine the translation units backwards(vs sequentially as is normal), this will ruin startup speed of chrome/firefox and every other large c++ program. > > If the issue is the code layout of the ctors themselves, that sounds > like something that could be fixed through code layout optimizations > (e.g., gold's --section-ordering-file option). Every single app would have to add this flag for good perf so some legacy build system can avoid reordering the .init_array section using a non-default flag.