Commit Graph
616 Commits
Author SHA1 Message Date
Adrià 5c0cc1bba4 Merge pull request #5755 from AlexOfTheForest/fix/decoder-rip-far-indirect
fix(relinker): report RIP-relative operands of far indirect CALL and JMP
2026-10-15 15:58:16 +02:00
Adrià 0c32e8dd02 Merge pull request #5741 from IshmamDC217/fix/relinker-load-file-ranges
fix(relinker): check PT_LOAD and uncovered PT_SCE_RELRO file ranges
2026-10-15 15:07:43 +02:00
Adrià 2b8a685dfe Merge pull request #5683 from MarcZX100/codex/rosetta-scalar-compare-5642
fix(relinker): isolate Rosetta scalar compare hazards
2026-10-15 14:57:14 +02:00
Adrià 54ee3c0945 Merge pull request #5675 from fogydes/fix/test-windows-fixed-base-error-mode
test(relinker): suppress Windows error dialog in occupied base collision check
2026-10-15 14:56:20 +02:00
Adrià f3c00ad28e Merge pull request #5670 from fogydes/fix/relinker-cfg-address-overflow-guards
fix(relinker): prevent address overflow and signed UB in CFG, GOT access, and entry point analysis
2026-10-15 14:55:50 +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
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
Adrià 7bb2b1f973 Merge pull request #5598 from JJenkx/fix/guest-declared-host-import-registry
fix(relinker): record declared host imports in guest registries
2026-10-15 13:58:59 +02:00
Adrià f50d4335ab Merge pull request #5587 from nikowolf123/fix/relinker-dependency-diagnostics
fix(relinker): name missing and non-PE modules in Windows dependency diagnostics
2026-10-15 13:39:17 +02:00
Adrià 38d2454486 Merge pull request #5559 from JJenkx/fix/guest-executable-import-dependencies
fix(relinker): select guest startup dependencies from required roots
2026-10-15 13:38:52 +02:00
Adrià 341613ab62 Merge pull request #5543 from mariuszkreft/fix/gpu-extra-load-drops-guest-tail
fix(relinker): place the Linux extra PT_LOAD past the last guest page
2026-10-15 13:31:07 +02:00
Ishmam AhmedandClaude Opus 5.5 063cf4894b fix(relinker): drop the PT_LOAD range check made redundant in translation
ReadProgramHeaders now rejects a PT_LOAD whose file range exceeds the
input, so TranslateVirtualAddress no longer needs its own check. An
uncovered PT_SCE_RELRO outside the file reports the same "Segment offset
out of bounds" as a PT_LOAD, and a test pins that a load or uncovered
PT_SCE_RELRO ending exactly at the end of the file is still accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P9JfvrCsztJtbkd5SATAzL
2026-10-15 12:16:49 +01:00
Ishmam AhmedandClaude Opus 5.5 d7ebcf7712 fix(relinker): check PT_LOAD and uncovered PT_SCE_RELRO file ranges
ElfReader::ReadProgramHeaders checked that a PT_LOAD's file size does
not exceed its memory size, but not that its file range lies inside the
input. The Windows and macOS writers reject such a segment later; the
Linux patcher keeps the original PT_LOADs and appends its own block at
the old end of the file, so a load reaching past the input mapped the
relinker's .dynstr, .dynsym and entry stub into the guest segment.

A PT_SCE_RELRO that no PT_LOAD covers is turned into a PT_LOAD after
the per-header checks, so it skipped them: a file size larger than its
memory size was accepted for Linux, and Windows and macOS reported a
file-range error instead.

Reject a PT_LOAD whose file range exceeds the input, and run the same
two checks on an uncovered PT_SCE_RELRO before converting it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P9JfvrCsztJtbkd5SATAzL
2026-10-15 12:16:49 +01:00
JJenkx a38314933d test(relinker): provide libkernel host fixture for deferred dependencies 2026-10-15 01:41:59 -04:00
JJenkx d94000a096 fix(relinker): load guest providers used by executable imports 2026-10-15 01:40:33 -04:00
JJenkx 39ba223bdd fix(relinker): defer runtime-only guest dependencies 2026-10-15 01:40:33 -04:00
m2 (AI Agent) 7f73643e0c test(relinker): name each program-layout check instead of tracking its line 2026-10-15 03:50:14 +02:00
Adrià 839d242405 Merge pull request #5508 from Zinebyte/test/executable-segment-scan-boundaries
test(relinker): cover executable segment scan boundaries
2026-10-15 02:38:28 +02: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
Adrià 411e5e6d9f Merge pull request #4916 from harry-z-kang/codex/issue-2776-dependency-audit
fix(relinker): audit dependencies without imported functions
2026-10-14 21:44:04 +02:00
Adrià 358e218a4c Merge pull request #5083 from Dripl1x/codex/secondary-loadexec
fix(libSceSystemService): pass LoadExec arguments as the whole guest argv
2026-10-14 21:37:44 +02:00
Adrià e23eff5f49 Merge pull request #5386 from simonbronk/fix/relinker-macos-weak-imports
fix(relinker): keep weak imports weak in macOS binds
2026-10-14 21:25:57 +02:00
Adrià 067d13037e Merge pull request #5362 from thuanquang/test/guest-module-args-data-segment
test(relinker): keep the guest_module_args fixture's GOT out of executable memory
2026-10-14 20:58:30 +02:00
Kang, Harry Zixuan b2c9e91102 fix(relinker): audit dependencies without imported functions 2026-10-14 20:57:16 +02:00
Adrià 08a7f7a8cf Merge pull request #5298 from Ondra97/codex/fix-macos-runpath-lists
fix(relinker): emit separate macOS run paths from ELF lists
2026-10-14 20:55:24 +02:00
Adrià 6bb4fdc4f3 Merge pull request #5286 from Ondra97/codex/fix-windows-icon-chunk-types
fix(relinker): reject invalid PNG icon chunk types
2026-10-14 20:54:27 +02:00
Adrià a1b6be7ef0 Merge pull request #5269 from Nixitov/feat/relinker-weak-imports
fix(tools): do not report weak imports as a title's current stop
2026-10-14 20:52:19 +02:00
Adrià 5561db28ea Merge pull request #5018 from SandstromPL/fix/relinker-replace-outputs
fix(relinker): replace output files instead of rewriting them in place
2026-10-14 19:53:07 +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
Evgeniy KazarinandClaude Opus 5.5 a1b80121c1 fix(libSceSystemService): pass LoadExec arguments as the whole guest argv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 18:41:25 +03:00
Adrià ecdcf34f75 Merge pull request #5406 from tibzejoker/feat/relinker-report-all-unresolved-imports
feat(relinker): report every unresolved ELF import before failing on Windows
2026-10-14 14:07:46 +02:00
Adrià 067f4f6147 Merge pull request #5116 from sanxchep/perf/relinker-streamed-scans
perf(relinker): stream scans and reuse executable buffers
2026-10-14 14:02:10 +02:00
thibautandClaude Opus 5.5 4ae26f8ba0 feat(relinker): report every unresolved ELF import before failing on Windows
The Windows startup stub stopped at the first import it could not
resolve, so a title missing several functions showed one
"FAIL: unresolved ELF import" line per run and needed a run per
missing function to list them all.

The stub now counts unresolved imports, writes the FAIL line of each
and goes on with the next import. After the last import it fails once,
with the searched library list and the last Windows error as before,
and exits with STATUS_ENTRYPOINT_NOT_FOUND. Weak imports, lazy binding
and a startup where every import resolves are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1W4jdNSKTV7xwuS6xQPJV
2026-10-14 13:38:31 +02:00
Adrià Franch 3d101e8bc5 fix(relinker): drop constants main already defines after the rebase 2026-10-14 12:36:59 +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
Adrià b6c7893f9e Merge pull request #4869 from omurc4/feat/load-failure-hint
feat(relinker): hint at the MinGW runtime DLLs when a module fails to load with error 126
2026-10-14 12:27:35 +02:00
Yossi Yadgar acc228ab4a test(relinker): check the execute bits of --macos outputs
relinker_executables converts the picker case with --macos too and
requires both Mach-O outputs to be executable. It fails when the
permission change is limited to Linux outputs.
2026-10-14 12:49:21 +03:00
Yossi Yadgar 0e8d280509 test(relinker): check that converted executables can be executed
relinker_executables now requires the execute bits on app.elf and on
picker.picker.bin.elf. It fails with the previous main.cpp, where both
are 0644.
2026-10-14 12:49:12 +03: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
Dean 6f12584c9b Merge pull request #5443 from SandstromPL/fix/relinker-executable-module-host-needed
fix(relinker): share guest modules between executables that need different system libraries
2026-10-14 22:38:14 +13:00
Alexej Szpevák 8e812f4b73 fix(relinker): report RIP-relative operands of far indirect CALL and JMP
DecodeInstruction returned before reading the ModRM of FF /3 and FF /5,
so a far CALL or JMP through a RIP-relative pointer had no RIP-relative
displacement. A stub that moved such a JMP copied the displacement
without relocating it.

The decoder was compared with iced-x86 (AMD decoding) over 3.99 million
encodings: every opcode of the legacy, 0F, 0F38 and 0F3A maps under 34
prefix combinations and the VEX 0F, 0F38 and 0F3A maps, each with 48
ModRM forms. Apart from this, it agrees on length, RIP-relative offset,
control flow kind and branch target for every valid Zen 2 instruction
except near branches with a 66 prefix, recorded as technical debt, and
kernel-only returns, which it treats as sequential.

Add the comparison's metadata as cases: one RIP-relative encoding per
opcode, map and immediate size, every FF /r form, and the branch forms
with their flow kind and target. The existing cases check lengths only;
a loop or jrcxz decoded as an unconditional jump passed the whole suite.
2026-10-14 11:33:59 +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
ArjenS-LA 69375305f5 fix(relinker): reject collisions between generated outputs 2026-10-13 23:59:02 -07:00
Dean 58e016f0c8 Merge pull request #4739 from Ondra97/codex/fix-windows-guest-tpoff
fix(relinker): relocate Windows guest TLS from its thread pointer
2026-10-14 19:33:32 +13:00
Dean 9ff1af5dd1 Merge pull request #4726 from Ondra97/codex/fix-sectionless-export-roots
fix(relinker): retain imports used by sectionless exports
2026-10-14 19:33:07 +13:00
Leandro Soares 8b400afc5d fix(relinker): move hazard scalar compares out of line for Rosetta 2026-10-14 06:19:58 +00:00
Ondra97 46b96329e3 fix(relinker): reject invalid PNG icon chunk types 2026-10-14 07:53:01 +02:00
fogydes d41a3e65f6 test(relinker): suppress Windows error dialog in occupied base collision check 2026-10-14 11:18:46 +05:30
fogydes 9dc2ce8acf fix(relinker): prevent address overflow and signed UB in CFG, GOT access, and entry point analysis 2026-10-14 11:14:34 +05:30
Sanxchep Sharma 94ae3f1bfe perf(relinker): stream scans and reuse executable buffers 2026-10-14 07:40:54 +02:00