Placement of unassigned sections
The linker attempts to place Input sections into specific execution regions. For any Input sections that cannot be resolved, and where the placement of those sections is not important, you can specify where the linker is to place them.
To place sections that are not automatically assigned to specific execution regions, use
.ANY module selector in a scatter file.
Usually, a single
.ANY selector is
equivalent to using the
* module selector. However, unlike
*, you can specify
in multiple execution regions.
The linker has default rules for placing unassigned sections when you specify multiple
.ANY selectors. You can override the default rules using the following command-line options:
--any_contingencyto permit extra space in any execution regions containing
.ANYsections for linker-generated content such as veneers and alignment padding.
--any_placementto provide more control over the placement of unassigned sections.
--any_sort_orderto control the sort order of unassigned Input sections.
NoteThe placement of data can cause some data to be removed and shrink the size of the sections.
In a scatter file, you can also:
- Assign a priority to a
.ANYselector to give you more control over how the unassigned sections are divided between multiple execution regions. You can assign the same priority to more than one execution region.
- Specify the maximum size for an execution region that the linker can fill with unassigned sections.
The following are relevant operations in the linking process and their order:
- String merging.
- Region table creation.
- Late library load (scatter-load functions).
- Veneer generation + literal pool merging.
String and literal pool merging can reduce execution size, while region table creation, late library load, and veneer generation can increase it. Padding also affects the execution size of the region.
NoteExtra, more-specific operations can also increase or decrease execution size after the
.ANYplacement, such as the generation of PLT/GOT and exception-section optimizations.
This section contains the following subsections: