Currently, symbol definitions are evaluated after the size and addresses of all sections have already been resolved. As a result, it is not possible to use symbols defined in the linker script within the SECTIONS command, such as when setting a section's output address. Instead symbols should be lazily evaluated when they are referenced in the linker script. Additionally, this should also allow handling out of order symbol definitions, such as the following example which is treated as valid by ld:
Currently, symbol definitions are evaluated after the size and addresses of all sections have already been resolved. As a result, it is not possible to use symbols defined in the linker script within the
SECTIONScommand, such as when setting a section's output address. Instead symbols should be lazily evaluated when they are referenced in the linker script. Additionally, this should also allow handling out of order symbol definitions, such as the following example which is treated as valid by ld:b = a; a = 10;