Linker-defined Symbols

The linker-generated start and end symbols that are automatically generated for loadable segments are internal if they are addresses into internal segments, and external if they are for external segments. All other linker defined symbols you create in a LCF are considered external unless you redefine them with INTERNAL_SYMBOL . The linker also defines some linker defined symbols for its own use ( Linker-defined Symbols ).

Table 1. Linker-defined Symbols
Symbol Name Value Description
_stack_addr top of the stack - External. Comes from settings panel settings.
_stack_end bottom of the stack External. Comes from settings panel settings.
_heap_addr bottom of the heap External. Comes from settings panel settings.
_heap_end top of the heap External. Comes from settings panel settings.
_SDA_BASE_ .sdata + 0x00008000 Internal per EABI requirement. May not be redefined.
_SDA2_BASE_ .sdata2 + 0x00008000 Internal per EABI requirement. May not be redefined.
_ABS_SDA_BASE_ .sdata + 0x00008000 External version of _SDA_BASE_ that can be used as an absolute. May not be redefined.
_ABS_SDA2_BASE_ .sdata2 + 0x00008000 External version of _SDA2_BASE_ that can be used as an absolute. May not be redefined.
_nbfunctions number of functions in program Deprecated. External. This is a number, not an address. May not be redefined.
SIZEOF_HEADERS size of the segment headers External. This is a number, not an address. May not be redefined.
Note: The symbols _SDA_BASE_ and _SDA2_BASE are not accessible until the small data registers are properly initialized before being accessible. The symbols _ABS_SDA_BASE and _ABS_SDA2_BASE allow you to access those pointers as absolutes addresses, as it is difficult to initialize those pointers without accessing them as absolute addresses.
Note: The stack and heap linker generated symbols are external. It may be more practical in a SDA PIC/PID application to make the heap and stack be contiguous with an internal segment and define them as internal.