C++ Name Mangling Decoder for G++?

is there any C++ name-mangling decoder for g++?

3

4 Answers

You can use c++filt to demangle c++ symbols. For instance

$ c++filt -n _Z1fv
f()

You may also be interested on the -C option of objdump:

objdump -CSr main.o

which demangles relocation references like:

  char *sn = new char[4];
10:   bf 04 00 00 00          mov    $0x4,%edi
15:   e8 00 00 00 00          callq  1a <main+0x1a>
                      16: R_X86_64_PC32       operator new[](unsigned long)-0x4

Without -C it would show the mangled name _Znam.

See also: Can objdump un-mangle names of C++ template functions?

There are also some online demanglers mentioned at Is there an online name demangler for C++? like If it exists, there is SaaS of it.

nm also has a -C option.

1

you have c++filt. Recently I found an online tool as well.

1.

c++filt [-_|--strip-underscore]
        [-n|--no-strip-underscore]
        [-p|--no-params]
        [-t|--types]
        [-i|--no-verbose]
        [-r|--no-recurse-limit]
        [-R|--recurse-limit]
        [-s format|--format=format]
        [--help]  [--version]  [symbol…]

Example: c++filt symbol

for more info

  1. Online solution visit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest