You copied the Doc URL to your clipboard.

Arm Compiler armlink User Guide : Methods of specifying an image memory map with the linker

Methods of specifying an image memory map with the linker

An image can consist of any number of regions and output sections. Regions can have different load and execution addresses.

When constructing the memory map of an image, armlink must have information about:

  • How input sections are grouped into output sections and regions.
  • Where regions are to be located in the memory map.

Depending on the complexity of the memory map of the image, there are two ways to pass this information to armlink:

Command-line options for simple memory map descriptions

You can use the following options for simple cases where an image has only one or two load regions and up to three execution regions:

  • --first.
  • --last.
  • --ro_base.
  • --rosplit.
  • --rw_base.
  • --split.
  • --xo_base.
  • --zi_base.

These options provide a simplified notation that gives the same settings as a scatter-loading description for a simple image. However, no limit checking for regions is available when using these options.

Scatter file for complex memory map descriptions
A scatter file is a textual description of the memory layout and code and data placement. It is used for more complex cases where you require complete control over the grouping and placement of image components. To use a scatter file, specify --scatter=filename at the command-line.


You cannot use --scatter with the other memory map related command-line options.

Table 3-2 Comparison of scatter file and equivalent command-line options

Scatter file Equivalent command-line options
LR1 0x0000 0x20000
    ER_RO 0x0 0x2000
        init.o (INIT, +FIRST)
    ER_RW 0x400000
    ER_ZI 0x405000
LR_XO 0x8000 0x4000
    ER_XO 0x8000


If XO sections are present, a separate load and execution region is created only when you specify --xo_base. If you do not specify --xo_base, then the ER_XO region is placed in the LR1 region at the address specified by --ro_base. The ER_RO region is then placed immediately after the ER_XO region.