| |||
| Home > ARM Compiler Reference > GNU extensions to the ARM compiler > Return and frame addresses | |||
This extension enables you to use the following builtin functions:
__builtin_frame_addressObtains the frame address of a function.
__builtin_return_addressObtains the return address of a function.
The argument to __builtin_frame_address and __builtin_return_address must
be zero.
The following example shows how to use these builtin functions:
int Return_Address_0 ()
{
static void *aLocal;
static void *bLocal;
aLocal = __builtin_return_address (0); // should return the lr
bLocal = __builtin_frame_address (0); // should return the sp
return aLocal + bLocal;
}
Supported in GNU mode only.
Also, see the ARM mode equivalent __return_address().