🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52215

inconsistent mangling of virtual function tables ???

#52215
From: Roger West
Date: Wed, 20 Jan 1993 05:19
51 lines
2637 bytes
Hi out there.

I was trying to use gcc-2.3.3 and libg++-2.3 to compile a class which
inherits from the ostream as follows...

	#include <iostream.h>

	class MyDerived : public ostream , public MyBase {...}

when I came across a strange anomaly.  The mangling of one of the virtual
function tables was not consistent.  My application failed to link with the
following message...

	ld: Undefined symbol 
	   __vt$7istream$3ios 

When I searched libg++, however, I found...

	lux$ nm -o libg++.a|fgrep 'istream$'
	libg++.a:SFile.o:         U __vt$istream$3ios
	libg++.a:fstream.o:         U __vt$istream$3ios
	libg++.a:iostream.o:00002e80 D __vt$istream$3ios
	libg++.a:strstream.o:         U __vt$istream$3ios

The length prefix for the 'istream' component was missing.  In contrast,
searching libg++ for ostream and iostream virtual function tables produced
expected manglings...

	lux$ nm -o libg++.a|fgrep 'ostream$'
	libg++.a:PlotFile.o:         U __vt$7ostream$3ios
	libg++.a:SFile.o:         U __vt$7ostream$3ios
	libg++.a:SFile.o:         U __vt$8iostream$3ios
	libg++.a:fstream.o:         U __vt$7ostream$3ios
	libg++.a:fstream.o:         U __vt$8iostream$3ios
	libg++.a:iostream.o:00002e90 D __vt$7ostream$3ios
	libg++.a:iostream.o:00002e70 D __vt$8iostream$3ios
	libg++.a:strstream.o:         U __vt$7ostream$3ios
	libg++.a:strstream.o:         U __vt$8iostream$3ios

So it appears that for one reason or another, gcc is mangling one of the
istream virtual function tables incorrectly, but only when libg++ is
being compiled.  Pretty strange.  Has anyone else seen this happen?

Incidentally, my machine is: SunOS lux 4.1.3 1 sun4c
--
   _____________________________________________________________
   |   Roger West              Internet: west@tsd.itg.ti.com   |
   |   Texas Instruments Inc.    TI MSG: RWES                  |
   |   PO Box 149149, MS 2201     Voice: (512) 250-7372        |
   |___Austin, TX 78714-9149________Fax: (512) 250-7104________|
Technical Details
Message-ID: <WEST.93Jan19231959@lux.tsd.itg.ti.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!fstop.csc.ti.com!fstop!west

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,8d831f22c9bdc5dd,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-01-19 21:43:39 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!fstop.csc.ti.com!fstop!west
From: west@lux.tsd.itg.ti.com (Roger West)
Subject: inconsistent mangling of virtual function tables ???
Message-ID: <WEST.93Jan19231959@lux.tsd.itg.ti.com>
Sender: usenet@csc.ti.com
Nntp-Posting-Host: lux.tsd.itg.ti.com
Organization: Texas Instruments, Speech Mushrooms.
Date: Wed, 20 Jan 1993 05:19:59 GMT
Lines: 51