fix(relinker): preserve GNU stack program headers #5305
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5305"
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 Ondra97 on 2026-10-13T16:49:47Z.
What
The broad OS-specific segment filter discarded PT_GNU_STACK, so converted executables lost the original stack permission request. Preserve this standard GNU header and its flags, as guest library conversion already does. The Linux ELF loader uses PF_X on this header to select stack execution permissions.
Tested
Windows, supported WinLibs GCC 15.2, Release full relinker-only build and 150/150 CTest tests passed. The new regression failed before the fix because neither stack header survived conversion. Both RW and RWX headers, their alignment and output program header order are checked. On x86-64 Linux the registered regression additionally executes a stack-written INT3: RW must fault with SIGSEGV, RWX must reach SIGTRAP. That native Linux check is delegated to CI; no Windows claim of Linux execution is made. No title run is claimed.
Local conventions and whitespace checks passed. Current open PRs were checked for overlapping files, lines and functions.
CI relinker builds and test suites passed on Linux, Windows and macOS for
391795961(Build). Full runtime-library jobs were skipped by the automatic PR policy.Combined local validation of #5283, #5286, #5298, #5302, #5305, #5308 and #5310 on main
61b8742b6: all seven patches merge without conflicts; the full relinker-only build and 150/150 CTest tests passed.Checklist
Based on current
main; no other open PR implements the same functionsOne 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 under Silent stubs in their library's technical debt fileNo notes, investigation
.mdfiles 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
Unblocks: none
GPUs tested: n/a
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T23:28:14Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/relinker/relinker/tests/test_linux_program_header_order.pyL108Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T05:36:31Z.
Closing: none of the 14 retail executables we checked carries PT_GNU_STACK, so this changes no converted title, and with the queue this high we only take converter changes a real file needs. Reopen with the title or file that hits it on current main.
Pull request closed