Repository navigation
Conversation
Map zero-filesz loads like elf_map so a mid-page BSS segment does not wipe the previous page. Padzero whenever filesz is not page-aligned, including filesz==memsz. Accept padded PT_INTERP paths and unordered non-overlapping PT_LOADs. Clear leftover GPRs in the enter stubs. Co-authored-by: Cursor Grok 4.6 <cursoragent@cursor.com> Co-authored-by: Charles Wang <wan9chi@users.noreply.github.com>
Treat PT_INTERP as optional. Map only the executable when it is absent, set AT_BASE to 0, and enter e_entry. Add cc -static and -static-pie runtime fixtures covering traditional static and static-PIE. Co-authored-by: Cursor Grok 4.6 <cursoragent@cursor.com> Co-authored-by: Charles Wang <wan9chi@users.noreply.github.com>
fspy benchmarklinuxmacoswindows |
The undefined __fspy_global_allocator_must_not_be_used symbol is for freestanding Linux/none binaries. Linking it into fspy_preload_windows fails MSVC because the rlib object is retained. Also align cargo-shear with the rustc-only allocator fixture and skip lib doctests that rustdoc compiles with std. Co-authored-by: Cursor Grok 4.6 <cursoragent@cursor.com> Co-authored-by: Charles Wang <wan9chi@users.noreply.github.com>
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.
Motivation
The loader treated
PT_INTERPas required, so it could load dynamic PIE and dynamicET_EXECbut not the other two ELF cells: traditional static (ET_EXEC, no interpreter) and static-PIE (ET_DYN, no interpreter). Those are the imagesseccomp_unotifyexists for today (esbuild, Go, musl-static).PT_INTERPis now optional. With an interpreter, behavior is unchanged: map both images,AT_BASEis the interpreter bias, enterld.so. Without one, map only the executable, setAT_BASEto 0, and entere_entry, matching Linuxload_elf_binary. Runtime fixtures compiled withcc -staticandcc -static-piecover BSS, TLS, threads, malloc, and auxv.This branch also carries an earlier mapping-correctness commit (padzero, mid-page BSS-only
PT_LOAD, paddedPT_INTERP) that was not yet on the WIP branch.Note
Medium Risk
Changes process image mapping, aux vector, and entry transfer in the custom loader; mistakes could corrupt memory layout or break program startup for both dynamic and static images.
Reviewed by Cursor Bugbot for commit bf0640a. Bugbot is set up for automated code reviews on this repo. Configure here.