Repository navigation
refactor(elf): report pointer relocation failures through ParseFailure - #10748
Merged
morluto merged 1 commit intoNov 15, 2026
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
Contributor
[Medium impact] The changes appear safe to merge; no actionable issues were found. SummaryMoves
Reviews (1) · Last reviewed commit: "refactor(elf): report pointer relocation..." · Reviewed by Greptile |
morluto
force-pushed
the
refactor/elf-pointer-relocation-parse-failure
branch
from
November 15, 2026 02:20
7ac3bbe to
b74eaf8
Compare
morluto
changed the base branch from
main
to
fix/il2cpp-limit-public-maximum
November 15, 2026 02:20
22 tasks
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
Stacked on #10741 (#10701 merged). The capacity
unitthat #10741 adds stays a field beside the ParseFailurelimit.ElfPointerRelocationFailure, the shared ELF loader-interpretation failure used by IL2CPP, Android JNI and native initializers, extendedErrorwith its ownreasonvocabulary and a loose optionalmaximum. It now extendsParseFailureError(formatelf-pointer-relocations), so each consumer reads the sharedkindand the capacity budget from the ParseFailurelimitinstead of re-deriving them from reason strings or repeating the budget literal.Problem and expected behavior
if (cause.maximum !== undefined), a check that could not fail once the overloads required a maximum.reason === "native-index-capacity"to capacity andreason === "malformed-container"to malformed by hand.BinaryResourceFailurewith a hard-coded16 * 1024 * 1024, a second copy of the producer's budget, and the provider had a separate branch for the original class.Expected: one failure algebra carried by the producer. Public results are unchanged: the only capacity site reachable from initializer scanning is the 16 MiB dynamic-directory allowance, so its reported maximum stays 16777216, now read from the failure.
Change and scope
src/native/metadata/ElfPointerRelocations.ts:ElfPointerRelocationFailure extends ParseFailureError<"malformed" | "unsupported" | "limit">.malformed-containerismalformed; the two unsupported reasons areunsupported(undecodedContenttrue only for an unread pointer encoding);native-index-capacityislimitwith{ name, maximum }. Thereasoncode and message text are kept; themaximumfield is removed.src/il2cpp/Il2cppBinaryImage.ts: forwardsfailure.limit.maximum; the deadmaximum !== undefinedpath is gone.src/native/android/AndroidJniLibrary.ts: maps bykind.src/native/initializers/ElfInitializers.ts: rethrows the limit failure instead of rebuilding it with a copied budget;NativeInitializersProvider.tsreports{ boundary: "structure", maximum: failure.limit.maximum }.Not included: other per-format failure classes; ELF section-table limits.
Contribution scope: ordinary refactor within existing boundaries; not applicable.
Contract and boundary impact
Semantic owner and earliest changed stage:
ElfPointerRelocationFailure(producer). Consumers: IL2CPP binary image, Android JNI, native initializers and their provider. Superseded: the optionalmaximumfield, IL2CPP's dead branch, JNI's reason-string mapping, the initializer's copied 16 MiB literal.Contribution scope fit and linked maintainer decision: W7 part 6 follow-up "ElfPointerRelocationFailure onto ParseFailure".
CLI and MCP/tool-catalog contract: none.
Provider, bridge, target-format, or platform compatibility: none.
Evidence, artifact, provenance, or reconstruction contract: none.
Target selection, authority, upstream behavior, and cleanup details: not applicable.
Generated metadata, package, or installation impact: none.
Read existing files or captured data.
Launch or attach to a process.
Inject instrumentation or run scripts/code.
Change process memory, registers, files, or configuration.
Contact network services.
Recover protected code or work around protections.
Documentation or usability only; no target interaction.
Not sure yet; investigation or maintainer guidance needed.
Evidence and regression coverage
Tests updated:
src/native/metadata/ElfPointerRelocations.test.tsasserts the capacity refusal as a ParseFailurelimit(format: "elf-pointer-relocations",limit: { name: "native-index-capacity", maximum: 4096 }) with the same reason and message.Existing consumer coverage passes unchanged: IL2CPP binary linking, Android JNI library(ies), native initializers (filesystem and MCP).
Remaining proof gaps: no test drives the initializer path into the 16 MiB dynamic-directory allowance (it needs a >16 MiB dynamic segment); that mapping is source-derived.
Observed, derived, and inferred claims remain distinguishable.
Artifact identity, source provenance, and failed attempts remain preserved.
Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
npm run test:local -- src/native/metadata/ElfPointerRelocations.test.ts— 24 passed.npm run test:focused -- tests/boundary/filesystem/nativeInitializers.test.ts tests/boundary/il2cpp/il2cppBinaryFile.test.ts tests/boundary/android/androidJniLibrary.test.ts tests/boundary/android/androidJniLibraries.test.ts tests/boundary/mcp/nativeInitializersMcp.test.ts— 5 files, 241 passed.npm run typecheck— passed.npx oxlinton changed files — no errors.node scripts/verify/architecture-guards.mjs— passed.After rebasing onto fix(il2cpp): report the exceeded native-link maximum in the public refusal #10741:
npm run test:local -- src/native/metadata/ElfPointerRelocations.test.ts— 24 passed;npm run test:focused -- tests/boundary/il2cpp/il2cppMetadataProvider.test.ts tests/boundary/il2cpp/il2cppBinaryFile.test.ts tests/boundary/filesystem/nativeInitializers.test.ts tests/boundary/android/androidJniLibrary.test.ts tests/boundary/android/androidJniLibraries.test.ts tests/boundary/mcp/nativeInitializersMcp.test.ts— 275 passed; typecheck and oxlint clean.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.