Keil Logo

Technical Support

On-Line Manuals

Linker User Guide

Preface Overview of the Linker Linking Models Supported by armlink Image Structure and Generation Linker Optimization Features Getting Image Details Accessing and Managing Symbols with armlink Scatter-loading Features The scatter-loading mechanism Overview of scatter-loading When to use scatter-loading Linker-defined symbols that are not defined when s Specifying stack and heap using the scatter file Scatter-loading command-line options Scatter-loading images with a simple memory map Scatter-loading images with a complex memory map Scatter file with link to bit-band objects Root execution regions Root execution region and the initial entry point Root execution regions and the ABSOLUTE attribute Root execution regions and the FIXED attribute Methods of placing functions and data at specific Placement of code and data with __attribute__((sec Placement of __at sections at a specific address Restrictions on placing __at sections Automatic placement of __at sections Manual placement of __at sections Placement of a key in flash memory with an __at se Mapping a structure over a peripheral register wit Example of how to explicitly place a named section Placement of unassigned sections with the .ANY mod Placement rules when using multiple .ANY selectors Command-line options for controlling the placement Prioritization of .ANY sections Specify the maximum region size permitted for plac Examples of using placement algorithms for .ANY se Example of next_fit algorithm showing behavior of Examples of using sorting algorithms for .ANY sect Behavior when .ANY sections overflow because of li Placement of veneer input sections in a scatter fi Placement of sections with overlays Reserving an empty region Placement of ARM C and C++ library code Specifying ARM standard C and C++ libraries in a s Example of placing code in a root region Example of placing ARM C library code Example of placing ARM C++ library code Example of placing ARM library helper functions Creation of regions on page boundaries Overalignment of execution regions and input secti Preprocessing of a scatter file Example of using expression evaluation in a scatte Equivalent scatter-loading descriptions for simple Command-line options for creating simple images Type 1 image, one load region and contiguous execu Type 2 image, one load region and non-contiguous e Type 3 image, multiple load regions and non-contig How the linker resolves multiple matches when proc How the linker resolves path names when processing Scatter file to ELF mapping Scatter File Syntax Linker Command-line Options Linker Steering File Command Reference Via File Syntax

Specify the maximum region size permitted for placing unassigned sections

7.4.4 Specify the maximum region size permitted for placing unassigned sections

You can specify the maximum size in a region that armlink can fill with unassigned sections.

Use the execution region attribute ANY_SIZE max_size to specify the maximum size in a region that armlink can fill with unassigned sections.
Be aware of the following restrictions when using this keyword:
  • max_size must be less than or equal to the region size.
  • If you use ANY_SIZE on a region without a .ANY selector, it is ignored by armlink.
When ANY_SIZE is present, armlink does not attempt to calculate contingency and strictly follows the .ANY priorities.
When ANY_SIZE is not present for an execution region containing a .ANY selector, and you specify the --any_contingency command-line option, then armlink attempts to adjust the contingency for that execution region. The aims are to:
  • Never overflow a .ANY region.
  • Make sure there is a contingency reserved space left in the given execution region. This space is reserved for veneers and section padding.
If you specify --any_contingency on the command line, it is ignored for regions that have ANY_SIZE specified. It is used as normal for regions that do not have ANY_SIZE specified.


The following example shows how to use ANY_SIZE:
LOAD_REGION 0x0 0x3000
    ER_1 0x0 ANY_SIZE 0xF00 0x1000
    ER_2 0x0 ANY_SIZE 0xFB0 0x1000
    ER_3 0x0 ANY_SIZE 0x1000 0x1000
In this example:
  • ER_1 has 0x100 reserved for linker-generated content.
  • ER_2 has 0x50 reserved for linker-generated content. That is about the same as the automatic contingency of --any_contingency.
  • ER_3 has no reserved space. Therefore, 100% of the region is filled, with no contingency for veneers. Omitting the ANY_SIZE parameter causes 98% of the region to be filled, with a two percent contingency for veneers.
Non-ConfidentialPDF file icon PDF versionARM DUI0377H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.