Commit Graph
24 Commits
Author SHA1 Message Date
Adrià 2222bae20b Merge pull request #11225 from ebosido444-ai/feat/relinker-version
feat(relinker): report the build revision with --version
2026-10-27 16:16:57 +01:00
Dean 37caf45550 Merge pull request #10912 from ahmadmuj/fix/anyps5-frame-red-zone-requires-windows
fix(relinker): reject --frame-red-zone without --windows
2026-10-27 10:33:25 +13:00
ebosido444-ai e48781e8fe feat(relinker): report the build revision with --version
The relinker binary carried no build identity: a release build and a
checkout of main were indistinguishable, so a report could not name the
build it came from. --version prints the revision git describe reports,
falling back to "unknown" when the tree has no git metadata, and needs
no input or output paths. The usage line and USAGE.md list the option.
2026-10-26 09:57:41 +03:00
Dean f2c8e1dda4 Merge pull request #9657 from jotitadev/fix/autorun-skip-noop-chmod
fix(relinker): leave an already executable autorun output's mode alone
2026-10-26 11:07:10 +13:00
Ahmad Mujahid 1c3bb466a8 fix(relinker): reject --frame-red-zone without --windows 2026-10-25 13:30:50 +04:00
Ahmad Mujahid 73a681b488 fix(relinker): reject --frame-red-zone with --verify-patches 2026-10-24 21:33:31 +04:00
harisibrar1andClaude Opus 5.5 e1342e7de2 test(relinker): find the Windows test executables with GetModuleFileNameW
autorun_exit_tests built its own path from argv[0] and
windows_dependency_diagnostics_tests from GetModuleFileNameA. Both are in
the ANSI code page on Windows, but MinGW's std::filesystem::path reads a
narrow string as UTF-8, so in a build directory with characters such as
"ü" both tests stopped with "Cannot convert character sequence: Illegal
byte sequence" before testing anything (windows_diagnostic_fixture_isolation
runs the second one).

Take the path from GetModuleFileNameW on Windows. The relinker and the
generated diagnostic runner already use UTF-8 and wide APIs, so nothing
else changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 08:48:34 -04:00
Jota 600efd95be fix(relinker): leave an already executable autorun output's mode alone
Autorun added the execute bits with an unconditional chmod, even when the
output already had them. On macOS a chmod changes the file's ctime, and
Rosetta then throws away its translation of an x86_64 executable and
translates it again on the next exec, about 0.11 s per run on an M2 Max.

autorun_exit_status paid that on every POSIX run: it chmods the child and
also renames it once per quoting case, and a rename changes the ctime too.
On the x86_64 macOS relinker job it takes 5 s at the median and timed out
once at its 20 s limit, against 0.2 s on arm64. Autorun now only calls
chmod when an execute bit is missing, and the test runs symlinks to
itself instead of copying and renaming the executable. It also checks
that the executable's ctime does not change and that Autorun still makes
a non-executable output executable.
2026-10-22 03:29:42 -03:00
David 3ea53b5412 test(relinker): check the macOS fixed base layout and option parsing
macos_fixed_base relinks the fixed-base fixture with and without
--macos-fixed-base 0x400000 and checks that every segment and section
moves by the same amount, __PAGEZERO ends 64 KiB below the base, the
lowest load page is at the base, the entry offset is unchanged, and the
metadata load bias and the relocated slot hold base-relative addresses.
It also checks the lowest base and the refused options and images.

cli_args covers the parsing, range, repetition and --macos requirement.
2026-10-19 10:32:50 +02:00
Eli Yarson 346b0a92ca feat(relinker): add conversion-time game patches
A per-game relinker-patches.toml (or --patches) replaces verified bytes in
the input executable and bundled modules before conversion. Entries are
checked against the expected bytes and against every in-place writer,
the ELF header range and relocation targets. An <output-stem>.patches.toml
manifest records the applied entries, and --verify-patches checks an input
or a converted output. With no patch file the output is unchanged.
2026-10-18 14:57:13 -03:00
Adrià e967594f62 Merge pull request #5868 from Lorkydey/fix/autorun-system-failure
fix(relinker): propagate POSIX autorun failures
2026-10-15 23:01:29 +02:00
Adrià f728e37955 Merge pull request #5702 from AlexOfTheForest/test/runtime-layout
test(cli): cover RuntimeLayout file tree output
2026-10-15 14:15:39 +02:00
lorkydey 48aaec50f8 fix(relinker): propagate POSIX autorun failures 2026-10-14 16:17:24 +02:00
Renan Pires 75cfcec67c feat(relinker): load Linux executables at a fixed base with --linux-fixed-base 2026-10-14 12:35:36 +02:00
Alexej Szpevák c740935455 test(cli): cover RuntimeLayout file tree output
Add a unit test for the layout the relinker prints after a conversion:
the fixed header and library entries, extra executables in order, and
module paths merged into one sorted tree with directories marked and
duplicates collapsed.
2026-10-14 09:23:22 +02:00
Alexej Szpevák fc8165e8b9 test(cli): cover module-dir, sce-module-path and target option errors
Add parser tests for --module-dir, --sce-module-path, --macos and
--to-rosetta, including their repeat and conflict errors, which had no
coverage.
2026-10-13 16:17:23 +02:00
Kovalev Vladislav 319fa5779a feat(relinker): support fixed Windows guest image bases 2026-10-13 12:55:54 +02:00
p3nicillinandClaude Opus 5.5 99efb32c40 feat: convert a title's other executables and start them with sceSystemServiceLoadExec
The relinker's repeatable --executable converts another executable of the
title beside the output, sharing its libs, app0 and guest modules.
sceSystemServiceLoadExec maps /app0 paths to those executables, passes the
argument list on the new command line and finds the main executable through
APS5_EBOOT. RetroArch (PPSA99169) starts its frontend picker this way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 08:51:50 +01:00
Archit Dewan 5eb22de16d fix(relinker): reject empty positional paths 2026-10-11 20:28:56 -04:00
MarcZX100 0a6247532e feat(relinker): trap exact SDK syscall stubs on request 2026-10-11 16:54:02 +00:00
krishalivaibhav 1fc31ba358 feat(relinker): support explicit CLI help 2026-10-10 10:31:52 +05:30
sarohyandClaude Opus 4.8 f765b27cc0 test(relinker): cover CLI argument parsing
Cli::ParseArgs had no test coverage: its only sibling test
(AutorunExitTests) exercises the autorun launcher, not the parser.

Add cli_args_tests covering every option and its side effects, the
--rpath and --exclude-sce-module value consumption (including that the
following token is taken verbatim rather than re-parsed as a flag), the
unused-filter value and single-specification validation, the
--exclude-sce-module/--skip-sce-module conflict in both orders, the
order-independent --windows-diagnostics/--windows-gui requirement on
--windows, unknown-option and extra-positional rejection, and the usage
message when an input or output path is missing.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-10-09 02:40:19 +05:00
Arjen Singh 6ac3ad5d1d fix(relinker): quote literal autorun paths on POSIX 2026-10-06 16:18:01 -07:00
Tomás Ortellado 1fa44c7b5c fix(relinker): decode autorun exit status for the host 2026-10-05 09:23:47 -03:00