You copied the Doc URL to your clipboard.

Syntax of an input section description

An input section description specifies what input sections are loaded into the parent execution region.

The syntax of an input section description, in Backus-Naur Form (BNF), is:

input_section_description ::= 
                module_select_pattern [ "(" input_section_selector ( "," input_section_selector )* ")" ]
                input_section_selector ::= "+" input_section_attr |
                input_section_pattern |
                input_section_type |
                input_symbol_pattern |



A pattern that is constructed from literal text. An input section matches a module selector pattern when module_select_pattern matches one of the following:

  • The name of the object file containing the section.
  • The name of the library member (without leading path name).
  • The full name of the library (including path name) the section is extracted from. If the names contain spaces, use wild characters to simplify searching. For example, use *libname.lib to match C:\lib dir\libname.lib.

The wildcard character * matches zero or more characters and ? matches any single character.

Matching is not case-sensitive, even on hosts with case-sensitive file naming.

Use *.o to match all objects. Use * to match all object files and libraries.

You can use quoted filenames, for example "file one.o".

You cannot have two * selectors in a scatter file. You can, however, use two modified selectors, for example *A and *B, and you can use a .ANY selector together with a * module selector. The * module selector has higher precedence than .ANY. If the portion of the file containing the * selector is removed, the .ANY selector then becomes active.


An attribute selector that is matched against the input section attributes. Each input_section_attr follows a +.

The selectors are not case-sensitive. The following selectors are recognized:

  • RO-CODE.
  • RO-DATA.
  • RO, selects both RO-CODE and RO-DATA.
  • RW-DATA.
  • RW-CODE.
  • RW, selects both RW-CODE and RW-DATA.
  • XO.
  • ZI.
  • ENTRY, that is, a section containing an ENTRY point.

The following synonyms are recognized:

  • CODE for RO-CODE.
  • CONST for RO-DATA.
  • TEXT for RO.
  • DATA for RW.
  • BSS for ZI.

The following pseudo-attributes are recognized:

  • FIRST.
  • LAST.

Use FIRST and LAST to mark the first and last sections in an execution region if the placement order is important. For example, if a specific input section must be first in the region and an input section containing a checksum must be last.


FIRST and LAST must not violate the basic attribute sorting order. For example, FIRST RW is placed after any read-only code or read-only data.

There can be only one FIRST or one LAST attribute for an execution region, and it must follow a single input_section_selector. For example:

*(section, +FIRST)
This pattern is correct.
*(+FIRST, section)
This pattern is incorrect and produces an error message.

A pattern that is matched, without case sensitivity, against the input section name. It is constructed from literal text. The wildcard character * matches 0 or more characters, and ? matches any single character. You can use a quoted input section name.


If you use more than one input_section_pattern, ensure that there are no duplicate patterns in different execution regions to avoid ambiguity errors.
A number that is compared against the input section type. The number can be decimal or hexadecimal.

You can select the input section by the global symbol name that the section defines. The global name enables you to choose individual sections with the same name from partially linked objects.

The :gdef: prefix distinguishes a global symbol pattern from a section pattern. For example, use :gdef:mysym to select the section that defines mysym. The following example shows a scatter file in which ExecReg1 contains the section that defines global symbol mysym1, and the section that contains global symbol mysym2:

LoadRegion 0x8000
    ExecReg1 +0
    ; rest of scatter-loading description

You can use a quoted global symbol pattern. The :gdef: prefix can be inside or outside the quotes.


If you use more than one input_symbol_pattern, ensure that there are no duplicate patterns in different execution regions to avoid ambiguity errors.

A section property can be +FIRST, +LAST, and OVERALIGN value.

The value for OVERALIGN must be a positive power of 2 and must be greater than or equal to 4.


  • The order of input section descriptors is not significant.
  • Only input sections that match both module_select_pattern and at least one input_section_attr or input_section_pattern are included in the execution region.

    If you omit (+ input_section_attr) and (input_section_pattern), the default is +RO.

  • Do not rely on input section names that the compiler generates, or that are used by Arm® library code. If, for example, different compiler options are used, the input section names can change between compilations. In addition, section naming conventions that are used by the compiler are not guaranteed to remain constant between releases.
  • The BNF definitions contain extra line returns and spaces to improve readability. If present in a scatter file, they are not required in scatter-loading descriptions and are ignored.
Was this page helpful? Yes No