[Bug c++/14607] New: [3.3 Regression] Duplicate symbol "vtable for node" in files div.o and env.o
danglin at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Mar 16 17:19:00 GMT 2004
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
More information about the Gcc-bugs
mailing list