4.4.3.2 Changing the Default Allocation of Program-memory Objects

You can change the default memory allocation of objects in program memory by either:

  • Making the objects absolute
  • Placing objects in their own section and explicitly linking that section

If only a few program-memory objects are to be located at specific addresses in program space memory, then the objects can be made absolute. Absolute variables are described in 4.4.4 Absolute Variables.

Objects in program memory can also be placed at specific positions by using the __section() specifier (see 4.3.10.10 Section Attribute) after enabling the CCI (see 3.6.3.4 Ext Option) to allocate them to a unique section, then link that section to the required address via an option. See 4.14.2 Changing and Linking the Allocated Section for more information on changing the default linker options for sections.