0
How can I see the mangled names of the functions in my program?
i've been searching this all over the internet and i can't understand name mangling. please help me, this is my report in my programming class. any help will be much appreciated, more power to sololearn
3 Answers
+ 3
To see mangling names of your functions you must open object file (.o or .obj) of your compiled code with special viewers (or you can use text viewer).
+ 3
In simple words name mangling is "renaming" c++ function declaration (including type of parameters) to symbolic representation. That renamed name is used on linking stage. As your program can have overloaded function with same name but different parameters, linker must definitly know what function to use, so types of parameters are encoded to the name.
All libraries export c++ functions names as mangled names.
For example, mangling name for
void f(void);
could be
_Zfi
void f(void);
could be
_Zfv
void f(char , int);
could be
_Zfci
Name mangling is compiler specific.
0
thanks a lot, it's clear now