Repository navigation
Conversation
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
Prepare Linux/amd64 GNU IFUNC and IRELATIVE handling for the root,
native, and recursive custom ELF loaders. The implementation defers resolver calls until ordinary relocations across the load group are complete and executable segments are protected, caches each provider's selected implementation, and keeps constructors after binding. Shared preflight validates resolver locations, relocation targets, executable page layout, and returned implementation addresses. Root ELF finalizers andLibrary.Closedestructor reentry are handled in the same stack.Runtime support is inactive in this draft. Existing defined-IFUNC and IRELATIVE rejection remains effective before mapping on all three loader paths. The explicit pre-mapping check covers IRELATIVE-only images that otherwise reached the deferred queue.
This PR is stacked on #35 (
feat/elf-integration). It also includes theinternal/elfifuncpackage in the Sliver Linux Docker build contexts.Validation
CGO_ENABLED=0and1: fullgo test ./memmod ./native/internal/linuxmem -count=1passed.CGO_ENABLED=1: Go c-shared root, recursive, and native consumer integration tests passed.CGO_ENABLED=0cross-compilation passed formemmod,native, andinternal/elfifunc.git diff --check c3161cb...HEADpassed.Positive custom-loader IFUNC fixtures have been prepared separately. They compile, and under the existing guards their load tests stop at the expected rejection; no custom IFUNC resolver code was executed. Automatic approval review rejected removing the guards before those runtime gates pass and disallowed an indirect bypass. Activation requires a separate, explicit approval of the scoped Linux/amd64 guard change, followed by root, native, and recursive runtime tests in both CGO modes. If a gate fails, keep the guards in place.