fix(relinker): accept absolute symbols in guest modules #698
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/698"
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 merwie on 2026-10-05T16:39:45Z.
What
Guest modules may define symbols in
SHN_ABS(0xfff1). PPSA12544 (Hollow Knight: Silksong) bundlesIl2cppUserAssemblies.prxwith 151 of them (<NID>#K#A,STB_GLOBAL,STT_NOTYPE, value 1). The relinker failed on the first one withUnsupported special symbol section.GuestImageReader: anSHN_ABSsymbol is accepted and its value is not checked as a mapped address. Other special sections (SHN_COMMON, ...) are still rejected.WindowsGuestModuleWriter:R_X86_64_64/GLOB_DAT/JUMP_SLOTagainst anSHN_ABSsymbol writevalue + addendwith no base relocation.SHN_ABSsymbols are not exported on Windows and not entered in the guest export map: a PE export is an RVA, so an import of one fails at startup as an unresolved import. No module of PPSA12544 imports any of the 151. On Linux the dynamic symbol table is kept, so ld.so resolves them natively.guest_absolute_symbols: a guest module with an exported absolute symbol and a relocation against it relinks for Linux and Windows (Windows output holds the absolute value, Linux output keeps the relocation against theSHN_ABSsymbol);SHN_COMMONstill fails.Tested
Windows 11, WinLibs GCC 15.2.0 r7, Ryzen 7 9800X3D, Radeon RX 9070 XT.
ctest: 287/289 passed, includingguest_absolute_symbols.agc_driver_lds_atomics64andagc_driver_vopc_compare_tablefail on this machine; they run on the Vulkan device and do not touch the relinker.Il2cppUserAssemblies.prx) relink; at startup only unimplemented exports remain unresolved (separate PR).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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by merwie on 2026-10-05T20:49:20Z.
On the overlap note: #672 and #684 are different topics (host prx references on Linux, Windows import module binding). The overlap is neighbouring lines in
core/relinker/CMakeLists.txt(test registration),GuestImage.hppand the export checks inGuestModuleBuilder.cpp; whichever merges second needs a small rebase, no behaviour depends on the other.