fix(relinker): allow function aliases with different sizes #614
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/614"
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 nicolasabosch on 2026-10-05T04:50:26Z.
What
Windows conversion rejects guest modules whose dynamic function symbols share a start address but declare different sizes. The DOOM PS5 homebrew (PPSA99666, 01.001.000) ships a generated libc shim with this layout and fails with
Code analysis: conflicting function ranges (offset 0x50).Merge symbol aliases at the same address using the largest declared extent so code analysis covers every advertised byte. Each extent still has to fit its executable segment; conflicting unwind extents and TLS instruction checks retain their existing rejection behavior. No title-specific exception or module-skipping flag is added.
Tested
relinker; all 22 tests registered underbuild/core/relinkerpassed.--windows --to-intel --registry, with module processing and checks enabled, now converts the executable and libc successfully. The input package was not modified.access(8vE6Z6VEYyk, Windows error 127). In-game behavior is not tested; this PR fixes conversion only. No PS5 hardware or Linux execution tested.Checklist
main; no other open PR implementing this fix foundImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T07:26:38Z.
Thanks, this looks right to me. Only the symbol table calls pass
symbolAlias, so two dynamic symbols at the same address now merge to the largest extent, while an unwind range still has to match whatever is already recorded there. Each alias still goes through the executable segment check before it is merged, zero-size aliases are skipped as before, and the linear decode then covers the longest extent, so the unsupported TLS instruction in the longer alias's tail is still found (yoursymbol-alias-unreachable-tls-tailrow). Order doesn't matter either, since the merge takes the maximum.One small side effect, which I think is fine: the end of the shorter alias is no longer checked as an instruction boundary, because only the merged range is decoded.
tls_function_coveragefails on main's code here at the first alias row ("conflicting function ranges (offset 0x1200)") and passes with the change, and the full ctest passes with it merged (Linux, GCC).CodeInstructionCollectoris only used by the Windows TLS builder, so Linux relinks are unchanged, and this doesn't need my PPSA21564 check. Ready to merge from my side.