fix(relinker): print the unsupported relocation offset once #10390
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10390"
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 roboterspinne on 2026-10-23T20:45:46Z.
What
The relinker printed the file offset of a relocation type it does not support twice, for example
FAIL: Unsupported relocation type 0x9 at offset 0x4700 (offset 0x4700).ValidationPolicywrote the offset into the message and also passed it asFailureOffset, which the command line appends to every relinker error (main.cpp:469). The message now names only the type, so the line readsFAIL: Unsupported relocation type 0x9 (offset 0x4700). That matches the errors next to it in the same relocation loop, such asUnsupported PLT relocation typeandRELATIVE relocation has a nonzero symbol index, which carry the offset only inFailureOffset.relinker_conversionnow checks the exact message, as it already does for the PLT error, andexecutable_tls_relocationschecks the(offset 0x4700)suffix, so the duplicate cannot come back.wasm/Bindings.cpp) reports only the message, so it no longer shows this error's offset, as for every other error whose offset is only inFailureOffset. AddingFailureOffsetto the web converter's error text is a separate change.Tested
Ubuntu 24.04 x86_64, relinker-only Release build (
-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON); synthetic fixtures only, no title or homebrew.ctest --test-dir build-relinker: 240/240 passed.FAIL: Unsupported relocation type 0x9 (offset 0x4700)on Linux,--windowsand--macos.ValidationPolicy.cppchange,relinker_conversionandexecutable_tls_relocationsfail on the doubled offset.python3 tools/check_conventions.py --base upstream/mainwith this title and description passed.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)Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T15:43:14Z.
Review: APPROVED
Checked against main
c9b75825f3and the relinker sources (ValidationPolicy.cpp, main.cpp, wasm/Bindings.cpp, test_executable_tls_relocations.py, test_linux_fixed_base.py, ConversionTests.cpp):(offset 0x…)fromFailureOffset, and ValidationPolicy.cpp:31-33 puts the same offset in the message as well.(offset 0x4700)expectation follows fromimage()writing the relocations at 0x4700, and it isn't a substring of main's doubled line, so the regression check works. The other existing substring checks (0x17,0x99,0xbin test_linux_fixed_base.py) still match the shorter message.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.