Next: , Previous: Operators, Up: Expressions

3.10.7 Evaluation

The linker evaluates expressions lazily. It only computes the value of an expression when absolutely necessary.

The linker needs some information, such as the value of the start address of the first section, and the origins and lengths of memory regions, in order to do any linking at all. These values are computed as soon as possible when the linker reads in the linker script.



Some expressions, such as those depending upon the location counter `.', must be evaluated during section allocation.


         .text 9+this_isnt_constant :
           { *(.text) }

will cause the error message `non constant expression for initial address'.