Skip to content

feat: support using an expression when setting the location counter#2005

Open
vishruth-thimmaiah wants to merge 5 commits into
wild-linker:mainfrom
vishruth-thimmaiah:expr_loc
Open

feat: support using an expression when setting the location counter#2005
vishruth-thimmaiah wants to merge 5 commits into
wild-linker:mainfrom
vishruth-thimmaiah:expr_loc

Conversation

@vishruth-thimmaiah
Copy link
Copy Markdown
Member

This PR adds support for using expressions when setting the current location within SECTIONS.

This PR doesn't add support for using symbols when setting the location pointer.

Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
{
. = 0x600000;
. = 0x300000 * 2;
start_of_sections = .;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the location before defining any sections sets the location for the first section in the section table, not the first section in the linker script. Hence the need for this change, as the first section might not be .text.

@vishruth-thimmaiah vishruth-thimmaiah marked this pull request as draft May 31, 2026 13:23
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
@vishruth-thimmaiah vishruth-thimmaiah changed the title feat: support using an expression when setting a location with . feat: support using an expression when setting the location counter Jun 1, 2026
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
@vishruth-thimmaiah vishruth-thimmaiah marked this pull request as ready for review June 1, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant