fix(relinker): resolve all-zero dynamic symbols to null on Windows #4602
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4602"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-12T16:39:27Z.
What
Fixes #4437. Unblocks OliSe Player (
PPSA01153).In OliSe Player (
PPSA01153), the executable contains seven weak references pointing at dynamic symbol entries whose 24 bytes are all zero (no name, local, undefined, value 0). On Windows,WindowsRelocationBuilder::ApplythrewFAIL: Empty import symbol name (offset 0x18c5bb8).WindowsRelocationBuilder::Apply: when an import symbol name is empty, inspects the 24-byte symbol entry indynamicSection.DynSymData. If the entire 24-byte entry is zero (unreferenced / weak null symbol), verifies addend (type != 1 && addend != 0throwsGLOB_DAT/JUMP_SLOT relocation has a nonzero addend), writes the null/addend pointer directly to the target location (image.RequireWritable(target, 8); image.WritePointer(target, addend);), and skips adding a PE import entry. Dynamic symbols with an empty name that have non-zero attributes still throwEmpty import symbol name.TechnicalDebt.md.Tested
core/relinker/relinker/tests/test_windows_import_modules.pyverifying both that an executable with an all-zero dynamic symbol entry resolves cleanly to null on Windows, and that a non-zero symbol with an empty name is rejected withEmpty import symbol name.python tools/check_conventions.py --base origin/mainpassed cleanly with 0 errors.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-12T18:36:36Z.
I had this independently implemented and passing CI, but saw #4452 was merged into main just ahead of this. Closing in favor of #4452.
Pull request closed