fix(relinker): accept relocations against symbol index 0 for Windows and macOS #7902
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7902"
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 mopga on 2026-10-19T13:04:39Z.
What
Code analysis rejected
R_X86_64_64,GLOB_DATandJUMP_SLOTrelocations whose symbol index is 0 (STN_UNDEF) withCode analysis: invalid relocation symbol, so--windowsand--macosfailed on an input that the Linux conversion accepts. The pipeline already resolves such relocations to 0 plus the addend, as the gABI defines and as the relinker technical debt entry records for null symbol entries; only an all-zero entry at a nonzero index was accepted. Index 0 is now treated as an import slot like that entry.Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), relinker-only build of this branch on current
main:test_null_symbol_relocations.pynow also runs both relocations against symbol index 0. Onmainit fails withCode analysis: invalid relocation symbol (offset 0x308)for Windows; with the fix the Windows executable exits 42 (slot 0x308 holds 0, slot 0x310 holds the addend), macOS converts, and the Linux imports match the index 1 case.ctest: 210/210 passed.python3 tools/check_conventions.py --base origin/mainpasses.Open PRs #6586, #6607, #6618, #6684, #6974, #6977 and #7037 change other parts of
CodeInstructionCollector.cpp; none changes this check. The PR overlap check could not compare #6618 and #6977, which conflict withmain. Checked by hand: both already conflict withmainin this file without this change (#6977 carries theR_X86_64_RELATIVEchange merged as #6357), and neither changes the line this PR changes.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T13:13:38Z.
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.
core/relinker/relinker/src/analysis/CodeInstructionCollector.cppcore/relinker/relinker/src/analysis/CodeInstructionCollector.cpp