21.3 Linker-Defined Symbols

The XC-DSC linker defines several symbols that may be used in your C/C++ code development. Please see the “MPLAB®XC-DSC Assembler, Linker and Utilities User’s Guide for dsPIC33A DSC” (DS-50003919) for more information.

A useful address symbol, _PROGRAM_END, is defined in program memory to mark the highest address used by a CODE section. It should be referenced with the address operator (&) in a built-in function call that accepts the address of an object in program memory. This symbol can be used by applications as an end point for checksum calculations.

For example:

int *big_addr;
extern int _PROGRAM_END __attribute__((far));

int main() {
  big_addr = &_PROGRAM_END;
}