SPNU118Z September 1995 – 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
To access linker-defined symbols that represent addresses, use the _symval built-in operator to get the symbol's value as a pointer value.
For example, the linker symbol __TI_STACK_END evaluates to an address. To get the symbol's value as a pointer value in C/C++ code, use the following syntax:
extern void __TI_STACK_END;
void *get_stack_end() { return (void*)_symval(&__TI_STACK_END); }
Although the linker symbol __TI_STACK_END is an address, and thus looks a lot like a C/C++ pointer value, you cannot simply define the C/C++ variable __TI_STACK_END as a pointer variable and omit taking the symbol's address. See Section 8.6.4 for details. The following example is incorrect.
extern void * __TI_STACK_END;
void *get_stack_end() { return __TI_STACK_END; } // wrong, missing &