OLD-8847: restore old upstream PR 8847 - pe_loader: move an image with no relocation directory; refuse only on IMAGE_FILE_RELOCS_STRIPPED #634
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!634
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/634/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@aslan2142 on GitHub · 2026-11-24 10:33 UTC · original
aslan2142:loader-rebase-without-reloc-dir→main· +113 −10 · 4 files · 3 commits · merged 2026-11-25 22:53 UTCClaimed in the coordination issue as: OLD-8847 #14
Restoration of my original pull request, old upstream PR 8847 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Its two commits are cherry-picked ontomainat21625bca8without conflicts. One extra commit replaces the links to the old PR number, which no longer resolve, with plain text.What and why
Loader::map_imagerefuses any image whose preferred base is taken when the image has no relocation directory (runtime/src/pe_loader.cpp:1428-1431and:1456-1459onmain). Windows only refuses that move whenIMAGE_FILE_RELOCS_STRIPPEDis set. With the flag clear, it moves the image without fix-ups.This PR follows Windows:
mainRELOCS_STRIPPEDsays (the Windows 11 measurement from the original PR's review)main.Tested
main(21625bca8) with only this PR's tests: 99 checks, 2 failed. The two are "an image without relocations, flag clear, moves when its base is taken" and "an image with IMAGE_FILE_RELOCS_STRIPPED is refused when its base is taken".git diff --checkandpython -I scripts/check_no_game_data.pyon the changed files are clean.GPUs tested: n/a (CPU-only loader tests)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).
@PierreEbele on GitHub · 2026-11-25 01:39 UTC · original
Reviewed
bb256ebb: read the relocation-move policy end to end (a relocation table applies regardless ofIMAGE_FILE_RELOCS_STRIPPED; with no table, flag set refuses and flag clear moves without fixups and logs) and all three commits. The only8847reference in docs/code isruntime/README.md's unreadable-origin note, matching the old-number rule, and the Win11 error-487 free-base question stays documented. Merges cleanly into currentorigin/main(auto-merging disjoint edits inruntime/src/pe_loader.cppandruntime/README.md). On arm64 Linux (no network), the portable runtime builds and its CTest passes onbb256ebb(72/72, 2 skipped:shader_library_corpus,vk_sync_validation);loader_testis WIN32-only (windows.h) and was not run;compileall, the 12 doc tests (47 tests, 2 git-dependent skipped),test_boot_trace.py,test_ctest_registration.py, andcheck_no_game_data.pyall pass onpr634,origin/main, and the merged tree. Statically againstorigin/main, all helpers intest_moved_without_relocationsexist, Block 1 (flag clear) expects a load main refuses, and Block 2 (flag set) asserts the new"stripped"refusal message, so the test exercises the change. No blocking findings. AI-assisted review.Recommendation: Merge
@aslan2142 on GitHub · 2026-11-25 22:53 UTC · original
Merged:
pe_loadermoves an image that has no relocation directory, and refuses only onIMAGE_FILE_RELOCS_STRIPPED.mainand with #643, and no review point is open.main5fab93967with all nine of these runtime PRs merged together (#634, #643, #684, #657, #677, #638, #710, #688, #671), on llvmpipe and the gfx1036 iGPU (RADV): no test went from pass to fail.loaderpasses on both.main5fab93967+bb256ebbf: it merges cleanly; the semantic suite passes (493 files, 6,318 tests, 0 files failed); the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 4 changed files.AI-assisted (Claude Code, Claude Opus 5.5).
latencyframes in flight while armed (mailbox replace) #671