4.9.49.16 Reloc Flag

The reloc psect flag allows the specification of a requirement for alignment of the psect on a particular boundary. The boundary specification must be a power of two, for example 2, 8 or 0x40. For example, the flag reloc=100h would specify that this psect must start on an address that is a multiple of 0x100 (e.g., 0x100, 0x400, or 0x500).

This flag only guarantees that the start of the psect will be aligned to the specified boundary. With the exception of a label placed at the very beginning of the psect, the address of any labels defined in the psect will be dependent on the size of the code or data before them. If labels within a psect must be aligned to a particular address, use the ALIGN directive (see Align Directive) immediately before those labels.

PIC18 instructions must be word aligned, so a reloc value of 2 must be used for any PIC18 psect that contains executable code. All other sections, and all sections for all other devices, can typically use the default reloc value of 1.