public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14607] New: [3.3 Regression] Duplicate symbol "vtable for node" in files div.o and env.o
@ 2004-03-16 17:19 danglin at gcc dot gnu dot org
  2004-03-16 17:48 ` [Bug c++/14607] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: danglin at gcc dot gnu dot org @ 2004-03-16 17:19 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-12-28  5:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-16 17:19 [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
2004-03-16 17:48 ` [Bug c++/14607] " pinskia at gcc dot gnu dot org
2004-06-11 22:22 ` pinskia at gcc dot gnu dot org
2004-06-11 22:40 ` dave at hiauly1 dot hia dot nrc dot ca
2004-06-11 22:45   ` Andrew Pinski
2004-06-11 22:45 ` pinskia at physics dot uc dot edu
2004-06-11 22:52 ` dave at hiauly1 dot hia dot nrc dot ca
2004-07-20 19:52 ` cvs-commit at gcc dot gnu dot org
2004-07-20 22:10 ` pinskia at gcc dot gnu dot org
2004-08-15  4:14 ` pinskia at gcc dot gnu dot org
2004-12-28  4:51 ` cvs-commit at gcc dot gnu dot org
2004-12-28  5:29 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).