Commit Graph

5 Commits

Author SHA1 Message Date
alfalfa-star 5e009d75ec feat(libkernel): implement the rtld thread atexit reference count
A title's libc.prx passes the dso address of __cxa_thread_atexit to
_sceKernelRtldThreadAtexitIncrement and fails the registration when it
returns nonzero. Increment takes a reference on the loaded image that
contains the address, so it stays mapped while thread_local destructors
are pending, and Decrement releases one. An address outside every
loaded image and a Decrement without a reference throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 08:36:23 +02:00
Dean 633459b09c
Merge pull request #672 from NahuelGenchi/fix/linux-guest-export-namespace
fix(relinker): keep host prx references out of guest modules on Linux
2026-10-06 13:15:49 +13:00
Nahuel Genchi 5fab03e4e5 fix(relinker): keep host prx references out of guest modules on Linux
On Linux every module resolves its references through one global scope,
and the guest modules are listed ahead of the host prx. When a title
bundles its own libc.prx, the host libc and the other host prx bound
their references to their own NIDs to the guest libc, so the host libc
built its standard streams on top of the guest _Stdout.

The exports of guest modules, and the guest and executable imports that
a guest module satisfies, now carry a #guest suffix. The title's imports
still reach the guest modules first, and a host prx only sees host
definitions, as on Windows. sceKernelDlsym also looks for the suffixed
name.
2026-10-05 19:58:39 -03:00
Merijn de93a9492c feat(libkernel): load the relinked module for a guest module path
dlopen and sceKernelLoadStartModule passed the guest path to the host
loader, which cannot load the original ELF module. When a relinked module
<path>.guest.prx exists beside it, that module is loaded instead; for a
module the executable already loaded at startup the host loader returns
the same module. PPSA12544 loads /app0/Media/Modules/Il2CppUserAssemblies.prx
at startup and resolves IL2CPP functions through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 19:41:47 +02:00
SamG-Coder 453fec28c5 feat(kernel): add tracked dynamic module loading and NID lookup 2026-09-25 06:48:50 +10:00