Symbols Automatically Defined by the Linker

For the COFF ABI, the linker automatically defines symbols for those sections used in your assembly source. A program can use these symbols at run time to determine where a section is linked. Since these symbols are external, they appear in the linker map. You must have used the corresponding section in a source module for the symbol to be created. Values are assigned to these symbols as follows:

.text is assigned the first address of the .text output section.
(It marks the beginning of executable code.)
etext is assigned the first address following the .text output section.
(It marks the end of executable code.)
.data is assigned the first address of the .data output section.
(It marks the beginning of initialized data tables.)
edata is assigned the first address following the .data output section.
(It marks the end of initialized data tables.)
.ebss is assigned the first address of the .ebss output section.
(It marks the beginning of uninitialized data.)
end is assigned the first address following the .ebss output section.
(It marks the end of uninitialized data.)

The linker automatically defines the following symbols for C/C++ support when the --ram_model or --rom_model option is used.

__TI_STACK_SIZE is assigned the size of the .stack section. (EABI)
__TI_STACK_END is assigned the end of the .stack section. (EABI)
__TI_SYSMEM_SIZE is assigned the size of the .sysmem section. (EABI)
__STACK_SIZE is assigned the size of the .stack section. (COFF)
__STACK_END is assigned the end of the .stack section. (COFF)
__SYSMEM_SIZE is assigned the size of the .esysmem section. (COFF)

These linker-defined symbols can be accessed in any assembly language module if they are declared with a .global directive (see Identify Global Symbols).

See Section 8.6.1 for information about referring to linker symbols in C/C++ code.