fix(relinker): preserve Linux executable exports and ELF section addresses #2785

Merged
tototomate123 merged 2 commits from upstream-pr/2785 into main 2026-10-11 07:20:46 +00:00
tototomate123 commented 2026-10-10 15:00:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tototomate123 on 2026-10-10T15:00:29Z.


What

Split from #1616, following its review. Map section addresses through load segments; preserve defined executable exports, DT_HASH and DT_DEBUG so Linux symbol lookup and debugging can find them. Includes an executable-export regression and malformed-symbol-table check. Two commits.

Tested

Linux x86-64, GCC 16.2.1, Release. linux_executable_exports passes (generated Linux ELF loads and calls its exported symbol; malformed input is rejected). Relinker builds. Conventions and whitespace checks pass on current main (5edae353).

Depends on

None for build. HFW integration also needs #2786 (loader), #2787 (filesystem), #2788 (http), #2789 (apr), #2790 (shader). #1269 (media), #1339 (VRR), #1586 (unwind) and #1436 (imports) are now on main. Local image-table experiments are excluded; open #757 → #758 overlaps them, and #920 is closed without merging. Earlier combined integration reached menu/loading UI; these isolated branches have not been game-tested and gameplay is unverified.

Checklist

  • Based on current main; no duplicate implementation found beyond superseded #1616
  • One topic per PR
  • No code comments except technical debt
  • Unimplemented paths throw; offline HTTP limitations documented
  • No investigation notes, logs or images committed
  • No new third-party dependencies
  • Generic behavior; no title-specific dispatch
  • Depends on: none for build; HFW integration requirements listed above
  • AI-assisted: yes, Codex
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4812129534 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2785). Originally posted by [tototomate123](https://github.com/tototomate123) on 2026-10-10T15:00:29Z. --- ### What Split from #1616, following its review. Map section addresses through load segments; preserve defined executable exports, `DT_HASH` and `DT_DEBUG` so Linux symbol lookup and debugging can find them. Includes an executable-export regression and malformed-symbol-table check. Two commits. ### Tested Linux x86-64, GCC 16.2.1, Release. `linux_executable_exports` passes (generated Linux ELF loads and calls its exported symbol; malformed input is rejected). Relinker builds. Conventions and whitespace checks pass on current main (`5edae353`). ### Depends on None for build. HFW integration also needs #2786 (loader), #2787 (filesystem), #2788 (http), #2789 (apr), #2790 (shader). #1269 (media), #1339 (VRR), #1586 (unwind) and #1436 (imports) are now on main. Local image-table experiments are excluded; open #757 → #758 overlaps them, and #920 is closed without merging. Earlier combined integration reached menu/loading UI; these isolated branches have not been game-tested and gameplay is unverified. ### Checklist - [x] Based on current `main`; no duplicate implementation found beyond superseded #1616 - [x] One topic per PR - [x] No code comments except technical debt - [x] Unimplemented paths throw; offline HTTP limitations documented - [x] No investigation notes, logs or images committed - [x] No new third-party dependencies - [x] Generic behavior; no title-specific dispatch - [x] Depends on: none for build; HFW integration requirements listed above - [x] AI-assisted: yes, Codex
github-actions[bot] commented 2026-10-10 15:00:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T15:00:39Z.


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6098832157 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2785#issuecomment-6098832157). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T15:00:39Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
adriadam10 commented 2026-10-11 07:20:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:20:42Z.


Checked on Linux x86-64 (relinker scope, 95/95 ctest): linux_executable_exports passes with the change and fails without it (exit code 1 from the probe), and the malformed DT_OS_SYMTABSZ case is rejected. The DT_HASH chain and the section address mapping through PT_LOAD look right. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106621279 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2785#issuecomment-6106621279). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T07:20:42Z. --- Checked on Linux x86-64 (relinker scope, 95/95 ctest): `linux_executable_exports` passes with the change and fails without it (exit code 1 from the probe), and the malformed `DT_OS_SYMTABSZ` case is rejected. The `DT_HASH` chain and the section address mapping through `PT_LOAD` look right. Merging once CI is green.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2785
No description provided.