Commit Graph
846 Commits
Author SHA1 Message Date
Adrià 7d9372b77c Merge pull request #7740 from whamre/fix/windows-lazy-zero-fill-v2
fix(relinker): keep zero-filled PT_LOAD memory out of the Windows loa…
2026-10-20 15:41:27 +02:00
Adrià 8afd6ea478 Merge pull request #7660 from savvaniss/fix/sce-code-gaps
fix(relinker): resume scans after undecodable bytes between PS4 unwind functions
2026-10-20 13:17:15 +02:00
Adrià 77c18cefae Merge pull request #6903 from Zinebyte/fix/guest-unused-import-dependencies
fix(relinker): infer guest dependencies from referenced imports
2026-10-20 11:08:47 +02:00
Adrià 3d54c5b2b2 Merge pull request #6448 from DavidSamir/fix/relinker-macos-empty-tls
fix(relinker): convert stack-guard and thread-pointer reads with an empty PT_TLS for macOS
2026-10-20 10:40:07 +02:00
Adrià 5e7c618699 Merge pull request #6607 from jweidenh/codex/overlapping-rela-tables
fix(relinker): handle overlapping relocation tables
2026-10-20 10:38:40 +02:00
Dean b9ff25b787 Merge pull request #8197 from JJenkx/windows/relinker-tests-exited-module-cleanup
test(relinker): retry removing fixtures an exited Windows program still holds
2026-10-20 18:31:23 +13:00
Dean a9f1341b62 Merge pull request #8179 from JJenkx/windows/relinker-diagnostics-fixture-retry
test(relinker): wait for the exited diagnostic runner to release its fixtures
2026-10-20 18:31:19 +13:00
Dean 13d5f0e884 Merge pull request #8024 from MarrasFederico/test/relinker-trap-runs-without-core-dumps
test(relinker): run the outputs that stop at int3 without a core dump
2026-10-20 17:55:31 +13:00
Dean d85b7c759a Merge pull request #2780 from SuarezPM/ai/relinker-hardening
feat(relinker): lower MCOMMIT and RDPRU for Intel with execution tests
2026-10-20 16:22:49 +13:00
JJenkxandClaude Opus 5.5 a3ac9fd9e4 test(relinker): retry removing fixtures an exited Windows program still holds
windows_named_imports, windows_trace_imports, windows_guest_weak_imports and
guest_module_identity run converted programs that stop on a missing import,
then remove their temporary directory. Windows keeps the modules of such an
exited process open for a short time after the process handle is signaled, so
under parallel ctest the removal fails with PermissionError on a .prx that
program loaded: with Defender real-time protection off, 3 or 4 of these tests
failed in each of three runs of ctest --repeat until-fail:10 -j 16 over the 69
tests that run converted programs.

Add fixture_directory to guest_import_fixtures, a temporary directory whose
removal retries on PermissionError for at most 10 s, and use it in the four
tests. Their checks are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 22:14:40 -04:00
JJenkxandClaude Opus 5.5 92ea0b9ce3 test(relinker): wait for the exited diagnostic runner to release its fixtures
windows_dependency_diagnostics rewrites the fixture images right after the
diagnostic runner exits. The runner ends with an unhandled RaiseException of
STATUS_DLL_NOT_FOUND, and Windows fault handling keeps the exited process's
image files open for a short time after its handle is signaled: on Windows 11
22621 the Restart Manager names the exited runner as the holder and the file
opens 37 to 153 ms later. The rewrite then fails with ERROR_SHARING_VIOLATION,
and the final removal of the fixtures with access denied. Retry opening a
fixture while it fails with a sharing violation and the removal while it fails
with access denied, for at most 10 s each; every other failure still fails the
test at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 21:45:35 -04:00
Adrià 7e12b3da80 Merge pull request #7736 from jotitadev/fix/relinker-desktop-entry-test-unique-dir
test(relinker): give the desktop entry test its own temporary directory
2026-10-20 03:13:23 +02:00
Adrià 34b1b77abf Merge pull request #7651 from DavidSamir/fix/relinker-amd-only-branch-targets
fix(relinker): ignore direct branch targets inside an instruction past its prefixes
2026-10-20 02:13:47 +02:00
Adrià cb89266437 Merge pull request #7519 from Destroyers212x/test/macos-load-under-rosetta
test(relinker): run the macOS guest module argument check under Rosetta
2026-10-20 00:35:22 +02:00
SuarezPM bf47697ec0 feat(relinker): lower MCOMMIT and RDPRU for Intel with execution tests
MCOMMIT becomes STC plus NOP padding and RDPRU goes through a
runtime-checked stub returning the host TSC for MPERF/APERF while
other selectors yield zero, with converter and execution tests.

docs/dev/debt/relinker.md records the new lowering and its unverified
assumptions.
2026-10-19 19:19:31 -03:00
Adrià 7c43dc6bfc Merge pull request #7453 from Agnibha007/fix/unused-filter-fallthrough-padding-abort
fix(relinker): stop the unused-filter CFG walk before trailing zero padding
2026-10-19 23:51:02 +02:00
Adrià dd4c2a413b Merge pull request #7418 from tkcm01/fix/relinker-backup-copy-export-aliases
fix(relinker): allow Windows export aliases when probing backup copies
2026-10-19 21:51:59 +02:00
Adrià ae7ad5ff98 Merge pull request #7361 from RockENZO/codex/macos-executable-exports
fix(relinker): preserve executable exports in macOS output
2026-10-19 20:41:17 +02:00
Federico Marras c79d189655 test(relinker): run the outputs that stop at int3 without a core dump 2026-10-19 20:32:38 +02:00
Adrià 48790e0233 Merge pull request #7039 from nabil88/fix/windows-libkernel-and-tests
feat(libkernel): implement getdtablesize and fix Windows host-tree removal
2026-10-19 19:36:18 +02:00
Dean b6583dd868 Merge pull request #7902 from mopga/fix/relinker-null-symbol-index-zero
fix(relinker): accept relocations against symbol index 0 for Windows and macOS
2026-10-20 06:22:01 +13:00
Dean 7a015c0946 Merge pull request #7904 from mopga/fix/relinker-sort-guest-module-loads
fix(relinker): sort PT_LOAD entries of Linux guest modules by address
2026-10-20 05:54:46 +13:00
Dean f250687e23 Merge pull request #7903 from mopga/fix/relinker-unused-filter-non-got-imports
fix(relinker): keep non-GOT imports in unused-filter=1
2026-10-20 05:54:32 +13:00
Adrià ee9bfe177e Merge pull request #6974 from HamidRezaLS/perf/relinker-tls-reachability-opt
perf(relinker): flat address-taken vector and region query caching in strict reachability
2026-10-19 17:53:17 +02:00
Agnibha Mukherjee 904bb59c25 fix(relinker): decode explicitly enqueued CFG targets at full bounds
The padding bound in buildGraph's decoding loop skipped worklist targets inside the trailing zero region without decoding them, so malformed mandatory roots were accepted silently and complete instructions at targeted zero offsets lost their reachable marking. Decode the first instruction at each popped target against text.size() and keep the codeSize bound for sequential fall-through only. Covers the entry, extra-entry, branch-target, complete-zero-instruction and zero-immediate cases in the direct API test and in the CLI fixture.
2026-10-19 17:24:04 +02:00
Agnibha Mukherjee 1f28b37898 fix(relinker): stop the unused-filter CFG walk before trailing zero padding
buildGraph fell through from the entry points into the segment's zero
padding; an odd-length zero tail left a lone 0x00 the decoder needs a
ModRM byte for, and the non-speculative walk let that truncation escape
the pipeline, so unused-filter=1 exited 2 on input the other levels
convert. Bound the walk before the trailing zeros the way
StrictReachability does; mandatory roots still decode strictly.
2026-10-19 17:23:57 +02:00
Dean 00d7e611ef Merge pull request #7363 from plokmklo/fix/relinker-gnu-stack-relro
fix(relinker): synthesise a non-executable PT_GNU_STACK for Linux executables
2026-10-20 03:52:18 +13: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
Dean 95d901b937 Merge pull request #7767 from fogydes/fix/relinker-got-access-index-address-size-and-bounds
fix(relinker): resolve EIP-relative GOT accesses and guard target overflow
2026-10-20 02:52:06 +13:00
Dean 0e476a72f2 Merge pull request #7764 from fogydes/fix/relinker-plt-compactor-bounds-and-underflow
fix(relinker): guard PLT compactor against displacement underflow and offset overflow
2026-10-20 02:51:52 +13:00
mopgobopotandClaude Opus 5.5 d2c3ec6f46 fix(relinker): keep non-GOT imports in unused-filter=1
unused-filter=1 kept a non-PLT import only when reachable code addresses its relocation exactly through a RIP-relative operand. That test only fits GLOB_DAT slots. An R_X86_64_64 import in a table read at an offset, such as a vtable entry called through lea rax,[rip+table]; call [rax+8], was dropped although it is used, and of a general dynamic TLS pair only DTPMOD64 was kept, so DTPOFF64 lost its relocation. The GOT access check now applies to GLOB_DAT relocations only; other import relocations are kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 16:30:14 +03:00
Dean 5eba12d6bd Merge pull request #7775 from whamre/fix/windows-tls-zero-fill
fix(relinker): keep the PT_TLS zero fill out of memory when converting to Windows
2026-10-20 02:23:39 +13:00
Dean 9145cf3a93 Merge pull request #7773 from fogydes/fix/relinker-syscall-scanner-bounds
fix(relinker): validate syscall scanner code section bounds and offset overflow
2026-10-20 02:23:25 +13:00
Dean 98024d4bce Merge pull request #7772 from fogydes/fix/relinker-section-header-table-overlap-and-bounds
fix(relinker): validate section header table bounds and reject overlapping sections
2026-10-20 02:23:11 +13:00
Dean 111f9eb6f2 Merge pull request #7771 from fogydes/fix/relinker-program-header-layout-extra-block-overlap
fix(relinker): reject program header table overlapping the extra block
2026-10-20 02:22:57 +13:00
Dean 1fad170b8b Merge pull request #7770 from fogydes/fix/relinker-windows-icon-resource-rva-and-overlap-guards
fix(relinker): validate resource section RVA and prevent section overlaps
2026-10-20 02:22:43 +13:00
Dean ad5e9f51ba Merge pull request #7768 from fogydes/fix/relinker-relative-relocation-index-bounds
fix(relinker): validate relative relocation table bounds, dynamic tag variants, and slot targets
2026-10-20 02:22:29 +13:00
Dean 7143c2acc8 Merge pull request #7763 from fogydes/fix/relinker-base-relocation-page-bounds-and-deduplication
fix(relinker): guard base relocations against page boundary overflow and deduplicate entries
2026-10-20 02:22:15 +13:00
UAQ Taxi 379dca5cac test: raise the slow-host timeouts 2026-10-19 14:49:36 +02:00
Hamidreza 186b2863ea perf(relinker): flat address-taken vector and region query caching in strict reachability 2026-10-19 14:40:17 +02:00
mopgobopotandClaude Opus 5.5 3f8184ae09 fix(relinker): sort PT_LOAD entries of Linux guest modules by address
The Linux executable sorts its PT_LOAD entries, but guest modules (*.guest.prx) kept them in the input table order. A module whose data segment comes before its text segment in the table was written with PT_LOAD entries out of address order, which the gABI forbids: glibc reserves the span from the first to the last entry, so with 0x2000, 0x1000, 0x4000 it reserved 0x2230 bytes instead of 0x3230 and mapped the text below the reservation. The PT_LOAD entries are now sorted in place, as for the executable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 15:40:05 +03:00
mopgobopotandClaude Opus 5.5 87b53b18ca fix(relinker): accept relocations against symbol index 0 for Windows and macOS
Code analysis rejected R_X86_64_64, GLOB_DAT and JUMP_SLOT relocations whose symbol index is 0 (STN_UNDEF) with 'invalid relocation symbol', so the Windows and macOS conversions failed while Linux converted the same input. The pipeline already resolves such relocations to 0 plus the addend, as the gABI defines and as the relinker technical debt entry records for null symbol entries; only an all-zero entry at a nonzero index was accepted. Index 0 is now treated as an import slot like that entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 15:40:01 +03: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à afeaffa6c1 Merge pull request #6717 from simonbronk/codex/strict-empty-arrays
fix(relinker): accept omitted empty array sizes in strict filtering
2026-10-19 11:47:09 +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
Adrià bcdc5f6b3e Merge pull request #6702 from karimibrahim07/fix/relinker-weak-guest-imports
fix(relinker): leave weak imports of bundled modules unbound on Windows
2026-10-19 10:49:10 +02:00
Adrià e0adc075a2 Merge pull request #6697 from karimibrahim07/feat/relinker-named-host-imports
fix(relinker): resolve symbol-name imports through NIDs on Windows
2026-10-19 10:49:05 +02:00
Adrià 4630318457 Merge pull request #6681 from milescoviello/fix/relinker-bss-page-overlap
fix(relinker): keep a segment's zero-filled tail zero when the next PT_LOAD starts on its page
2026-10-19 10:48:54 +02:00
Z User df0baf9e3e fix(relinker): check the real header ranges when verifying game patches
The guard rejected every patch below the end of the program header
table, which is correct only while the table sits at the start of the
file. Outputs whose table moved into the extra block refused patches
into their first PT_LOAD, so game_patches failed once synthesis added
a header. Overlap is now checked against the ELF header and the table
range itself.
2026-10-19 08:45:59 +00:00
Z User dd1e4b40de fix(relinker): include <cstddef> for std::size_t in ElfConstants.hpp
ProgramLayoutRangeTests.cpp includes this header first, and libc++ does
not provide size_t through <cstdint>, so the macOS relinker jobs failed
to compile the test.
2026-10-19 08:45:59 +00:00