Commit Graph
95 Commits
Author SHA1 Message Date
Dean 5aa203ba74 Merge pull request #9663 from AdnanKhan-ak47/feat/relinker-report-unconverted-needed
feat(relinker): report needed modules shipped outside the module directories
2026-10-25 21:50:08 +13:00
Adrià d01070d6c3 Merge pull request #5640 from EagleBearerYS/feat/relinker-frame-frameless-leaves
feat(relinker): frame red-zone leaves without a frame pointer by moving their rsp operands
2026-10-24 18:14:53 +02:00
Yunus Shaikh ff16118b63 Merge branch 'main' into feat/relinker-frame-frameless-leaves-next 2026-10-23 03:13:53 +00:00
valenciana-nc 35b22f0ef3 fix(relinker): preserve icon and title metadata inputs 2026-10-22 16:35:03 -06:00
Adnan Khan f3dcf6d8be fix(relinker): skip unreadable candidates and fold case for --windows in the needed-module report 2026-10-22 14:02:37 +05:30
Adnan Khan 00d6b33126 feat(relinker): report needed modules shipped outside the module directories 2026-10-22 12:48:19 +05:30
Dean 44661db263 Merge pull request #8973 from rooklz/fix/linux-console-base
fix(relinker): load Linux executables at 0x400000 by default
2026-10-22 15:24:38 +13:00
Adrià 3f23f2ae65 Merge pull request #8689 from MarcZX10/codex/reject-large-non-elf-early
fix(relinker): reject large non-ELF inputs before allocation
2026-10-21 21:12:48 +02:00
Rookie 123ba70839 fix(relinker): load Linux executables at 0x400000 by default 2026-10-21 19:25:33 +01:00
mpratsakiandClaude Opus 5.5 763702c5ce fix(relinker): use the Windows file identity in module and executable checks
Guest module discovery skipped the input executable and the
--executable check rejected an executable converted twice through
std::filesystem::equivalent, which MinGW reports as false for hard links
whose names give different permissions, such as .bin and .exe. Move the
GetFileInformationByHandle comparison to Io::SameFile and use it for
these checks and for SameOutputFile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 02:19:01 +03:00
MarcZX10 11adccfe15 fix(relinker): preserve detailed header diagnostics 2026-10-20 21:16:19 +00:00
MarcZX10 33c1f2365f fix(relinker): validate ELF prefix before reading full input 2026-10-20 21:07:34 +00:00
mpratsakiandClaude Opus 5.5 c9731df4c9 fix(relinker): compare Windows file identities by handle
MinGW's std::filesystem::equivalent returns false for hard links whose
names give different permissions, such as .elf and .exe. The temporary
hard-link probe that worked around it failed on read-only files and on
directories that refuse the link. Compare the volume serial number and
file index from GetFileInformationByHandle instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 19:54:53 +03:00
Adrià 04078b1073 Merge pull request #6927 from jotitadev/fix/relinker-case-only-output-collisions
fix(relinker): detect output aliases with a filesystem probe outside Windows
2026-10-19 15:54:05 +02:00
Adrià 0fa6ddb137 Merge pull request #6802 from DavidSamir/feat/relinker-macos-fixed-base
feat(relinker): place macOS executables at a fixed base with --macos-fixed-base
2026-10-19 12:54:31 +02:00
Adrià 8816fd7720 Merge pull request #6715 from simonbronk/codex/windows-unicode-output-collisions
fix(relinker): reject Unicode output aliases on Windows
2026-10-19 11:06:08 +02:00
David 35fe448155 feat(relinker): place macOS executables at a fixed base with --macos-fixed-base
Ruffle (PPSA68091), VLC (PPSA85300) and XPSemu (PPSA97358) read
app0/imports.txt, whose import slot addresses assume the executable's
lowest ELF load page at 0x400000, and dereference them at once. macOS
output always placed that page at 0x140010000, so all three fault on
their first slot read. Linux and Windows have --linux-fixed-base and
--windows-fixed-base for this; macOS had no equivalent.

--macos-fixed-base <address> builds the load image so that the lowest
ELF load page is at the address, as --windows-fixed-base does. The
Mach-O header takes the 64 KiB below it and __PAGEZERO ends there. The
executable is MH_EXECUTE without MH_PIE, so dyld does not slide it. The
address must be 64 KiB aligned, from 0x20000 through 0x7fffffff0000,
and an image ending past the macOS user address space is refused.
2026-10-19 10:32:30 +02:00
Jota 502b55722a fix(relinker): detect output aliases with a filesystem probe outside Windows
Fresh outputs whose names differ only in case, or that the volume treats as the same name otherwise, were not detected outside Windows. On default macOS APFS, for example, Ä/ä, Ω/ω, Ж/ж and canonically equivalent NFC/NFD names refer to the same file, so one output silently overwrote another.

Outside Windows, create the first name in an identity directory next to the outputs and check whether the second name resolves to it. This lets the filesystem decide instead of folding text, so case-sensitive volumes still report distinct names.
2026-10-19 02:50:43 -03:00
Adrià d265c58e40 Merge pull request #6351 from thuanquang/fix/layout-relative-output
fix(relinker): list converted modules correctly for a relative output path
2026-10-19 02:40:55 +02:00
Adrià 64b57d1b02 Merge pull request #6328 from aaro56/fix/relinker-preserve-input-hardlinks
fix(relinker): preserve inputs behind Windows executable hard links
2026-10-19 01:17:35 +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à 889cee5f9f Merge pull request #6115 from ArjenS-LA/fix/relinker-needed-output-collisions
fix(relinker): reject needed companion output collisions
2026-10-18 18:44:13 +02:00
Dean 696c5f3516 Merge pull request #6156 from MarcZX100/codex/relinker-guest-dir-identity
fix(relinker): compare guest module directories by identity
2026-10-17 18:00:53 +13:00
simonbronk 46cafca20f fix(relinker): reject Unicode output aliases on Windows 2026-10-16 08:50:15 +02:00
thuanquangandClaude Opus 5.5 f40acdb2c6 fix(relinker): list converted modules correctly for a relative output path
The runtime layout printed ../app0/sce_module/... under app0/ when the
output path contained . or .. components (./out.elf), because the module
paths are normal and the output directory was not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 19:44:50 +07:00
Adrià 7a22c43027 Merge pull request #5695 from YossiYad/fix/relinker-executable-mode
fix(relinker): write Linux and macOS executables with execute permission
2026-10-15 14:15:08 +02:00
aaroandCodex 5054b67b42 fix(relinker): preserve inputs behind Windows executable hard links
Co-authored-by: Codex <[email protected]>
2026-10-15 17:23:14 +05:30
Jota 006e176812 fix(relinker): compare guest module directories by identity
(cherry picked from commit 6e3b80d65bd47344b896af9cbc763033fe6d5be0)
2026-10-14 23:42:30 +00:00
ArjenS-LA 62b09018d4 fix(relinker): reject needed companion output collisions 2026-10-14 15:36:25 -07:00
Adrià 8f9240f067 Merge pull request #5512 from zaryabzip/fix/module-dir-executable-input
fix(relinker): skip the input executable when scanning modules for --executable
2026-10-15 00:02:56 +02:00
Kang, Harry Zixuan b2c9e91102 fix(relinker): audit dependencies without imported functions 2026-10-14 20:57:16 +02:00
Adrià 2f3adfb91b Merge pull request #4802 from ArjenS-LA/fix/relinker-output-collisions
fix(relinker): reject collisions between generated outputs
2026-10-14 19:33:36 +02:00
Yunus Shaikh cef664f770 Merge branch 'main' into feat/relinker-frame-frameless-leaves 2026-10-14 05:00:25 -07: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
Yossi Yadgar ab94ee21d7 fix(relinker): write Linux and macOS executables with execute permission
The executables were written with the default file mode (0644 under a
022 umask). The documented chmod covered app.elf, but not the outputs of
--executable, so RetroArch (PPSA99169) converted with
--executable picker/picker.bin --executable es-de/es-de.bin stopped as
soon as it started its picker:

  sceSystemServiceLoadExec: execv failed: Permission denied

Every executable output now gets execute permission for owner, group and
others after it is written, as --autorun already did for app.elf. With
it RetroArch starts the picker, and the picker starts ES-DE.
2026-10-14 12:49:12 +03:00
ArjenS-LA 69375305f5 fix(relinker): reject collisions between generated outputs 2026-10-13 23:59:02 -07:00
zaryabzip 9954e58af9 fix(relinker): skip the input executable when scanning modules for --executable 2026-10-14 02:51:23 +05:00
thuanquangandClaude Opus 5.5 286cf28ec7 fix(relinker): reject a directory as the executable output path
An existing directory, or a path ending in a separator, was only
rejected when the executable was written, after the converted modules
had already been written to app0/ beside or inside it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 00:49:48 +07:00
Josip Parlov fab7d203fb feat(relinker): --frame-red-zone gives red-zone leaf functions a frame on Windows
Windows writes an exception frame directly below RSP, so a fault resumed on
a guest thread overwrites values a System V leaf function keeps in its red
zone. With --frame-red-zone, a leaf function with a
push rbp; mov rbp, rsp; push ... prologue that reads or writes below its
pushes gets two kinds of trampoline: the prologue lowers RSP by 128 bytes
after its pushes, and each pop ...; pop rbp; ret exit raises it back first.

Sites a branch enters, sites shorter than a jump and sites over a --to-intel
stub are skipped; the conversion reports the framed and skipped counts.
2026-10-13 18:46:08 +02:00
codingreapermapsandClaude Opus 5.5 430e5c833e feat(relinker): add --trace-imports for Windows executables
With --trace-imports the entry stub resolves TraceImport_nid_no_patch
in libc.prx and passes each function import through it before writing
the slot: every PLT slot, and a GOT slot only when the original symbol
is a function, so data imports such as __stdoutp keep their address.
Without the option the output is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 16:55:31 +02:00
Kovalev Vladislav 319fa5779a feat(relinker): support fixed Windows guest image bases 2026-10-13 12:55:54 +02:00
boykopovar 04899cb0f7 fix(relinker): align console progress columns 2026-10-13 13:02:03 +03:00
boykopovar c9a94dd021 fix(relinker): remove layout padding and blank lines after headings 2026-10-13 12:59:04 +03:00
boykopovar 754b82163b fix(relinker): remove indentation from conversion summary 2026-10-13 12:58:48 +03:00
boykopovar 868d7a138d fix(relinker): separate console sections without spacing every message 2026-10-13 12:58:35 +03:00
boykopovar 56c2a53188 fix(relinker): redraw console progress and format runtime layout as a tree 2026-10-13 12:58:34 +03:00
boykopovar b42aa8c540 feat(relinker): expose in-memory conversion through a portable core library 2026-10-13 12:57:53 +03:00
boykopovar 37e25a2a78 refactor(relinker): separate native module discovery from prx conversion 2026-10-13 12:57:05 +03:00
boykopovar 02cd2e57e2 refactor(relinker): move windows icon and diagnostic io to native adapters 2026-10-13 12:56:42 +03:00
boykopovar cd0433fd82 feat(relinker): report syscall scanning and import analysis progress 2026-10-13 12:56:16 +03:00