Type Name Mangling. STMicroelectronics PGI
Реклама
Реклама
Types of Mangling
Types of Mangling
The following entity names are mangled:
• Function names including non-member function names are mangled, to deal with overloading. Names of functions with extern "C" linkage are not mangled.
• Mangled function names have the function name followed by __ followed by F followed by the mangled description of the types of the parameters of the function. If the function is a member function, the mangled form of the class name precedes the F. If the member function is static, an S also precedes the F.
int f(float); // f__Ff class A
int f(float); // f__1AFf
static int g(float); // g__1ASFf
;
• Special and operator function names, like constructors and operator=(). The encoding is similar to that for normal functions, but a coded name is used instead of the routine name: class A
int operator+(float); // __pl__1Aff
A(float); // __ct__1Aff
; int operator+(A, float); // __pl__F1Af
• Static data member names. The mangled form is the member name followed by __ followed by the mangled form of the class name: class A
static int i; // i__1A
;
• Names of variables generated for virtual function tables. These have names like vtblmangled-classname
or vtblmangled-base-class-namemangled-class-name
.
• Names of variables generated to contain runtime type information. These have names like
Ttypeencoding
and
TIDtype-encoding
.
Mangling Summary
This section lists some of the C++ entities that are mangled and provides some details on the mangling algorithm. For more details, refer to The Annotated C++ Reference Manual.
Type Name Mangling
Using PGC++, each type has a corresponding mangled encoding. For example, a class type is represented as the class name preceded by the number of characters in the class name, as in
5abcde
for abcde
. Simple types are encoded as lower-case letters, as in i for int or f for float. Type modifiers and declarators are encoded as upper-case letters preceding the types they modify, as in U for unsigned or P for pointer.
340
Скачать
Реклама