This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Symbols, type_info, and name mangling.


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]