You copied the Doc URL to your clipboard.

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.

Note

This topic includes descriptions of [BETA] features.

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 maps.

Depending on the complexity of the memory maps 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.
  • --rw_base.
  • [BETA] --ropi.
  • [BETA] --rwpi.
  • --split.
  • --rosplit.
  • --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.

Note

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
    {
--ro_base=0x0
        init.o (INIT, +FIRST)
        *(+RO)
    }
--first=init.o(init)
    ER_RW 0x400000
    { 
        *(+RW)
    }
--rw_base=0x400000
    ER_ZI 0x405000
    {
        *(+ZI)
    }
}
--zi_base=0x405000
Was this page helpful? Yes No