10.3.4.8 User-Defined Section in Data Memory

A stub is included for user-defined output sections in data 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 data memory. See Chapter 11. “Linker Examples.” for more information.

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

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 data memory cannot be supported.