http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53572
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2012-06-04 CC| |hjl at gcc dot gnu.org Version|unknown |4.7.1 Ever Confirmed|0 |1 --- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-04 12:53:16 UTC --- Confirmed. I see the resolution file 1 main.o 6 252 65004255f21c98f6 PREVAILING_DEF main 263 65004255f21c98f6 RESOLVED_EXEC _ZdlPv 270 65004255f21c98f6 RESOLVED_EXEC _Z1fv 202 65004255f21c98f6 PREVAILING_DEF _ZTI1A 225 65004255f21c98f6 PREVAILING_DEF _ZTS1A 213 65004255f21c98f6 RESOLVED_EXEC _ZTVN10__cxxabiv117__class_type_infoE But the error message `_ZTI1A' referenced in section `.rodata._ZTV1A[_ZTV1A]' of lib.a(lib.o): defined in discarded section `.gnu.linkonce.t._ZTI1A' of main.o (symbol from plugin) collect2: error: ld returned 1 exit status suggests this is a linker bug? Either LTO decides to drop _ZTI1A from main.o - which it can - then the linker needs to re-scan the archives and resolve the symbol to the archive provided one: > nm lib.o 0000000000000000 t _GLOBAL__sub_I_a 0000000000000000 T _Z1fv 0000000000000000 W _ZN1AD0Ev 0000000000000000 W _ZN1AD1Ev 0000000000000000 W _ZN1AD2Ev 0000000000000000 n _ZN1AD5Ev 0000000000000000 V _ZTI1A 0000000000000000 V _ZTS1A 0000000000000000 V _ZTV1A U _ZTVN10__cxxabiv117__class_type_infoE U _ZdlPv U __cxa_atexit U __dso_handle 0000000000000000 B a Thus, can you file a binutils bug?