This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Symbols, type_info, and name mangling.
- To: scherrey at proteus-tech dot com
- Subject: Re: Symbols, type_info, and name mangling.
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Fri, 14 Jan 2000 00:34:12 +0100
- CC: gcc at gcc dot gnu dot org
- References: <387D9889.D698AC6D@switchco.com>
> Where is the code that performs the name (de)mangling like when you
> run objdump --syms --demangle or within the compiler when it creates
> the mangled symbol names (especially C++ methods & operators)?
The demangling code is in -liberty. Check out demangle.h in the gcc or
binutils sources.
> How does this code know when a symbol is mangled with the standard
> mechanism vs. -fnew-abi's methods?
The squangling is really a superset of standard mangling, so there is
no need to distinguish (with a few exceptions, in which case the
demangler gets it wrong).
> The reason why I ask is that I'd like to be able to resolve some
> text-based symbols at runtime to class methods in a shared library.
You may also want to look at gxxint.texi, which documents the
mangling.
Regards,
Martin