Skip to content

fix: correctly resolve linker script functions that return addresses - #2413

Merged
davidlattimore merged 3 commits into
wild-linker:mainfrom
vishruth-thimmaiah:fix_addr_funcs
Aug 17, 2026
Merged

fix: correctly resolve linker script functions that return addresses#2413
davidlattimore merged 3 commits into
wild-linker:mainfrom
vishruth-thimmaiah:fix_addr_funcs

Conversation

@vishruth-thimmaiah

Copy link
Copy Markdown
Member

Functions such as ADDR, LOADADDR, SEGMENT_START and ORIGIN return an address instead of a number. Addresses must be treated as an absolute value, instead of being relative to an output section.

Additionally, comparison operators like ==, etc must resolve any relative values to their absolute value before performing a comparison.

Signed-off-by: Vishruth Thimmaiah <vishruththimmaiah@gmail.com>
Signed-off-by: Vishruth Thimmaiah <vishruththimmaiah@gmail.com>
@vishruth-thimmaiah
vishruth-thimmaiah marked this pull request as ready for review August 17, 2026 09:26
.data.flash : {
KEEP(*(.data.flash))
} > FLASH
ASSERT(ORIGIN(FLASH) == 0x40000000, "ROM region must start at 0x20000000")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Message doesn't match assertion. Feel free to not include the address in the message if that makes it easier :)

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.

fixed!

Signed-off-by: Vishruth Thimmaiah <vishruththimmaiah@gmail.com>
@davidlattimore
davidlattimore merged commit c545fc5 into wild-linker:main Aug 17, 2026
24 checks passed
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.

2 participants