fix(libs): bind the system libraries eagerly on Linux #3214
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3214"
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 fma-rc on 2026-10-11T01:34:55Z.
What
The system libraries were linked with lazy binding, so the first call through one of their PLT slots runs the dynamic linker's symbol lookup on whatever stack the title is on. Titles call our exports on stacks sized for the console: Astro's Playroom (PPSA01325) runs a fiber on a 2 KiB context, and on its first
sceFiberRunthe lookup for the call from the fiber trampoline wrote below that context into the neighbouring heap chunks. The title's own libc then found the damage on a later free and reported it.This links
libcand everyprxlibrary with-z nowon Linux, so nothing is resolved at call time. The relinked executable and guest modules already bind eagerly.Tested
Arch Linux, GCC 16.2.1, glibc.
fibergains a case that runs a fiber on a 2 KiB context at the top of a pattern-filled area as the first fiber run of the process and requires nothing below the context to change: it fails onmaind31b57a4cand passes with the linker change. All 121 built libraries carryBIND_NOWafterwards. Full ctest: 752/752 on RADV gfx1036; on an RTX 5080 onlyagc_driver_dcc_keys_first_writefails, an AGC test this change does not touch.tools/check_conventions.py --base origin/mainpasses.Astro's Playroom needs libSceJobManager to load, so the title runs used this change on top of the branch of #3170: without it the title stops on
sceLibcInternalHeapErrorReportForGame_nid_postfix not implemented(2 of 2 runs), with it that stop is gone and it stops later onimage descriptor is incompatible with the static runtime image interface: descriptor format 71(2 of 2 runs).Not tested: Windows and macOS (the change does not touch them), and host libraries that a distribution ships with lazy binding.
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 github-actions[bot] on 2026-10-11T01:35:04Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.