https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67650
--- Comment #35 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #34) > __attribute__((weak)) void f() { } This is here so that I() { f(); } doesn't get inlined (because the compiler can't know what f() does, since it might get replaced during linking). Without a call to some non-inlinable function it links OK. For the version in comment 29 the std::string constructor and destructor served that purpose, because they're defined in libstdc++.so and not inlined.