http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50381
Bug #: 50381 Summary: Wrong dtor condatgroup section name Classification: Unclassified Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: hubi...@gcc.gnu.org Created attachment 25260 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25260 testcase. Currently openoffice build dies with: /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ../../../unxlngx6.pro/obj/hi_factory.o: in function vtable for HtmlFactory_Idl:hi_factory.cxx(.rodata._ZTV15HtmlFactory_Idl+0x10): warning: relocation refers to discarded section /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: hidden symbol '_ZN15HtmlFactory_IdlD1Ev' is not defined locally collect2: error: ld returned 1 exit status The problem seems to be dtor output as: .section .text._ZN15HtmlFactory_IdlD2Ev,"axG",@progbits,_ZN15HtmlFactory_IdlD5Ev,comdat .align 2 .p2align 4,,15 .weak _ZN15HtmlFactory_IdlD2Ev .hidden _ZN15HtmlFactory_IdlD2Ev .type _ZN15HtmlFactory_IdlD2Ev, @function _ZN15HtmlFactory_IdlD2Ev: .LFB2389: .cfi_startproc movq $_ZTV15HtmlFactory_Idl+16, (%rdi) addq $16, %rdi jmp _ZN11OutputStackD1Ev .cfi_endproc .LFE2389: .size _ZN15HtmlFactory_IdlD2Ev, .-_ZN15HtmlFactory_IdlD2Ev .weak _ZN15HtmlFactory_IdlD1Ev .hidden _ZN15HtmlFactory_IdlD1Ev .set _ZN15HtmlFactory_IdlD1Ev,_ZN15HtmlFactory_IdlD2Ev and used only as _ZN15HtmlFactory_IdlD1Ev The following patch is needed to output the alias at all: Index: cgraphunit.c =================================================================== --- cgraphunit.c (revision 178757) +++ cgraphunit.c (working copy) @@ -1757,6 +1757,7 @@ int i; struct ipa_ref *ref; + for (e = node->callers; e;) if (e->caller->thunk.thunk_p) { @@ -1772,9 +1773,12 @@ if (ref->use == IPA_REF_ALIAS) { struct cgraph_node *alias = ipa_ref_refering_node (ref); + bool saved_written = TREE_ASM_WRITTEN (alias->thunk.alias); + TREE_ASM_WRITTEN (alias->thunk.alias) = 1; assemble_alias (alias->decl, DECL_ASSEMBLER_NAME (alias->thunk.alias)); assemble_thunks_and_aliases (alias); + TREE_ASM_WRITTEN (alias->thunk.alias) = saved_written; } } but it is not enough to solve the problem. Testcase is built as /abuild/jh/trunk-install/bin/g++ -fuse-linker-plugin -fmessage-length=0 -c -O2 -DENABLE_LAYOUT=0 -DENABLE_LAYOUT_EXPERIMENTAL=0 -I. -I../../../unxlngx6.pro/inc/display_idl -I../inc -I../../../source/inc -I../../../inc/pch -I../../../inc -I../../../unx/inc -I../../../unxlngx6.pro/inc -I. -I/abuild/jh/libreoffice/core/solver/unxlngx6.pro/inc/stl -I/abuild/jh/libreoffice/core/solver/unxlngx6.pro/inc/external -I/abuild/jh/libreoffice/core/solver/unxlngx6.pro/inc -I/abuild/jh/libreoffice/core/solenv/unxlngx6/inc -I/abuild/jh/libreoffice/core/solenv/inc -I/abuild/jh/libreoffice/core/res -I/abuild/jh/libreoffice/core/solenv/inc/Xp31 -I/usr/lib64/jvm/java-1_6_0-ibm-1.6.0/include -I/usr/lib64/jvm/java-1_6_0-ibm-1.6.0/include/linux -I/usr/lib64/jvm/java-1_6_0-ibm-1.6.0/include/native_threads/include -I/abuild/jh/libreoffice/core/solver/unxlngx6.pro/inc/udkapi -I/abuild/jh/libreoffice/core/solver/unxlngx6.pro/inc/offapi -I/abuild/jh/libreoffice/core/solver/unxlngx6.pro/inc/oovbaapi -I. -I../../../res -I. -pipe -fvisibility-inlines-hidden -std=c++0x -Wno-deprecated-declarations -Wall -Wextra -Wendif-labels -Wshadow -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Woverloaded-virtual -frtti -DLINUX -DUNX -DVCL -DGCC -DX86_64 -DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DHAVE_GCC_VISIBILITY_FEATURE -DX86_64 -D__DMAKE -DUNIX -DCPPU_ENV=gcc3 -DGXX_INCLUDE_PATH=/abuild/jh/trunk-install/include/c++/4.7.0 -DSUPD=350 -DPRODUCT -DNDEBUG -DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DGSTREAMER -DCUI -DSOLAR_JAVA -fexceptions -fno-enforce-eh-specs -DEXCEPTIONS_ON -o ../../../unxlngx6.pro/obj/hi_factory.o /abuild/jh/libreoffice/core/autodoc/source/display/idl/hi_factory.cxx