fix(relinker): pass module start arguments to macOS guest initializers #3492
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3492"
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 fable-void on 2026-10-11T11:35:53Z.
What
On macOS, a guest module started with
sceKernelLoadStartModulenever receives its start arguments: the image initializer callsDT_INITwith none and drops its result. On currentmain(0f863c10), the extendedguest_module_argsstops at:Linux modules already call
DT_INITthrough libkernel's pending argument handoff (__aps5_get_pending_module_args_nid_no_patch,__aps5_set_module_init_result_nid_no_patch).maindoes not start guests on macOS yet; on the macOS port, the PSN plugin of Hollow Knight: Silksong (PPSA12544) refuses to start without its argument block, and the title then crashes:The macOS writer now binds the same two helpers for a module with
DT_INIT, and the initializer callsDT_INITwith the recordedargsandargp, with the same instruction sequence as the Linux stub, then hands the result back. The TechnicalDebt sentence about the missing arguments on macOS is removed.Tested
macOS on Apple silicon, relinker-only build for x86-64 (
ANYPS5_RELINKER_ONLY=ON, Release).guest_module_argsfails onmainwith the line above and passes with this change, both with an arm64 Python (structure only) and with an x86-64 Python under Rosetta 2, which loads the converted module and checks thatDT_INITreceives the arguments and that its result is returned.load_and_record; not run here.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:54:47Z.
Checked the macOS initializer against the Linux stub (same instruction sequence: args getter,
rdi/rsifrom the block,edx=0, callDT_INIT, result setter; stack aligned by the frame push),guest_module_argsfails onmainwithout the change and passes with it, and the relinker ctest (101 tests) is green on Linux. The macOS execution path itself isn't something we can run here. Merging.