https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65074
Bug ID: 65074 Summary: [5 Regression] r220674 broke C++ PIEs Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org CC: hjl at gcc dot gnu.org, rth at gcc dot gnu.org namespace std { template <typename _CharT> struct char_traits; template <typename _CharT, typename = char_traits <_CharT> > class basic_filebuf; template <typename _CharT, typename = char_traits <_CharT> > class basic_ifstream; typedef basic_ifstream <char> ifstream; enum _Ios_Openmode { _S_in }; class basic_streambuf { }; struct basic_ios { typedef char char_type; void init (void *); typedef _Ios_Openmode openmode; }; template <typename _CharT> class __basic_file; template <> struct __basic_file <char> { __basic_file (); ~__basic_file (); }; template <typename, typename _Traits> struct basic_filebuf : public basic_streambuf { __basic_file <char> _M_file; ~basic_filebuf () { this->close (); } void close (); }; template <typename, typename _Traits> struct basic_ifstream : basic_ios { typedef _Traits traits_type; basic_filebuf <char_type, traits_type> _M_filebuf; basic_ifstream (); basic_ifstream (const char *, basic_ios::openmode = _S_in) { this->init (0); } }; extern template class basic_filebuf <char>; ifstream f (0); } with -O2 -fpie starting with r220674 uses call _ZNSt13basic_filebufIcSt11char_traitsIcEED1Ev instead of call _ZNSt13basic_filebufIcSt11char_traitsIcEED1Ev@PLT that was used previously, despite that symbol being defined in libstdc++.so.6.