10.3.4.3 User-Defined Section in Program Memory

A stub is included for user-defined output sections in program memory. This stub may be edited as needed to support the application requirements. Once a standard linker script has been modified, it is called a “custom linker script.” In practice, it is often simpler to use section attributes in source code to locate user-defined sections in program memory. See Linker Examples for more information.

/*
** User-Defined Section in Program Memory
**
** note: can specify an address using
**       the following syntax:
**
**       usercode 0x1234 :
**         {
**           *(usercode);
**         } >program
*/
usercode :
{
   *(usercode);
} >program

An exact, absolute starting address can be specified, if necessary. If the address is greater than the current location counter, the intervening memory space will be skipped and filled with zeros. If the address is less than the current location counter, a section overlap will occur. Whenever two output sections occupy the same address range, a link error will be reported. Overlapping sections in program memory can not be supported.

Note: Each memory region has its own location counter.