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

ccoutant at google dot com gcc-bugzilla@gcc.gnu.org
Tue Apr 17 22:00:00 GMT 2012


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

--- Comment #87 from ccoutant at google dot com 2012-04-17 21:52:12 UTC ---
> 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).

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).

-cary



More information about the Gcc-bugs mailing list