Commit Graph
1028 Commits
Author SHA1 Message Date
Adrià d01070d6c3 Merge pull request #5640 from EagleBearerYS/feat/relinker-frame-frameless-leaves
feat(relinker): frame red-zone leaves without a frame pointer by moving their rsp operands
2026-10-24 18:14:53 +02:00
Dean 5c90b0a65e Merge pull request #9228 from savvaniss/feat/log-deferred-imported-modules
feat(relinker): log deferred Windows modules the executable imports from
2026-10-25 05:10:41 +13:00
Dean a8c8b8117b Merge pull request #8900 from WhiteAssassins/feat/patch-advisor
feat(tools): recommend verified local game patches
2026-10-25 03:51:47 +13:00
Savvanis SpyrosandClaude Opus 5.5 66ccd46909 Merge remote-tracking branch 'origin/main' into feat/log-deferred-imported-modules
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 16:35:28 +03:00
Adrià b84322da6a Merge pull request #7918 from Kernel-Hunter/fix/rosetta-xsaveopt
fix(relinker): rewrite XSAVEOPT to XSAVE under --to-rosetta
2026-10-24 14:14:59 +02:00
Adrià 3fcacfbc0d Merge pull request #7822 from yash27git/fix/refuse-truncated-branch-rewrites
fix(relinker): guard length-changing rewrites around truncated branches
2026-10-24 14:14:54 +02:00
Dean a011db7048 Merge pull request #8142 from Kernel-Hunter/fix/rosetta-masked-stores
fix(relinker): probe masked store elements before the store under --to-rosetta
2026-10-25 00:56:00 +13:00
Adrià ac28b89bd9 Merge pull request #7706 from Destroyers212x/fix/macos-gs-trap-branch-target
fix(relinker): refuse branches into trapped guest GS instructions on macOS
2026-10-24 12:54:07 +02:00
Adrià a0a8ef2fd5 Merge pull request #7837 from muteburrito/test/relinker-embedded-code-data
test(relinker): characterize embedded code data scanning
2026-10-24 12:53:05 +02:00
Adrià 50aa1798e7 Merge pull request #7741 from MarcZX10/codex/macos-main-thread-mxcsr
fix(relinker): initialize MXCSR in macOS guest entry
2026-10-24 12:51:40 +02:00
Dean 622adaccc1 Merge pull request #10241 from Bram910/fix/registry-offset-locale
fix(relinker): keep registry offsets independent of host locale
2026-10-24 23:40:01 +13:00
Dean bc559d4c98 Merge pull request #10342 from Filip722/submit/got-20261023
fix(relinker): preserve wrapped EIP-relative GOT accesses
2026-10-24 22:10:34 +13:00
Dean 538d97052e Merge pull request #10339 from Filip722/submit/rex-20261023
fix(relinker): honor the final REX prefix in call-site loads
2026-10-24 22:10:08 +13:00
Karim Masmoudi ce6c2a0c66 fix(relinker): rewrite XSAVEOPT to XSAVE under --to-rosetta
XSAVEOPT raises an illegal instruction under Rosetta on an M5 running
macOS 27.0.1, as XSAVEC does, while XSAVE and XRSTOR save and restore
x87, SSE and AVX state in the standard format. The PS5's Zen 2 has
XSAVEOPT, so code built for it can use the instruction without a CPUID
check.

XSAVEOPT differs from XSAVE only in the init and modified optimizations:
it may skip writing state that is in its initial configuration or
unchanged since the last XRSTOR from the same area. XRSTOR restores the
same state from the area XSAVE writes, so --to-rosetta rewrites
XSAVEOPT (NP 0F AE /6, memory operand) to XSAVE (/4) in place, keeping
the prefixes and the operand, as RDSEED becomes RDRAND. CLWB (66 0F AE
/6), MFENCE, UMONITOR, UMWAIT and the Intel target are left alone.
XSAVEC is not converted: it writes the compacted format.

The converter tests check the rewrite for the plain, REX.W,
RSP-relative, extended-base, RIP-relative and FS-relative forms, check
that the neighbouring 0F AE encodings are not taken, and execute the
rewritten XSAVEOPT64 followed by XRSTOR on YMM3 in the x86-64 build.
The --to-rosetta integration test now covers XSAVEOPT as well.
2026-10-24 11:01:44 +02:00
Adrià FranchandClaude Sonnet 5.5 e1fea2ebc8 fix(relinker): drop stray blank line and document the moving-branch guard
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-24 10:58:12 +02:00
Yaash Singhh f5fbf2f98d fix(relinker): rebase truncated branch guard onto current main 2026-10-24 10:58:00 +02:00
Dean 34a41ada16 Merge pull request #10341 from Filip722/submit/phnum-20261023
fix(relinker): reject unsupported extended program header counts
2026-10-24 21:08:06 +13:00
Dean 933c0e4f1d Merge pull request #10343 from Filip722/submit/cfg-20261023
fix(relinker): honor EIP-relative addresses in the control-flow graph
2026-10-24 20:48:35 +13:00
Dean a8e32e0017 Merge pull request #9518 from harisibrar1/fix/relinker-tests-nonascii-paths
test(relinker): find the Windows test executables with GetModuleFileNameW
2026-10-24 20:46:17 +13:00
Dean ee955e5728 Merge pull request #8664 from lulebo/test/relinker-unused-import-asan-option
test(relinker): run guest_unused_import_dependencies with the ASan host-loading option
2026-10-24 20:23:47 +13:00
Dean 5fa2520ad9 Merge pull request #10258 from MarcZX10/fix/relinker-same-file-missing-paths
fix(relinker): reject missing paths in same-file checks
2026-10-24 20:23:19 +13:00
Dean ec3ea2f558 Merge pull request #6586 from JJenkx/fix/linux-runtime-module-start
fix(loader): defer Linux runtime module starts until requested
2026-10-24 19:54:29 +13:00
Dean 6f7c8cb8fb Merge pull request #10242 from Nciibi/fix/relinker-inplace-follower-wide-store
fix(relinker): move a following in-place replacement into a 256-bit store's stub
2026-10-24 19:53:07 +13:00
Dean 0ace96fac3 Merge pull request #10357 from roboterspinne/claude/new-session-2p8mgt
refactor(relinker): remove relocation types validation already rejects
2026-10-24 18:20:56 +13:00
Dean 6c52b649e7 Merge pull request #9261 from wail-arch/fix/linux-sdk-homebrew-imports
fix(relinker): bind SDK guest module imports on Linux
2026-10-24 17:11:50 +13:00
Dean 194859bf6c Merge pull request #9238 from milescoviello/fix/asan-unused-import-dependencies
fix(build): run guest_unused_import_dependencies without the ASan link order check
2026-10-24 16:08:59 +13:00
Queuze a19a7d52bf chore: sync contribution #9000 with main 2026-10-23 20:02:19 -03:00
wail-arch 75212edbfd fix(relinker): keep only visible executable exports bound by name
A bundled module's import keeps its name only when the executable
exports it as a visible global or weak symbol, as the dynamic loader
can bind it. Test local, internal and hidden executable symbols of the
same name next to global, weak and protected ones.
2026-10-23 21:40:31 +00:00
roboterspinne da511cb29c refactor(relinker): remove relocation types validation already rejects
ValidationPolicy rejects R_X86_64_GOT32, PLT32, GOTPCREL, 32S, GOTPCRELX
and REX_GOTPCRELX for every DT_RELA and DT_JMPREL entry before the Linux
patcher runs, so the R_X86_64_32S case of the fixed-base relocation
list cannot be reached. It was the only user of R_X86_64_32S, and the
other five constants have none. Remove the case and the six constants;
no behaviour changes.
2026-10-23 18:55:45 +00:00
Dean 542a610220 Merge pull request #8343 from DavidSamir/fix/relinker-windows-page-spanning-relocation
fix(relinker): accept a Windows base relocation that spans into the next page
2026-10-24 07:30:39 +13:00
Dean 12f7e1cd3f Merge pull request #9220 from roboterspinne/claude/new-session-2p8mgt
fix(relinker): reject link-time relocation types in executables
2026-10-24 07:27:45 +13:00
Filip Michalski bd4b30b079 fix(relinker): preserve wrapped EIP-relative GOT accesses 2026-10-23 20:16:52 +02:00
Filip Michalski 2cd0e5e488 fix(relinker): honor EIP-relative addresses in the control-flow graph 2026-10-23 20:16:52 +02:00
Filip Michalski 62e1d3089c fix(relinker): reject unsupported extended program header counts 2026-10-23 20:16:51 +02:00
Filip Michalski b7aa2a8001 fix(relinker): honor the final REX prefix in call-site loads 2026-10-23 20:16:50 +02:00
MarcZX10 88b1027c46 test(relinker): assert missing path error details 2026-10-23 16:18:01 +00:00
MarcZX10 c1f2d7a69e fix(relinker): reject missing paths in same-file checks 2026-10-23 16:00:15 +00:00
Yunus Shaikh cec1f82d76 test(relinker): frame inflate_fast's cmp at rsp before a branch through the instructions before it
red_zone_framer frames two leaves whose 4-byte cmp %rdi,(%rsp) sits
before a jne: after an add (inflate_fast's shape) and after a load below
rsp that heads the loop and moves by the shift inside the stub, and no
operand in a stub is also moved in place. A cmp whose loop branches back
to it stays refused, the widened stub covering the branch target. The
execution test runs both framed leaves under writes below rsp.
2026-10-23 08:36:08 -07:00
Yunus Shaikhandtibzejoker e410c38b42 feat(relinker): extend a short rsp operand's stub over the instructions before it
When the instruction after an rsp operand that cannot move in place is
a branch, a rip-relative instruction or a freeing add, the operand's stub
could stay shorter than a jump and the leaf was skipped. The stub now
also takes the contiguous sequential instructions before the operand,
moving their own rsp operands by the shift; the branch-target, site and
existing-stub checks run on the widened range, and the instructions it
covers leave the in-place moves. zlib's inflate_fast, whose only operand
left is a 4-byte cmp %rdi,(%rsp) between an add and a jne, frames this
way.

The backward extension is tibzejoker's, from their comment on
boykopovar/AnyPS5#5640: with it, 243 of Grand Theft Auto V's 991
red-zone leaves frame (240 before), inflate_fast among them, and one
leaf is left with no room for a stub.

red_zone_framer's leaf whose operand at rsp sits before a rip-relative
load now frames; the one before an exit stays refused, its forward
extension reaching the exit's pops.

Co-authored-by: tibzejoker <[email protected]>
2026-10-23 08:36:06 -07:00
JJenkx 5c507eda39 test(loader): verify deferred module unload and reload lifecycle 2026-10-23 11:15:41 -04:00
JJenkx bbaf07d110 test(loader): cover reentrant deferred module loads 2026-10-23 11:15:41 -04:00
JJenkx a82db0717d test(loader): separate import mapping from runtime initialization 2026-10-23 11:15:41 -04:00
JJenkx df7fe4182f test(relinker): check deferred zero-init host dependency 2026-10-23 11:15:41 -04:00
JJenkx 8309412720 test(loader): distinguish runtime mapping from explicit initialization 2026-10-23 11:15:41 -04:00
JJenkx d1b40c5aa6 test(relinker): use a guest-relative zero-init fixture run path 2026-10-23 11:15:40 -04:00
JJenkx 13b33108b6 fix(relinker): retain deferred zero-address initializers
Retain DT_INIT presence when emitting the deferred Linux lifecycle slot. Check zero-valued initializers with and without preinit, native argument forwarding and return status, and the absent-tag case. Addresses the interaction with PR #6684 identified in review.
2026-10-23 11:15:40 -04:00
JJenkx adf0176d3a fix(loader): preserve SDK startup in browser conversions 2026-10-23 11:15:40 -04:00
JJenkx 2d4d55036d test(loader): preserve explicit zero-argument module starts 2026-10-23 11:15:40 -04:00
JJenkx cd5dea57aa test(loader): verify explicit runtime starts and record lifecycle limits 2026-10-23 11:15:40 -04:00
JJenkx 74878ee102 feat(loader): prototype deferred Linux runtime module lifecycles 2026-10-23 11:15:40 -04:00