From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11473 invoked by alias); 16 Mar 2004 17:19:27 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 11438 invoked by uid 48); 16 Mar 2004 17:19:25 -0000 Date: Tue, 16 Mar 2004 17:19:00 -0000 From: "danglin at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20040316171907.14607.danglin@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/14607] New: [3.3 Regression] Duplicate symbol "vtable for node" in files div.o and env.o X-Bugzilla-Reason: CC X-SW-Source: 2004-03/txt/msg01994.txt.bz2 List-Id: The following errors occured building groff-1.19 on the above target with gcc version 3.3.4 20040306 (prerelease): g++ -O2 -s -o troff dictionary.o div.o env.o glyphuni.o input.o majorminor.o nod e.o number.o reg.o symbol.o unicode.o uniglyph.o uniuni.o /xxx/gnu/groff-1.19/ob jdir3.3/src/libs/libgroff/libgroff.a -lm /usr/ccs/bin/ld: Duplicate symbol "vtable for node" in files div.o and env.o /usr/ccs/bin/ld: Duplicate symbol "typeinfo for node" in files div.o and env.o /usr/ccs/bin/ld: Duplicate symbol "typeinfo name for node" in files div.o and en v.o /usr/ccs/bin/ld: Duplicate symbol "vtable for node" in files div.o and input.o /usr/ccs/bin/ld: Duplicate symbol "typeinfo for node" in files div.o and input.o /usr/ccs/bin/ld: Duplicate symbol "typeinfo name for node" in files div.o and in put.o /usr/ccs/bin/ld: Duplicate symbol "vtable for node" in files div.o and node.o /usr/ccs/bin/ld: Duplicate symbol "typeinfo for node" in files div.o and node.o /usr/ccs/bin/ld: Duplicate symbol "typeinfo name for node" in files div.o and no de.o The problem doesn't occur with gcc 3.0.3. I'm not sure of the the details as to when vtables should be emitted as global objects. The 3.3.4 assembler output has for example the following code in div.o: .IMPORT _ZTV4node,DATA ... .EXPORT _ZTV4node,DATA .align 8 _ZTV4node .word 0 .word _ZTI4node .word P%_ZN4nodeD1Ev .word P%_ZN4nodeD0Ev .word P%__cxa_pure_virtual .word P%_ZN4node17set_unformat_flagEv ... _ZN4nodeD1Ev .PROC .CALLINFO FRAME=64,NO_CALLS .ENTRY addil LR'_ZTV4node-$global$,%r27 ldo 64(%r30),%r30 ldo RR'_ZTV4node-$global$+8(%r1),%r1 ... The same code is duplicated in the assembler out put for env.cpp and input.cpp. The assembler output from 3.0.3 doesn't have or export the vtable for node. The table is only defined by input.o. The hppa1.1-hp-hpux10.20 port doesn't support weak symbols. In ports that support weak symbols, the vtables are weak avoiding this problem. I'm not sure of all the requirements for vtables. For example, can they be local to a translation unit and duplicated? -- Summary: [3.3 Regression] Duplicate symbol "vtable for node" in files div.o and env.o Product: gcc Version: 3.3.4 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: danglin at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: hppa1.1-hp-hpux10.20 GCC host triplet: hppa1.1-hp-hpux10.20 GCC target triplet: hppa1.1-hp-hpux10.20 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14607