This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: having multiple copies of _GLOBAL__sub_I__xxxx which are calling std::ios_base::Init::Init()@GLIBCXX_3.4
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Klaus Rudolph <lts-rudolph at gmx dot de>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 10 Jul 2018 21:17:54 +0100
- Subject: Re: having multiple copies of _GLOBAL__sub_I__xxxx which are calling std::ios_base::Init::Init()@GLIBCXX_3.4
- References: <trinity-0368dc77-5ed8-4676-a0ef-a3bed7d0f690-1531222122549@3c-app-gmx-bs16>
On Tue, 10 Jul 2018 at 12:29, Klaus Rudolph <lts-rudolph@gmx.de> wrote:
>
> I see that gcc emits for every function which uses cout a global constructor call is emitted, even if the function is removed later during link stage.
I don't think it's true that it does it for every function. It does it
once per translation unit, not once per function. Your test is
misleading because you only have one function per TU.