9.4.2 Changing the Default Allocation
If you intend to prevent all variables from using one or more program memory locations so that you can use those locations for some other purpose, you may choose to adjust the memory regions in a custom linker script.
If only a few non-auto const
variables are to be located
at specific addresses in program space memory, then the variables should use the address
attribute to locate them at the desired location. This attribute is described in 8.11 Variable Attributes.
If you cannot have const
-qualified objects placed in a section that also
contain executable code, use the -mpure-code
option, described in 5.7.1 Options Specific to PIC32C/SAM Devices.