Repository navigation
fix(libkernel): expose earlier guest modules to Mach-O imports - #8481
Closed
ycarogabriel-lgtm wants to merge 1 commit into
Closed
ycarogabriel-lgtm wants to merge 1 commit into
ycarogabriel-lgtm wants to merge 1 commit into
Conversation
…on macOS
Relinked Mach-O modules bind every import by flat lookup, and dyld leaves images opened RTLD_LOCAL out of that lookup, while on the console and in ELF a module's dependencies resolve its imports whatever mode they were loaded with. sceKernelLoadStartModule and a plain dlopen open modules locally, so libfmodstudio could not find the libfmod it depends on ('symbol not found in flat namespace'), the load failed only through dlerror and both Planet of Lana (PPSA19450) and God of War: Sons of Sparta (PPSA28997) waited forever, as imellag traced on boykopovar#7332 and checked by opening modules globally.
On macOS the host dlopen now always uses RTLD_GLOBAL. The guest's own scope is unchanged: dlsym with the default handle skips the image of a module the guest opened without RTLD_GLOBAL, which GuestDynamicLoader now checks on every host. The remaining difference is in the libkernel debt file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 1b8d47c)
|
Thank you for your contribution! Authors with no pull requests merged into |
This was referenced Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On macOS, load guest Mach-O modules with host
RTLD_GLOBALso a later relinked module can bind an import from a dependency loaded earlier. Preserve the guest'sRTLD_LOCALbehavior fordlsym(RTLD_DEFAULT, ...)by checking the owning dyld image before returning a symbol. Linux and Windows paths keep their existing flag handling.This extracts the module-visibility change and its focused dynamic-loader check from the former integration PR #7332. The known host limitation is recorded in the libkernel technical-debt entry.
Tested
ctest --test-dir build-mac -R '^guest_dynamic_loader$'passed at integration headb5fddb65c, which contains this change. The full non-GPU suite on its preceding integration head passed 842/843; the coldpatched_librariestimeout passed alone.main;python3 tools/check_conventions.py --base origin/mainpassed. A standalone macOS build onmainis blocked by its unchangedlibc/General.cppuntil fix(libc): build the host-facing libc code on macOS #4627 (Apple time and stat fields) is integrated. The test was not rerun standalone on this branch.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)