SPNU151W January 1998 – March 2023 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , AM1705 , AM1707 , AM1802 , AM1806 , AM1808 , AM1810 , AM5K2E04 , OMAP-L132 , OMAP-L137 , OMAP-L138 , SM470R1B1M-HT , TMS470R1A288 , TMS470R1A384 , TMS470R1A64 , TMS470R1B1M , TMS470R1B512 , TMS470R1B768
The examples in this section illustrate the demangling process.
This example shows a sample C++ program. In this example, the linknames of all the functions are mangled; that is, their signature information is encoded into their names.
class banana {
public:
int calories(void);
banana();
~banana();
};
int calories_in_a_banana(void)
{
banana x;
return x.calories();
}
The resulting assembly that is output by the compiler is as follows.
_Z20calories_in_a_bananav:
STMFD SP!, {A3, A4, V1, LR}
MOV A1, SP
BL _ZN6bananaC1Ev
BL _ZN6banana8caloriesEv
MOV V1, A1
MOV A1, SP
BL _ZN6bananaD1Ev
MOV A1, V1
LDMFD SP!, {A3, A4, V1, LR}
BX LR
Executing the C++ name demangler will demangle all names that it believes to be mangled. Enter:
armdem calories_in_a_banana.asm
The result after running the C++ name demangler is as follows. The linknames in _ZN6bananaC1Ev, _ZN6banana8caloriesEv, and _ZN6bananaD1Ev are demangled.
calories_in_a_banana():
STMFD SP!, {A3, A4, V1, LR}
MOV A1, SP
BL banana::banana()
BL banana::calories()
MOV V1, A1
MOV A1, SP
BL banana::~banana()
MOV A1, V1
LDMFD SP!, {A3, A4, V1, LR}
BX LR