This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/46770] Replace .ctors/.dtors with .init_array/.fini_array on targets supporting them
- From: "ccoutant at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 14 Dec 2010 01:24:39 +0000
- Subject: [Bug target/46770] Replace .ctors/.dtors with .init_array/.fini_array on targets supporting them
- Auto-submitted: auto-generated
- References: <bug-46770-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770
--- Comment #56 from Cary Coutant <ccoutant at gcc dot gnu.org> 2010-12-14 01:24:30 UTC ---
> H.J, Cary is talking about multiple global constructors in a single file, none
> of which use constructor priorities. In other words, the normal case. gcc
> generates those in a specific required order for the .ctors section. If it
> does not reverse the order for .init_array, I don't see how it could possible
> work correctly.
>
> Again: a single file, no priorities specified.
Right. I looked deeper and now see that gcc generates a single function per CU
that runs all the static constructors for that CU, then adds that single entry
to the .ctors section. So my concern was groundless -- the order of
constructors within the CU is controlled by the code in that one function.
-cary