Learn C++ Itanium Symbol Mangling

Lesson 1: Basics

After getting an understanding of how this guide works and learning about the not-mangling of C identifiers, we are ready to dive into C++.

Every C++ mangled symbol is prefixed with the string _Z. This signifies that this is a mangled C++ symbol. _Z starts with an underscore followed by an uppercase letter. All symbols of that structures are reserved by the C standard and cannot be used by programs. This ensures that there are no name collisions with normal C functions and mangled C++ functions.

After that, the name of the entity is stored. For now, we will only look at functions. For functions, the function type is appended to the name to get the full symbol.

void f() {}
          

This empty function will be mangled to _Z1fv. The 1f signifies the name (we will look at this in more detail later in this lesson) and the v signifies the function type (which we will visit in more detail in a future lesson).

Which of these symbols cannot possibly be a mangled C++ symbol? Answer with the name of the symbol.

  • _ZN3FooIA4_iE3barE
  • _ZN6System5Sound4beepEv
  • _RN3FooIA4_iE3barE