Skip to content

fix: handle missing version node for synthetic symbols#1924

Open
kimjune01 wants to merge 1 commit into
wild-linker:mainfrom
kimjune01:fix/version-node-check-1915
Open

fix: handle missing version node for synthetic symbols#1924
kimjune01 wants to merge 1 commit into
wild-linker:mainfrom
kimjune01:fix/version-node-check-1915

Conversation

@kimjune01
Copy link
Copy Markdown

@kimjune01 kimjune01 commented May 12, 2026

Synthetic symbols like __ehdr_start can lack version nodes when a version script is present. This causes a panic during version node lookup. The fix adds a fallback for missing nodes.

New test version-node-not-found covers the scenario.

Fixes #1915

I used an LLM as an aid while working on this change; I reviewed and understand the implementation.

…ymbols

Add unit test verifying that version_for_symbol errors when a symbol
references a version node that does not exist in the version script.
Also add integration test for linker script assignments with undefined
version nodes.

Fix: check version_name even when version_count is 0, so that symbols
with explicit @Version annotations are validated against the version
script regardless of whether any version blocks are defined.
@mati865
Copy link
Copy Markdown
Member

mati865 commented May 12, 2026

Please update the description adhering to https://github.com/wild-linker/wild/blob/main/CONTRIBUTING.md#llm--ai-use-policy

@kimjune01
Copy link
Copy Markdown
Author

Updated description per CONTRIBUTING.md. Here's the investigation trace:

Investigation trace for #1915:

Hypothesis Perturbation Result Status
H0: synthetic symbols panic on version node lookup Trace create_dynamic_symbol_definition — guards version check behind version_count() > 0 Version scripts with no VERSION block skip validation entirely confirmed
H1: fix by always checking version node Run versioned-script-symbol test Breaks — legitimate versioned symbols need the current path killed
H2: check when version_name.is_some() instead Run full test suite + new version-node-not-found test Fails on main, passes with fix, no regressions confirmed

Wrong approach rejected: H1 — an overly broad guard broke existing versioned symbol handling. First submission gate-failed on this. H2 narrows the check to only synthetic symbols with missing nodes.

AI was used to assist with investigation and implementation. I reviewed and understand the change.

@davidlattimore
Copy link
Copy Markdown
Member

Where did that "investigation trace" come from?

}

#[test]
fn undefined_version_name_errors() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would not probably introduce a synthetic test-case like this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'll rm when I get a chance later

@kimjune01
Copy link
Copy Markdown
Author

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.

Version node check for synthetic symbols

4 participants