This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50986] weak static data members with constant initializers emitted in .rodata, leading to segfault on startup
- From: "rafael.espindola at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Oct 2014 13:11:31 +0000
- Subject: [Bug c++/50986] weak static data members with constant initializers emitted in .rodata, leading to segfault on startup
- Auto-submitted: auto-generated
- References: <bug-50986-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50986
--- Comment #3 from Rafael Avila de Espindola <rafael.espindola at gmail dot com> ---
In clang this was fixed by putting a .init_array section in the same comdat as
the variable it is initializing. That way if the variable is dropped, so is the
initialization code.