Skip to content

fix: Emit undefined symbol error even if primary reference is GCed#1737

Merged
davidlattimore merged 1 commit into
mainfrom
push-zpwuntutxxqm
Mar 21, 2026
Merged

fix: Emit undefined symbol error even if primary reference is GCed#1737
davidlattimore merged 1 commit into
mainfrom
push-zpwuntutxxqm

Conversation

@davidlattimore

@davidlattimore davidlattimore commented Mar 21, 2026

Copy link
Copy Markdown
Member

Issue #1739

@davidlattimore

Copy link
Copy Markdown
Member Author

Previously, we only emitted undefined symbol errors when the reference came from the file that "owned" that symbol. This kind of worked because if multiple files all referenced the undefined symbol, we'd emit an undefined symbol error for one of them. If the section containing the reference got GCed though, then we'd not emit the error.

In order to fix this, we now don't check if the reference came from the canonical file for that symbol. Removing that check required that we fix how we identify if a symbol is undefined. We were relying on ValueFlags::ABSOLUTE being set, however that flag is also set for absolute symbols, so wasn't sufficient. We now read the symbol from the object file that owns it so we can check if it's actually undefined.

@davidlattimore davidlattimore merged commit 7aa6d2c into main Mar 21, 2026
23 checks passed
@davidlattimore davidlattimore deleted the push-zpwuntutxxqm branch March 21, 2026 04:10
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