Commit Graph
926 Commits
Author SHA1 Message Date
Dean ae7468d394 Merge pull request #6929 from jotitadev/fix/relinker-tls-tests-preserve-rbx
fix(relinker): restore rbx in TLS coverage bodies run on the host
2026-10-23 20:44:47 +13:00
Adrià 3a2ca40dab Merge pull request #9234 from mossyanwar/fix/relinker-linux-named-imports
fix(relinker): resolve symbol-name imports through NIDs on Linux
2026-10-22 20:54:22 +02:00
Adrià 9062485ebe Merge pull request #8880 from ycbuzi/feat/libc-num-get-objects
feat(libc): export the num_get and time_get locale objects as data
2026-10-22 19:44:08 +02:00
Dean 110a18ba01 Merge pull request #9429 from Get-fix/ps4/relinker-own-tls
fix(relinker): read guest TLS relocations against the module's own section symbol
2026-10-22 17:32:05 +13:00
Kang, Harry Zixuan 89548eb4af fix(tests): retry locked Windows TLS fixture cleanup 2026-10-21 20:45:15 -07:00
Kang, Harry Zixuan 4e9854ea2b test(relinker): report SHA-1 preservation failures precisely 2026-10-21 20:29:55 -07:00
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
bluandClaude Opus 5.5 a946c469d6 Merge upstream main into feat/libc-num-get-objects
Resolves the conflict with #8867 in EntryStubTests.cpp: keep its two
kernel-variant tests and the BufferUtils include, and this branch's
libSceAmpr-to-libc fallback test, with all three called from main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 12:33:11 -07:00
Adrià 765d3d1b97 Merge pull request #8867 from MarcZX10/codex/kernel-variant-host-fallback
fix(relinker): resolve kernel variant imports via canonical kernel
2026-10-21 21:22:06 +02: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
mossyanwar be51ab7bae fix(relinker): resolve symbol-name imports through NIDs on Linux
Homebrew built with the ps5-payload-dev SDK names its system
libraries with .sprx and imports by symbol name, while the libraries
in libs/ are .prx files that export NIDs. On Linux such an executable
converted but stopped at load time on the first .sprx dependency and,
once that was found, on the first symbol name.

The Linux patcher now loads a dependency named with .sprx, .suprx or
.debug_prx as the .prx library of the same stem. In an executable that
names such a dependency, an import without a module that is named by
symbol gets the NID of that name. A name that a bundled module exports
still binds to that module. There is no lookup by the name as written,
because the host loader also searches the host C library. Other
executables keep their unqualified imports as written.
2026-10-21 18:43:42 +01:00
Get-fix 6f3e4a147f fix(relinker): read guest TLS relocations against the module's own section symbol
Limbo's bundled libSceFios2.prx (CUSA01664) has DTPMOD64 relocations
against a local section symbol with section index 0 and value 0, in a
module without section headers. As for a TLS relocation without a
symbol, the module and offset are the module's own TLS block, so a
DTPMOD64 or DTPOFF64 against such a symbol is passed on without it. A
section symbol that names a section or has a value, a TPOFF64, a module
without PT_TLS and a DTPMOD64 with an addend still fail.
2026-10-21 19:19:07 +03:00
Dean 27bcd6a29e Merge pull request #8162 from savvaniss/fix/windows-runtime-module-start
fix(relinker): start Windows runtime modules the executable needs when the title loads them
2026-10-22 02:10:11 +13:00
Dean fbba6e8208 Merge pull request #8845 from rooklz/fix/refs-file-identity
fix(relinker): compare Windows file identities by their 128-bit file ID
2026-10-21 20:57:16 +13:00
Dean 0bdfdd98b3 Merge pull request #8262 from thuanquang/fix/relinker-syscall-input-path
fix(relinker): name the guest module when its syscall scan fails
2026-10-21 20:20:29 +13:00
MarcZX10 7fdad075c3 fix(relinker): include libc for kernel variant imports 2026-10-21 05:47:33 +00:00
MarcZX10 0d0b29cf44 test(relinker): require libc for kernel variant fallback 2026-10-21 05:47:05 +00:00
Rookie 5748d7ce81 fix(relinker): compare Windows file identities by their 128-bit file ID 2026-10-21 06:09:46 +01:00
bluandClaude Fable 5.1 0c8fb06573 test(relinker): register windows_import_identity only when the libraries are built
A relinker-only configuration has no libs target to depend on, so the Windows relinker job could
not generate; the test needs the patched libraries and is left out there.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-20 21:42:06 -07:00
MarcZX10 7157ebb4e8 test(relinker): cover libc fallback for Ampr imports
(cherry picked from commit babde2b5bd9ea9af9fec545fcff33f00d1583fd6)
2026-10-20 21:30:07 -07:00
bluandClaude Fable 5.1 2657a81218 test(relinker): resolve a libSceAmpr-qualified import of the locale objects against libc's
windows_import_identity generates two probes with the entry stub builder, as the diagnostics
test does, and runs them next to the patched libraries: same.exe imports the three locale objects
of #8875 twice, qualified to libSceAmpr.prx and to libc.prx, and exits 0 only if each pair
resolved to one address; different.exe compares the first with libkernel's getpagesize and must
exit 1. That pins the fallback from a host module to libc at run time, independently of how the
stub builds its search order.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-20 21:28:05 -07:00
MarcZX10 fef2755c76 test(relinker): cover scoped kernel variant imports 2026-10-21 03:42:04 +00:00
MarcZX10 7b07c20497 fix(relinker): resolve kernel variant imports via canonical kernel 2026-10-21 03:42:04 +00:00
Dean 46bfbe4e25 Merge pull request #8063 from AasishDairelSahayaGrinspan/fix/relinker-gs-memory-only-traps
fix(relinker): trap only GS memory accesses in Windows and macOS output
2026-10-21 16:35:25 +13:00
Dean 59d53d0d31 Merge pull request #8757 from Nejilu/codex/relinker-tls-file-bounds
fix(relinker): reject TLS initialization images outside the input file
2026-10-21 15:27:20 +13:00
Dean b2d804d5f7 Merge pull request #8738 from Queuse/codex/fix-registry-utf8
fix(relinker): reject invalid registry UTF-8
2026-10-21 15:27:16 +13:00
Dean 6056689ad6 Merge pull request #8614 from DavidSamir/fix/relinker-call-zero-padding
fix(relinker): stop the control-flow walk at zero padding after a call
2026-10-21 15:27:12 +13:00
Nejilu 9fb55e186d fix(relinker): reject TLS initialization images outside the input file 2026-10-21 01:45:30 +02: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
Queuze 41cd0435ec fix(relinker): reject invalid registry UTF-8 2026-10-20 20:07:16 -03:00
MarcZX10 11adccfe15 fix(relinker): preserve detailed header diagnostics 2026-10-20 21:16:19 +00:00
MarcZX10 8625b4802b fix(relinker): normalize input prefix paths 2026-10-20 21:07:53 +00:00
MarcZX10 fc046e621b test(relinker): reject large non-ELF inputs before allocation 2026-10-20 21:07:34 +00:00
MarcZX10 33c1f2365f fix(relinker): validate ELF prefix before reading full input 2026-10-20 21:07:34 +00:00
Dean c6145997ef Merge pull request #8270 from thuanquang/fix/relinker-module-name-input-path
fix(relinker): name the guest module in its output filename errors
2026-10-21 09:39:58 +13:00
Dean 29e4c46b4d Merge pull request #7417 from IshmamDC217/feat/relinker-trace-imports-linux
feat(relinker): support --trace-imports for Linux output
2026-10-21 09:03:29 +13:00
David 24c5c8ed5f test(relinker): convert a call before zero padding and a misread FS byte for Windows and macOS 2026-10-20 22:17:45 +04:00
David c978e4d4c4 test(relinker): keep falling through calls that end at a boundary or before non-zero bytes 2026-10-20 22:17:44 +04:00
David c139a3faf2 test(relinker): stop at zero padding after direct and indirect calls 2026-10-20 22:17:43 +04:00
David 95db1ab6e6 fix(relinker): stop the control-flow walk at zero padding after a call 2026-10-20 22:17:42 +04:00
javierUDP 2775e72bf0 fix(relinker): trim only an interpreter path at the start of the segment
Trimming the end of any PT_INTERP inside an executable segment dropped
the code in front of one that follows it, so an image without an SCE
block whose interpreter sits after its code lost its entry points. The
trim now applies to an interpreter that starts the segment, and the SCE
path keeps taking any interpreter inside the scanned range, as before.
2026-10-20 14:56:41 -03:00
javierUDP cc69253830 fix(relinker): keep the interpreter path out of the scanned code
The code analysis trims an interpreter path from the start of an
executable segment only for images that have a PT_SCE_DYNLIBDATA block.
An executable without one keeps that path in the scanned range, so
/libexec/ld-elf.so.1 is walked as code: a RELATIVE relocation with
addend 0 roots the control flow graph at the first byte of the segment,
and the 0x64 of "ld-elf" decodes as an FS-prefixed instruction that the
Windows and macOS TLS rewriters refuse. The trim now runs for both
layouts, ending at the segment for an image without the block.
2026-10-20 14:56:20 -03:00
Dean Galvin 143ed02750 Merge branch 'main' into #7417
Resolve docs/dev/debt/libc.md: keep main's _Throw_Cpp_error entry and this branch's call tracing entry.
2026-10-21 06:33:59 +13:00
Dean 892a4f1328 Merge pull request #7993 from MarrasFederico/fix/relinker-windows-trampoline-builder-guards
fix(relinker): validate Windows trampoline section placement and sites
2026-10-21 06:30:55 +13:00
Dean b9731811ba Merge pull request #8001 from mopga/fix/relinker-amd-only-claimed-followers
fix(relinker): do not take instructions another AMD-only stub moved as a short instruction's followers
2026-10-21 06:30:39 +13:00
Dean bdc33a556c Merge pull request #7995 from mpratsaki/fix/relinker-windows-file-identity
fix(relinker): compare Windows file identities by handle
2026-10-21 06:25:35 +13:00
Dean 989b6ea794 Merge pull request #7999 from mopga/fix/relinker-amd-only-sequence-in-place
fix(relinker): move in-place AMD-only replacements into a short instruction's stub
2026-10-21 06:19:51 +13:00
Dean 2fee39f1b3 Merge pull request #6684 from SandstromPL/fix/relinker-guest-zero-init
fix(relinker): run a guest DT_INIT of 0 as the module initializer
2026-10-21 06:07:25 +13:00
Dean 1b08a33b12 Merge pull request #8548 from tkcm01/fix/windows-icon-utf8-path
fix(relinker): format invalid Windows icon paths as UTF-8
2026-10-21 05:47:06 +13:00