Repository navigation
fix(libSceLibcInternal): keep the named _Pad exports from binding to themselves - #22440
Closed
Krille2004zzz wants to merge 1 commit into
Closed
Krille2004zzz wants to merge 1 commit into
Krille2004zzz wants to merge 1 commit into
Conversation
…themselves libSceLibcInternal exports _Pad::_Pad(const char*) and the two named _Pad::_Launch overloads by forwarding to libc's functions of the same NIDs. After NID patching each import has the name of the library's own export, so when libSceLibcInternal comes before libc in the lookup scope the forwarder calls itself. libc now keeps the named constructor body in ConstructNamedPad_nid_no_patch and exposes LaunchPad_nid_no_patch, and the libSceLibcInternal exports call those, as boykopovar#13730 does for the other forwarders. patched_self_imports passes again on Linux.
Merged
12 tasks done
12 tasks done
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Contributor
Author
|
Superseded by #22500, which landed the same no_patch forwarding for the three named _Pad exports. Closing. |
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
patched_self_importsfails onmainsince #22248 (merged 2026-11-17):#22248 added libSceLibcInternal exports for
_Pad::_Pad(const char*)(uhnb6dnXOnc),_Pad::_Launch(const char*, pthread**)(PBbZjsL6nfc) and_Pad::_Launch(const char*, pthread_attr**, pthread**)(H7-7Z3ixv-w). Each one forwards to libc's_nid_postfixfunction with the same NID. After NID patching, each import has the same name as libSceLibcInternal's own export. So when libSceLibcInternal comes before libc in the lookup scope, the forwarder calls itself. This is the case #13730 fixed for the other forwarders, and this PR uses the same pattern:ConstructNamedPad_nid_no_patch._ZNSt4_PadC2EPKc_nid_postfixnow calls it.LaunchPad_nid_no_patchis no longerstatic. Both helpers are declared inlibc/include/General.hpp.No behaviour changes, with one exception. A null
padpassed to the named constructor now namesConstructNamedPad_nid_no_patchin thestd::invalid_argumentmessage. Before, it named_ZNSt4_PadC2EPKc_nid_postfix._ZNSt4_PadD1Ev(XyJPhPqpzMw) forwards to_ZNSt4_PadD2Ev, which libSceLibcInternal does not export, so it is unchanged.Tested
Linux x86-64 (Debian, GCC 14.2.0), Release,
BUILD_TESTING=ON, on currentmain(1adc0e2f4b). No title tested.patched_self_imports:main, it fails with the three lines above.nm -D:libSceLibcInternal.prximportsConstructNamedPad_nid_no_patchandLaunchPad_nid_no_patch.libc.prxdefines both.guest_libc_internal_padand the otherguest_thread*tests pass.ctest -R 'libc|LibcInternal|locale|patched': 156 tests, all of which pass or are skipped. The 2 skipped areguest_http_uri_localeandagc_driver_indirect_patched_stage.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.py --branch:_ZNSt4_PadC2EPKc. refactor(prx): name the libSceLibcInternal export aliases the NID databases resolve #17300 conflicts withmain, so I compared it by hand. It renames the libSceLibcInternal aliases and predates the three named_Padexports. It does not touch these forwarders.Threads.cpporGeneral.hppbut conflict withmain. I compared their hunks by hand: none touches the_Padfunctions or the changed lines.patched_self_importsdoes not run.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)