Basic syntax
relinker [options] <input.elf> <output>Linux ELF is the default output format even if the filename ends in .exe. To create Windows PE, use --windows. The input must be a clean ELF with bundled ELF modules in supported sibling directories.
# Linux target
./relinker source/input.elf app.elf
# Windows target (example with renamed executable)
.\relinker.exe --windows source\input.elf app.exeRelevant options
| Option | Purpose |
|---|---|
--windows | Generate a Windows PE executable. |
--to-intel | Convert supported AMD-specific instructions for Intel hosts; not universally guaranteed. |
--windows-diagnostics | Startup dependency diagnostics; requires Windows output. |
--registry | Emit import metadata in an adjacent .registry.json file. |
--rpath <path> | Change runtime host-library lookup location from default $ORIGIN/libs. |
--autorun | Launch generated output after conversion; requires a prepared matching runtime. |
unused-filter=0|1|2 | Control import filtering. Syntax is without --; default 0. |
Deprecated flags such as --skip-sce-module and --lazy-binding are debug-only and may produce severely unstable output. The upstream tool does not define a standard --help switch; invoking without arguments prints syntax and exits with an error.
Diagnose missing imports with the audit tool
The upstream repository includes a Python 3 script for identifying imported functions that are implemented, stubbed, absent, or provided by bundled modules. The audit is a static dependency check, not gameplay proof.
relinker --registry source/input.elf app.elf
python3 tools/import_audit.py app.registry.json \
--libs build/core/libs/libs \
--modules source/sce_moduleThe script is in the upstream repository and requires access to built host libraries. A passing static audit cannot verify rendering, input, audio, or saves.
Understand the newest Relinker and crash diagnostics
A failed conversion is not always caused by the game's imported system libraries. On 21 October, merged PR #8614 fixed an incorrect control-flow scan after a call followed by alignment padding. The actual test case was Prospero Themes (PPSA90210), which incorrectly failed Windows and macOS conversion with Unsupported ... guest TLS instruction (bytes: 64 55). The fix changes how the Relinker traverses its executable code; it does not introduce a new TLS emulator or prove that all converted titles run. The author tested successful conversion on the PR branch, and the patch was merged after the v0.1.3 release.
Two other merged fixes address malformed inputs rather than game compatibility: PR #8738 rejects invalid UTF-8 rather than producing unreadable .registry.json output, while PR #8757 rejects ELF PT_TLS initialization bytes whose file range is outside the supplied input. These checks reduce misleading conversion successes and corrupted metadata. They require a build containing those commits; using a downloaded older release does not silently enable them.
For runtime failure reports, merged PR #8791 improves APS5_TRACE_CALLS: Windows crash/abort and Linux abort reports now include up to 32 of the reporting thread's own recent traced calls, in addition to the last 64 process-wide calls. Its reproducer used Daxter (PPSA09695), where another thread's looping mutex calls displaced the crash thread's evidence. A shorter call trace is not a performance benchmark and cannot by itself classify a game as playable.
Windows conversion: identical duplicate ELF relocations
If the Relinker reports FAIL: Overlapping ELF relocation targets (offset 0x...), inspect whether two RELA records target the same location. In upstream PR #11299, merged 26 October, the Forever Launcher (PPSA99030) child executable game-child.bin repeated the same R_X86_64_RELATIVE entry at offset 0x2df70 with addend 0x2e040. The Windows Relinker on updated main skips a duplicate only when both its relocation information and addend match. A conflicting relocation at the same address still fails rather than overwriting arbitrary output.
Choose your next check: if the entries are identical, compare with a Relinker built from main containing #11299; if their types or addends differ, keep the full error and relocation details for diagnosis. The existing v0.1.5 release predates this change. In the upstream test, converting eboot.bin and game-child.bin succeeded after the fix, while starting the title still failed because its Wine runtime required the already-reserved Windows address 0x7ffe0000. Successful conversion and runtime startup are separate results.
When a converted module starts too early
A clean conversion can still crash when a title dynamically loads plugin modules with arguments. The location of those modules matters. On Windows main with merged PR #8162 (21 October), a runtime module explicitly supplied through --module-dir Media/Modules or --module-dir Media/Plugins is loaded for imports but does not necessarily run module_start during executable initialization. Its initialization is deferred until the title requests it through sceKernelLoadStartModule, so the runtime can forward the argument block supplied by the title. Before the fix, modules that were also listed in the executable's dependencies could start with no arguments and never receive the later game-provided configuration.
This distinction is not universal to every module folder. The Relinker treats original sce_module, sce_modules and prx directories differently from explicit runtime --module-dir paths. In particular, modules in the original system-related directories still need to initialize early so that imports such as libc.prx remain usable; deferring everything would introduce new failures. The PR validation exercises both paths and documents the remaining limitation for runtime modules on which another guest module depends.
The practical test was a Unity-based PS4 title on an experimental PS4 path: Hasbro Family Fun Pack starts mono-ps4.sprx with an 88-byte argument block, and the premature-start path caused a plugin to dereference a null argument. On the fixed candidate, the first scene rendered. A separate Metal Gear Solid: Peace Walker tester reported that the beach tutorial continued on their particular development branch. Those tests establish the module-lifetime bug and its branch-scoped improvement; they do not demonstrate general PlayStation 4 support on the stable release. If you hit a plugin initialization crash, preserve the exact source folders, the passed --module-dir arguments and the commit used to convert the executable before comparing your results.
22 October Linux executable base and linked-module differences
Merged PR #8973 makes an executable base of 0x400000 the default for newly generated Linux output on main. Some titles' guest libc memory allocators rejected the earlier high-positioned PIE executable image. The existing --linux-fixed-base option still supports specifying an address explicitly, while --lazy-binding retains its own PIE layout. Check the version-scoped Linux guide: current main and official v0.1.3 are not interchangeable binaries, and a low loading address cannot solve graphics or missing PRX issues.
Capture comparable performance evidence
On upstream main builds including merged PR #7080 (20 October), APS5_TRACE_SUMMARY_EVERY enables repeated trace summaries. With APS5_TRACE_BENCH=1, AnyPS5 writes a compressed aps5-bench-<commit>-<pid>.json.gz report (in APS5_TRACE_DIR, if set). It records frame intervals and resolution alongside the host CPU and title metadata when available. This main-branch feature is newer than the tagged v0.1.2 release.
# Example for a supported Linux runtime build containing PR #7080
APS5_TRACE_SUMMARY_EVERY=10 APS5_TRACE_BENCH=1 ./app.elfFor useful comparisons, hold the title, saved scene, resolution, shader-cache state, GPU driver, commit and experimental switches constant. A benchmark file measures timing for that run, not whether the entire game is playable. Read the upstream benchmark-report reference for currently supported fields and paths.
Compare traces without mixing titles or hardware
On builds containing merged PR #8545, tools/performance_compare.py includes recorded CPU, title identifier, game version, CPU thread count and system memory in configuration differences. The --require-matching-context mode rejects comparisons when known metadata differs, instead of silently treating captures from two different titles as equivalent. An older trace may lack metadata, so inspect its warnings; even matching hardware fields do not prove that two recordings used the same in-game scene.
For a concrete example, the Hi-Fi RUSH Windows main trace records a title-screen median of 84.9 ms per frame and about 19.7 ms of GPU work. Queue 0x20 spent roughly 84.6 ms each frame in a memory wait. This is evidence of a synchronization bottleneck for that scene and build, not a general GPU specification. Keep the same scene, warm-cache policy, trace-window duration, release/commit and device driver before interpreting a chart as an optimization.
Export trace intervals to CSV on current main
Upstream merged PR #12357 (28 October) adds tools/trace_intervals_csv.py. It converts interval records from an aps5-summary.jsonl file into a spreadsheet-ready CSV; it does not convert raw trace archives or benchmark .json.gz files. This script is in the upstream source tree after v0.1.3, not inside that tagged release.
# Run from an AnyPS5 source checkout, with Python 3
python3 tools/trace_intervals_csv.py path/to/aps5-summary.jsonl > trace-intervals.csv
Each CSV row is one recorded interval, with its start/end seconds, presents, frame-time p50/p90/p99/max (milliseconds), GPU busy time per present, busiest worker and phase, dropped-trace flag and identity-change flag. Empty optional fields stay empty; a valid file without interval records exports only the header. To inspect a slowdown, sort by p90_ms or max_ms and compare gpu_busy_ms_per_present with top_phase_ms_per_frame; trace_dropped indicates incomplete event coverage. An identity_changed row requires rechecking the title, commit and device before comparing intervals. The CSV does not itself prove a performance fix or gameplay compatibility. Inspect the exact exporter ↗.
Controllers and keyboard mapping
SDL-recognized controllers map to standard PS-style inputs. For keyboard customization, create anyps5-input.ini next to the converted executable. Example:
Cross = KEY:F
Cross = KEY:Space
LeftStickLeft = KEY:J
LeftStickRight = KEY:L
LeftStickUp = KEY:I
LeftStickDown = KEY:K
Square = MOUSE:LeftA missing configuration file is fine (built-in bindings apply). An invalid line can stop input initialization. On current upstream main, recognized PlayStation controllers forward touchpad clicks and positions of up to two fingers; availability in a tagged build depends on its included commits. Full details: official input mapping reference ↗.
System fonts and GPU choice
Games relying on PS5 system fonts may need a local anyps5-fonts/ directory with properly licensed substitutes. The upstream document lists accepted Noto fonts. AnyPS5 selects the first usable Vulkan 1.1 device and prefers a discrete GPU; ANYPS5_GPU can select another detected device by name. Neither feature guarantees game compatibility.
Relinker exit codes
0 means conversion succeeded; 1 means invalid arguments; 2 means conversion failed, with details printed to stderr. --autorun may instead return the launched application's exit status.