Skip to content

feat: Support --defsym=symbol=expression#1300

Merged
lapla-cogito merged 17 commits intowild-linker:mainfrom
lapla-cogito:defsym
Nov 15, 2025
Merged

feat: Support --defsym=symbol=expression#1300
lapla-cogito merged 17 commits intowild-linker:mainfrom
lapla-cogito:defsym

Conversation

@lapla-cogito
Copy link
Copy Markdown
Member

--defsym appears to be used in many places. Moreover, once this feature is merged, we can begin extending linker scripts further by implementing support for symbol aliases within the scripts themselves.

Comment thread libwild/src/layout.rs
Copy link
Copy Markdown
Member

@davidlattimore davidlattimore left a comment

Choose a reason for hiding this comment

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

Nice to have this flag!

Comment thread libwild/src/elf_writer.rs Outdated
Comment thread libwild/src/layout.rs Outdated
Comment thread libwild/src/layout.rs
Comment thread libwild/src/layout.rs
@lapla-cogito lapla-cogito force-pushed the defsym branch 3 times, most recently from 5bbefea to a194878 Compare November 14, 2025 07:32
Comment thread libwild/src/parsing.rs Outdated
Comment thread libwild/src/elf_writer.rs
Comment thread libwild/src/resolution.rs
match def_info.placement {
SymbolPlacement::ForceUndefined => {
SymbolPlacement::ForceUndefined | SymbolPlacement::DefsymSymbol(_) => {
load_symbol_named(resources, definition_out, def_info.name, work_sender);
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.

Is def_info.name the right name to be loading here? I thought that was the alias and that you'd actually want to load the target symbol?

@lapla-cogito lapla-cogito merged commit f70a0f3 into wild-linker:main Nov 15, 2025
20 checks passed
@lapla-cogito lapla-cogito deleted the defsym branch November 15, 2025 12:16
lapla-cogito added a commit that referenced this pull request Nov 16, 2025
With `--defsym` support added in #1300, we can extend this to support
top-level symbol definitions in linker scripts as well.
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