Repository navigation
fix(native): retain defined global and weak ELF symbols with GNU version index 0 - #9100
Merged
morluto merged 1 commit intoNov 6, 2026
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Afloat16
added a commit
to Afloat16/rea
that referenced
this pull request
Nov 6, 2026
Integrate the upstream version-index correction in morluto#9100. The old dynamic-table test excluded a defined global symbol solely because its GNU version index was zero. Check both global and weak symbols as unversioned exports, and keep a local-binding control that must stay excluded.
3 of 4 tasks
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #8984.
Retains defined, default/protected-visibility global, weak, and unique dynamic ELF symbols when their GNU symbol-version index is 0 (
VER_NDX_LOCAL), reporting them as unversioned exports (version: null) rather than unconditionally omitting them from export inventory.Problem and expected behavior
NativeExportParserparses defined dynamic symbols and applies binding, section, and visibility guards (rejecting undefined, local, and hidden/internal symbols). However, when a.gnu.versiontable was present, line 697 unconditionally executedif (versionIndex === 0) continue;, discarding any defined global or weak symbol assigned version index 0.GNU Binutils and Oracle Solaris versioning specifications state that version index 0 denotes an unversioned base symbol (or one to which no explicit version definition applies), not that an otherwise global or weak symbol definition is localized or hidden. Consequently, defined exports with version index 0 were omitted from
inspect-native-exportsresults despitecoverage.status: "complete".Expected behavior:
version: null.Change and scope
src/native/exports/NativeExportParser.ts, removedif (versionIndex === 0) continue;. Version indexes 0 and 1 correctly resolve toversion: null, while indexes >= 2 resolve through version definitions and requirements.src/native/exports/NativeExportParser.test.ts:binding: 0).version: null, while undefined, hidden, and local symbols remain excluded.Contract and boundary impact
src/native/exports/NativeExportParser.ts.inspect-native-exportsandnative_exportsschema.Expected effects:
Evidence and regression coverage
src/native/exports/NativeExportParser.test.ts(describe("ELF version index 0 unversioned exports", ...)).For evidence-bearing changes:
Validation performed
npx vitest run src/native/exports/NativeExportParser.test.ts— 46/46 tests passed.npm run compile— passed with 0 errors.npm run check:fast— passed with 0 errors (Turbo typecheck and linting across all packages).npm run verify:module-boundaries— 3750 source files checked, passed.npm run verify:test-discovery— 3128 test files checked, passed.Compatibility, safety, and release
Author readiness
Human owner: @highmachs
Before merge
type(scope): outcome.