http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51910
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2012-01-23 CC| |jason at gcc dot gnu.org, | |sandra at codesourcery dot | |com Ever Confirmed|0 |1 --- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-23 21:54:29 UTC --- Smaller testcase: template<typename T> struct Foo { virtual ~Foo() { } }; int main( int, char*[] ) { Foo<int> test; } rm -f wa.rpo && g++ -c -frepo wa.C && g++ wa.o The problem is that the linker is demangling symbols, so collect2 can't tell the difference between the different destructor variants and keeps trying to adjust the first one when it's not the problem. You can work around this by linking with -Wl,--no-demangle This bug was caused by 2011-07-24 Sandra Loosemore <san...@codesourcery.com> * configure.ac (demangler_in_ld): Default to yes. * configure: Regenerated. * collect2.c (main): When HAVE_LD_DEMANGLE is defined, don't mess with COLLECT_NO_DEMANGLE, and just pass --demangle and --no-demangle options straight through to ld. When HAVE_LD_DEMANGLE is not defined, set COLLECT_NO_DEMANGLE in a way that has the intended effect on Windows.