Repository navigation
fix(relinker): skip the input executable when scanning modules for --executable - #5512
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The source change keeps the original input executable excluded while each selected executable is converted, and the added regression exercises the reported case for both Linux and Windows output formats. The author reports the relinker-only suite passing (146/146); the current PR checks also pass. I found no issue in the changed path.
|
For clarity, the regression uses |
|
macOS data point plus one edge case on the guard this fix relies on. Apple M2 Max, macOS 27.2 (26B5091g), AppleClang, Ninja Release, relinker-only (
Edge case (pre-existing, same result on
Both bypassed cases still fail, but with the cryptic error this PR removes, not the explicit one. Comparing with Written with AI assistance (Claude Code). I ran the builds and tests above on my machine. |
|
Checked on the PR merged onto current |
What
--executablecannot be combined with a module directory that holds the input executable, for example--module-dir .: the run fails when the other executable is converted (input.elf: Invalid string or symbol tablewith the test fixtures).The module scan skips the input executable (#3850). Since #4786
Convert()runs once per executable and passes the executable it is converting as the file to skip. While an--executableis converted, the scan therefore reads the title's input executable as a guest module. An--executablecannot be in a module directory itself (--executable is in a guest module directory), so the input is the only executable the scan can meet.Convert()now passes the input executable toCli::ReadModulesfor every executable, so the scan skips the same file as before #4786. Runs without--executablepass the same argument as before.Tested
Relinker-only build (
-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON, Release):guest_module_dirandrelinker_executablesamong them. The five that fail there fail the same way onmain:amd64_only_converter,tls_function_coverage_register_address_loads,linux_entry_argv,linux_executable_exportsandlinux_input_program_headers.guest_module_dirgains one case, run for Linux and Windows output:--module-dir . --executable picker/picker.binwith a module next to the input. It checks that the conversion succeeds, thatpicker.picker.bin.elf/picker.picker.bin.exeis written, and thatapp0/root.prx.guest.prxis the only guest module.mainat the return code check and passes with the fix.tools/check_conventions.py --base origin/mainpasses with this title and body.Not tested: a Windows host, or a title.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)