Keil Logo Arm Logo

Technical Support

On-Line Manuals

Linker Reference Guide

Conventions and feedback Linker command-line options Linker steering file command reference Formal syntax of the scatter file BNF notation used in scatter-loading description s Syntax of a scatter file About load region descriptions Syntax of a load region description Load region attributes About execution region descriptions Syntax of an execution region description Execution region attributes Address attributes for load and execution regions Considerations when using a relative address +offs Considerations when using a relative address +offs Inheritance rules for load region address attribut Inheritance rules for execution region address att Inheritance rules for the RELOC address attribute About input section descriptions Syntax of an input section description How the linker resolves multiple matches when proc Behavior when .ANY sections overflow because of li How the linker resolves path names when processing About Expression evaluation in scatter files Expression usage in scatter files Expression rules in scatter files Execution address built-in functions for use in sc Scatter files containing relative base address loa ScatterAssert function and load address related fu Symbol related function in a scatter file Example of aligning a base address in execution sp AlignExpr(expr, align) function GetPageSize() function SizeOfHeaders() function

Expression rules in scatter files

Expression rules in scatter files

Expressions follow the C-Precedence rules and are made up of the following:

  • Decimal or hexadecimal numbers.

  • Arithmetic operators: +, -, /, *, ~, OR, and AND

    The OR and AND operators map to the C operators | and & respectively.

  • Logical operators: LOR, LAND, and !

    The LOR and LAND operators map to the C operators || and && respectively.

  • Relational operators: <, <=, >, >=, and ==

    Zero is returned when the expression evaluates to false and nonzero is returned when true.

  • Conditional operator: Expression ? Expression1 : Expression2

    This matches the C conditional operator. If Expression evaluates to nonzero then Expression1 is evaluated otherwise Expression2 is evaluated.

    Note

    When using a conditional operator in a +offset context on an execution region or load region description, the final expression is considered relative only if both Expression1 and Expression2, are considered relative. For example:

    er1 0x8000
    {
        ...
    }
    er2 ((ImageLimit(er1) < 0x9000) ? +0 : +0x1000)    ; er2 has a relative address
    {
        ...
    }
    er3 ((ImageLimit(er2) < 0x10000) ? 0x0 : +0)       ; er3 has an absolute address
    {
        ...
    }
    
  • Functions that return numbers.

All operators match their C counterparts in meaning and precedence.

Expressions are not case sensitive and you can use parentheses for clarity.

Copyright © 2008, 2011-2012 ARM. All rights reserved.ARM DUI 0458C
Non-ConfidentialID062912

Keil logo

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.