[lug] C++ name mangling

D. Stimits stimits at idcomm.com
Wed May 24 21:45:46 MDT 2000


Hi:

I'm in search of detailed information on the name mangling during
creation of C++ dynamic libraries. Although I could wrap portions extern
"C", this would cause problems in some areas.

During the transition of software on Linux from C to C++, various
portions will have existing C functionality replaced with dlopen() style
library loading, each library actually a wrapper to a purely C++
library (a library that loads libraries). When there is sufficient
replacement of existing C code with dynamic C library code, removal of
the extern "C" wrapper libs will begin, and directly loading C++ libs
(not extern "C") will be installed in their places. The C wrapper libs
might later be used for scripting language hooks, and so both C and C++
libs will have use for quite some time.

One of the original authors of glibc (Eric Youngdale) indicated that the
scheme should work, but did not know where to find functions or
information on dealing with name mangling in g++. However, he did think
that there are probably some undocumented functions available which
might aid me in either predicting the mangled symbol name in the
library, or else the decoding of mangled symbols to get the original
class/method information. Does anyone here know of name
mangling/demangling functions, or information on where I might find what
I need to implement these myself?

Thanks,
D. Stimits, stimits at idcomm




More information about the LUG mailing list