fix(relinker): preserve aliases for Linux guest functions at address zero #23865
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23865"
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?
Imported from boykopovar/AnyPS5. Originally posted by ballollama on 2026-11-19T20:13:25Z.
What
Emit one jump per Linux guest module for exported functions at address zero. Previously, two names for the same function got separate jumps, so their exported pointers compared unequal. Hidden functions and data symbols are unchanged.
Tested
On x86-64 Ubuntu under WSL, the synthetic guest regression test showed four distinct export addresses before the fix. After rebasing, rebuilt the relinker and ran
linux_guest_zero_address_exports,linux_guest_qualified_imports,guest_export_lookup, andguest_symbol_names; all four passed. No commercial title tested.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by edglz on 2026-11-20T21:52:38Z.
Review: APPROVED
Summary
All function exports at value 0 in one module denote the same address (
st_valueis a virtual address, not section-relative), so emitting onejmpthunk per module and pointing every such symbol at it restores pointer equality between aliases. The range check moves with the single thunk.Verification
Environment: macOS 26, Apple M4 (arm64), Apple clang 21.0.0, CMake relinker-only Release build (
-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON), PR diff applied on currentmain.linux_guest_zero_address_exportswith the writer change revertedNot verified: execution of the converted outputs on Linux or Windows; the tests that run them are host-gated.
Notes
#24152 edits the same debt entry and its fragment still says two names get two
jmps; whichever lands second should drop that clause.Verdict
Approved.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T00:53:09Z.
Review: APPROVED
Reviewed — looks good
Nothing in the reviewed change blocks merging; the alias-preserving thunk logic and regression assertions are consistent with the stated goal.
What I ran
Reviewed head
afc3cedd707f68bc7f019c3521c34e00f9baf2ecusingrepo_read.pyto inspect the prepared diff and targeted source context. No tests or builds were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The reported test runs were not reproduced. No build, test suite, commercial title, or physical console run was performed. Read all three changed files:
core/relinker/elfpatcher/src/linux/LinuxGuestModuleWriter.cpp,core/relinker/relinker/tests/test_linux_guest_zero_address_exports.py, anddocs/dev/debt/changes/linux-zero-export-aliases.md. No changed files were excluded according to the manifest.To get this to a good state
Nothing is required.