feat: Make all stubs weak imports - #383
Merged
Merged
Conversation
rofl0r
reviewed
Aug 28, 2026
rofl0r
reviewed
Aug 28, 2026
GrayJack
force-pushed
the
weak-stubs
branch
4 times, most recently
from
August 28, 2026 01:33
8751ac1 to
17ce6c2
Compare
rofl0r
reviewed
Aug 28, 2026
rofl0r
reviewed
Aug 28, 2026
rofl0r
left a comment
Contributor
There was a problem hiding this comment.
since you requested a review: optically looks good now, but i cant comment on the change of the constants, as i dont really have an insight what the effect of changing them might cause.
JoseAaronLopezGarcia
approved these changes
Aug 28, 2026
JoseAaronLopezGarcia
left a comment
Contributor
There was a problem hiding this comment.
This is a necessary change, specially for low level kernel development.
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.
Make all stubs weak. This makes modules not fail to load when a linked lib was not loaded yet.
This is benefitial mostly for plugins, as they are often loaded before all system modules were started. And CFW have API that allows to inject a module to be loaded as early as the second module the system loads; in this edge case, all modules but sysmem libraries ideally should be weak.
I also noticed that some stubs were with the version part as
0011which is the system module version used onFW>=6.60on some modules, this will cause any module linking to them to fail loading on firmware version<6.60as the system checks the stubs version on load if the library module was already loaded (if the imports are below or equal to the loaded library version, the module fails to load). On the cases of library modules allowed to be loaded multiple instaces of the module, at least one loaded version must match the imported stub version. I did not test the case of a weak imported with version bigger than the version that will be loaded after, but my best guess is that some error will occur in this case as well. To avoid this, I put then all to zero on the SDK stubs.