Repository navigation
docs: add NID and symbol patching reference - #1937
Closed
klosixgaming-arch wants to merge 1 commit into
Closed
klosixgaming-arch wants to merge 1 commit into
klosixgaming-arch wants to merge 1 commit into
Conversation
Contributor
|
I reviewed the full document against the current source and ran the Conventions check and |
Collaborator
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.
Adds
docs/dev/NID_PATCHING.md, a reference for the NID and symbol patching rules that are currently scattered acrossCONTRIBUTING.md(one bullet),core/libs/nid/,ExportMacros.hppand issue #1827.It covers:
core/libs/nid/src/NidCompute.cpp(SHA-1 with the fixed 16-byte suffix, first 8 digest bytes reversed, 6-bit encoding overA-Z a-z 0-9 + -, 11 characters). Cross-checked: the C++ andtools/nid_names.pyimplementations agree with each other and with the aerolib SCE symbol database (159,030/159,042 entries; the 12 exceptions are foursceBgft*names repeated across modules).libcpatched without a reference, every other library with--preserve-exportspointing at the unpatchedlibc.prx; what the PE and ELF patchers rewrite (export table,.dynsym/.dynstr/.gnu.hash,DT_NEEDED/.gnu.version_r,.eh_framerename).ResolveNids(exclusion set,_nid_no_patch_cut,_nid_no_patch/SDL_, theX+X_nid_postfixpair, NID rename with_nid_disambig<digits>stripping), with worked examples._nid_postfixorsceprefix) and why cross-library calls must beextern "C": the suffix test is against the literal dynamic symbol name, so mangled C++ names are never rewritten._nid_postfix,_nid_disambig<digits>,_nid_no_patch,_nid_no_patch_cut,SDL_) with real usage examples from the tree, including theAPS5_EXPORTunknown-NID mechanism.GetLastError: 127) and how to check a cross-library call against the rules.Every rule and example in the doc was read from the cited source on
mainbefore writing. New file only; no code changes, no tests needed.AI-assisted: yes
Written with AI assistance.