Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!devnull!kelley@mpd.tandem.com From: kelley@mpd.tandem.com (Michael Kelley) Newsgroups: comp.lang.c++ Subject: Re: name mangling and dynamic linking Message-ID: <160@devnull.mpd.tandem.com> Date: 2 Apr 91 15:16:55 GMT References: <1991Apr1.165144.3011@netcom.COM> Sender: news@devnull.mpd.tandem.com Lines: 29 In article <1991Apr1.165144.3011@netcom.COM>, aed@netcom.COM (Andrew Davidson) writes: > > Hi I have been building some proto types in c++ that take advantage of > true dynamic linking and loading. One of the problems I found in that > I am required to know the symbol name of the function. > > In C this is no problem as the function int f(int) has the symbol name > _f. Since C++ mangles function names this in not the case. I know that > I can get the name mangling stuff from gnu g++, but am I guaranted > that all c++ compilers will mangle the same way? > No, I don't believe there is a standard mangling scheme. In light of this, I've put together a portable name mangler. Problem is, it's rather slow, and it's only as good as your name demangler. (Sun's 2.0 demangler has problems with static members, for example). It works by generating dummy class declarations in /tmp, running your compiler, then filtering the resultant symbol tables. But if you don't use it with every build, it's alright. Anyone needing such a beast, drop me a note -- if there's enough interest, I'll post. > thanks in advance Andy You're welcome 8-). Mike Kelley Tandem Computers, Austin, TX kelley@mpd.tandem.com (512) 244-8830 / Fax (512) 244-8247