Repository navigation
fix(libc): find a relinked module by stem when the exact name misses (carries #6226) #8626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
oneandonlydean
merged 4 commits into
boykopovar:main
from
xXPBSXx:carry/6226-relinker-stem
Oct 21, 2026
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a3c4cdc
fix(libc): find a relinked module by stem when the exact name misses
lendinglibrary bfd1d5b
fix(libc): compare the relinked module stem without the last extensio…
xXPBSXx c983777
test(libkernel): rename the variant-name decoys so they still compete…
xXPBSXx 8cb7251
Merge origin/main into PR 8626
oneandonlydean File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #include "prx/libc/include/general/VabiMacros.hpp" | ||
| #include <cstdio> | ||
| #include <cstdlib> | ||
| #include <source_location> | ||
| extern "C" { | ||
| void* APS5_VABI dlopen_nid_postfix(const char*, int); | ||
| void* APS5_VABI dlsym_nid_postfix(void*, const char*); | ||
| int APS5_VABI dlclose_nid_postfix(void*); | ||
| } | ||
| static void Require(bool value, const std::source_location& location = std::source_location::current()) { | ||
| if (value) return; | ||
| std::fprintf(stderr, "guest_dynamic_loader_variants: failed at %s:%u\n", location.file_name(), location.line()); | ||
| std::abort(); | ||
| } | ||
| int main() { | ||
| using Add = int (APS5_VABI *)(int, int); | ||
| void* extension = dlopen_nid_postfix("guest_module_fixture.prx", 2); | ||
| Require(extension != nullptr); | ||
| auto add = reinterpret_cast<Add>(dlsym_nid_postfix(extension, "GuestModuleAdd")); | ||
| Require(add && add(19, 23) == 42); | ||
| Require(dlclose_nid_postfix(extension) == 0); | ||
| Require(dlopen_nid_postfix("guest_module_fixture.other.prx", 2) == nullptr); | ||
| return 0; | ||
| } |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixture no longer exercises the shortest-match or dangling-symlink-before-valid-candidate paths after the last-extension change. For the request
guest_module_fixture.prx,SameRelinkedStemstrips.GUEST.PRXand then only the last extension:guest_module_fixture.sprx.elf.GUEST.PRXyields stemguest_module_fixture.sprx, and the symlink name ending in.zprx.elf.GUEST.PRXyieldsguest_module_fixture.zprx. Neither matchesguest_module_fixture; only the copied.elf.GUEST.PRXfile matches. Could the decoy and symlink instead be named e.g.guest_module_fixture.sprx.GUEST.PRXandguest_module_fixture.zprx.GUEST.PRX? Those share the requested stem under this rule and would make the selection/error-path coverage real.