fix(relinker): drop the input PT_PHDR and PT_INTERP from Linux output #2877

Closed
danzaio wants to merge 1 commit from upstream-pr/2877 into main
danzaio commented 2026-10-10 17:19:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by danzaio on 2026-10-10T17:19:00Z.


PR body draft — fix/relinker-phdr-interp (issue #2816, carries ctj01)

What

I watched a converted game die on startup because the loader read the wrong headers.

The relinker wrote its own PT_PHDR and PT_INTERP next to the input's copies. The loader takes the load bias from the last PT_PHDR, which is the stale input one, and the process faults before main. The input's PT_PHDR and PT_INTERP are now filtered out. Carries ctj01's branch, closed by intake before review.

Tested

Windows, MinGW 15.2, relinker-only build. linux_input_program_headers covers neither/interp-only/phdr-only/both/exact-slots: fails without the fix, passes with it. The run-until-entry half is Linux-only; structural checks ran here. Conventions check passes.
Not run: Linux execution.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4813057990 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2877). Originally posted by [danzaio](https://github.com/danzaio) on 2026-10-10T17:19:00Z. --- # PR body draft — fix/relinker-phdr-interp (issue #2816, carries ctj01) ### What I watched a converted game die on startup because the loader read the wrong headers. The relinker wrote its own `PT_PHDR` and `PT_INTERP` next to the input's copies. The loader takes the load bias from the last `PT_PHDR`, which is the stale input one, and the process faults before main. The input's `PT_PHDR` and `PT_INTERP` are now filtered out. Carries ctj01's branch, closed by intake before review. ### Tested Windows, MinGW 15.2, relinker-only build. `linux_input_program_headers` covers neither/interp-only/phdr-only/both/exact-slots: fails without the fix, passes with it. The run-until-entry half is Linux-only; structural checks ran here. Conventions check passes. Not run: Linux execution. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-10 17:19:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T17:19:11Z.


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:6100159984 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2877#issuecomment-6100159984). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T17:19:11Z. --- 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.

Pull request closed

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!2877
No description provided.