test(relinker): keep the guest_module_args fixture's GOT out of executable memory #5362
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5362"
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 thuanquang on 2026-10-13T18:00:12Z.
What
guest_module_argsfails when its macOS branch runs, which needs an x86-64 Python on macOS (an Intel Mac, or Rosetta 2 on Apple silicon). The relinker job runs onmacos-latestwith an arm64 Python, so CI skips that branch.The fixture module is a single RWX
PT_LOAD, so its GOT slot (0x2820) lands in executable memory and the converted Mach-O bindsRecordArgsinto__ELF0(initprot 7). dyld on macOS 27.0.1 refuses that bind. The relinker built at1b865fc3(#3492, which added this branch) fails the same way here, so this is the host, not a later change.The fixture now has an RX code segment (0x0–0x2000) and an RW data segment (0x2000–0x3000: dynamic section, tables and GOT), as modules are laid out. Only the test changes.
Tested
macOS 27.0.1 on Apple silicon with Rosetta 2, relinker-only Release builds of
main18c438b10:-DCMAKE_OSX_ARCHITECTURES=x86_64) with an x86-64 Python (arch -x86_64 /usr/bin/python3):guest_module_argsfails onmainwith the error above and passes with this change; the macOS branch loads the module and checks the recordedargs/argpand the returned result.mainon this machine (pr_overlap_encoding,progress_history,stubgen_stdout_newlines).The Linux branch, which loads the same fixture with
ld.so, was not run here.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-13T18:13:31Z.
Tested on macOS 27.0.1, Apple silicon, relinker-only Release (Apple clang 21), with this PR (
058b40530) merged intomain18c438b10. To run the branch CI skips, I used an x86-64 CPython 3.12 under Rosetta 2 and builtguest_module_args_host.prxfor x86-64.main:guest_module_argsfails with the same dyld error quoted above (BIND_OPCODE_DO_BIND pointer bind is in executable segment '__ELF0').Guest module argument tests passed.The full relinker suite (arm64) passes 146/146 on both.
AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T18:34:53Z.
Checked the new layout (RX 0x0–0x2000, RW 0x2000–0x3000 with dynamic section, tables and GOT): the four program headers fit before the code, offsets and sizes match the image, and the GOT slot at 0x2820 is now in the RW segment. Linux relinker ctest is green (131/131 in scope, incl.
guest_module_args); the macOS branch is confirmed by @simonbronk on macOS 27.0.1 (x86-64 Python under Rosetta). Merging.