Skip to content

Evaluate symbols in linker scripts lazily #2096

Description

@vishruth-thimmaiah

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:

b = a;
a = 10;

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions