11.11.3 Gaps Between Input Sections

Gaps between input sections are similar to gaps between aligned variables, except that the padding is inserted by the linker, not the assembler. This type of gap can occur when variables with different alignment requirements are defined in separate source files.

The remedy for this type of gap is to simply eliminate the mapping of input sections in linker scripts. Unmapped sections are allocated individually by the linker, so that no special alignment padding is necessary. The MPLAB XC-DSC linker do not explicitly map any input sections in data memory for this reason.