Operating System - OpenVMS
1753559 Members
5874 Online
108796 Solutions
New Discussion

Re: multiple repository symbols for same c++ method

 
ciju john
Occasional Advisor

multiple repository symbols for same c++ method

Compaq C++ V6.5-004 for OpenVMS Alpha V8.2
OpenVMS VMS 0 V8.2 AlphaServer_ES40 Alpha

I am facing a problem which has got me confused. To give you a background I have a template specialization
TAO::Objref_Traits<:policy>

defined in PolicyC.h and implemented in PolicyC.cpp. The specialization has couple of static methods, one of which gets used in Policy_ForwardC.cpp.
TAO::Objref_Traits<:policy>::marshal. This gets compiled into a static library called libTAO.a .

At link time I get undefined symbol error.
%LINK-W-USEUNDEF, undefined symbol CXX$MRSHLQ13TO32OBJRFTRI1TOGQE9 referenced
in psect $LINK$ offset %X00000CF0
in module Policy_ForwardC file DKA0:[tao_builds.taoadmin.1_4a.ACE_wrappers.lib]libTAO.a;1

I see the symbol entry CXX$MRSHLQ13TO32OBJRFTRI1TOGQE9 in the demangler file for tao:
CXX$MRSHLQ13TO32OBJRFTRI1TOGQE9bool TAO::Objref_Traits<:policy>::marshal(CORBA::Policy *, TAO_OutputCDR &)

I used 'analyze' to dump the symbols in PolicyC.o and couldn't find the symbol in it. Eyeballing the demangler file I see another entry for the same method:
CXX$MRSHLQ13TO35OBJRFTRI15QDNDBbool TAO::Objref_Traits<:policy>::marshal(CORBA::Policy *, TAO_OutputCDR &)

I verified that this symbol (ending with DNDB) is present in PolicyC.o. So what seems to be happening is that for some reason there are two symbols for the same method and while the compiler used one symbol for the file where the method is being defined, its using another symbol to look it up for where the method gets called. Unless I am mistaken a repository shouldn't have two entries for the same method. Could this be an indication of a compiler bug?

I am attaching the demangler file. If anyone wants I can send the PolicyC.* & Policy_ForwardC.* I will be very thankful if anyone can provide any insight on this matter.

thanks,
Ciju
1 REPLY 1
Craig A Berry
Honored Contributor

Re: multiple repository symbols for same c++ method

What do you get from

$ cxxdemangle CXX$MRSHLQ13TO32OBJRFTRI1TOGQE9, CXX$MRSHLQ13TO35OBJRFTRI15QDNDB

It does look like you might get the same name, which sure doesn't sound right. Are you using different qualifiers when compiling the two different source files, or are you compiling with anything that might affect name mangling, such as /DISTINGUISH_NESTED_ENUMS or /NAMES.

Note that there are ECOs for C++. A later (though I'm not sure if latest) version is:

Compaq C++ V6.5-046 for OpenVMS Alpha V8.2