11.11.4 Gaps Between Output Sections
Gaps between output sections can occur when the alignment requirements differ and multiple sections are allocated sequentially into the same memory region.
In some instances the linker will make use of this gap, depending on the availability, size, and alignment requirements of any unmapped sections. In general it is preferable to eliminate the explicit mapping of output sections in linker scripts. When all output sections are unmapped, the linker is free to perform a best-fit allocation based on section attributes.
One consequence of best-fit allocation is that gaps between output sections may appear in unexpected places. The linker tries to use small memory blocks first and will locate sections to leave the largest unused portions. When memory is segmented, such as by the introduction of an absolute section, the arrangement in memory may change dramatically. This should not be a problem unless the programmer expects a certain area of memory to remain unused. In such cases the programmer should reserve memory explicitly, using an array definition in source code, or by editing the linker script.
Explicit mapping of output sections in linker scripts is recommended only when the proximity or relative ordering of sections is important and can't be satisfied using the section attributes described in 5.1 Directives that Define Sections.