You copied the Doc URL to your clipboard.

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 the .ANY module selector in a scatter file.

Usually, a single .ANY selector is equivalent to using the * module selector. However, unlike *, you can specify .ANY 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_contingency to permit extra space in any execution regions containing .ANY sections for linker-generated content such as veneers and alignment padding.
  • --any_placement to provide more control over the placement of unassigned sections.
  • --any_sort_order to control the sort order of unassigned Input sections.

Note

The 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 .ANY selector 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:

  1. .ANY placement.
  2. String merging.
  3. Region table creation.
  4. Late library load (scatter-load functions).
  5. 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.

Note

Extra, more-specific operations can also increase or decrease execution size after the .ANY placement, such as the generation of PLT/GOT and exception-section optimizations.

This section contains the following subsections: