Commit Graph
1423 Commits
Author SHA1 Message Date
Adrià 0a148be963 Merge pull request #13818 from Ninot1Quyi/fix/relinker-empty-load-segments
fix(relinker): ignore empty guest load ranges in overlap checks
2026-11-01 03:02:31 +01:00
Adrià 1ad51ae5ed Merge pull request #13825 from JJenkx/windows/relinker-cfg-reached-map
perf(relinker): mark reached code in a map while collecting instructions
2026-11-01 02:54:04 +01:00
Adrià 1e80cf96b3 Merge pull request #13775 from dr-hoseyn/fix/find-c-bug
fix(web): convert modules from all standard directories
2026-11-01 01:25:09 +01:00
Adrià 693f9d09ca Merge pull request #13693 from PROGABBOMALA/fix/relinker-code-data-boundaries-7547
fix(relinker): resolve code and data boundaries in syscall scanner (#…
2026-11-01 00:54:43 +01:00
Adrià 3cd86850c6 Merge pull request #13563 from rooklz/test/unwind-sdata2-funcrel-signed-overflow
test(relinker): pin EH sdata2 funcrel signed pointer overflow
2026-10-31 22:39:41 +01:00
PROGABBOMALA 6a82825008 fix(relinker): restrict lea roots to unwind reachability (#7547) 2026-10-31 22:35:11 +01:00
Dean c48c5da86e Merge pull request #7037 from namanipie/fix/relinker-overflowing-file-offsets
fix(relinker): reject overflowing ELF file offsets
2026-11-01 10:32:46 +13:00
rooklz 9a4588752c test(relinker): pin EH sdata2 funcrel signed pointer overflow 2026-10-31 21:56:34 +01:00
PROGABBOMALA b8fc47fd47 fix(relinker): recognize indirect lea roots and restore gap data skip (#7547) 2026-10-31 21:29:39 +01:00
rooklz 025435d164 fix(relinker): reject udata8 funcrel unwind pointer overflow 2026-10-31 19:07:45 +01:00
rooklz fd065eece1 test(relinker): pin EH udata2 funcrel overflow via LSDA path 2026-10-31 18:07:47 +01:00
rooklz d2de599520 test(relinker): pin EH udata2 funcrel table overflow 2026-10-31 18:07:41 +01:00
PROGABBOMALA 0218b3529d fix(relinker): reject dynamic syscalls in indirect routines with unwind ranges (#7547) 2026-10-31 13:33:05 +01:00
rooklz ffa4075be8 test(relinker): pin EH udata4 funcrel overflow via LSDA path 2026-10-31 13:27:20 +01:00
AdriàandClaude Haiku 5.5 0dba616a91 test(relinker): pin EH uleb128 datarel overflowing LEB128 row
Standalone eh_frame_hdr row after the existing table overflow case:
encoding 0x31 (uleb128 | datarel) with a ten-byte ULEB128 whose last
byte overflows 64 bits, on segments at 0xFFFFFFFFFFFFF000. The reader
must throw "overflowing LEB128 value" from EhFrameReader::leb.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-10-31 12:48:54 +01:00
Adrià 467673ea69 Merge pull request #13591 from rooklz/test/unwind-uleb128-funcrel-signed-overflow
test(relinker): pin EH table uleb128 funcrel overflow row
2026-10-31 12:21:15 +01:00
Adrià cf5a1805e5 Merge pull request #13520 from rooklz/test/unwind-sdata2-datarel-signed-overflow
test(relinker): pin EH sdata2 datarel signed overflow
2026-10-31 11:20:19 +01:00
rooklz 7aee2b951d test: repair uleb128 funcrel overflow via LSDA path
Replace flawed EH-table case 11 with a standalone CIE zPLR fixture
(LsdaEncoding 0x41) that trips overflowing LEB128 in readFde.
2026-10-31 11:19:33 +01:00
Adrià 049619c202 Merge pull request #13580 from rooklz/test/unwind-sleb128-funcrel-signed-overflow
test(relinker): pin EH sleb128 funcrel signed overflow
2026-10-31 11:12:13 +01:00
JJenkxandClaude Opus 5.5 3f20e4b42d fix(relinker): publish the reached addresses without an allocating destructor
The set-based control-flow walk inserted the addresses it found into the
caller's set from a destructor. Destructors are noexcept, so a failed
allocation there called std::terminate instead of reaching the
conversion's error handling as std::bad_alloc. The addresses are now
inserted after the walk returns, and before an exception from the walk
is rethrown, as the walk did before.

The new test arms a failing operator new from the progress callback
during a walk of 8,192 instructions and requires std::bad_alloc to reach
the caller; with the destructor it terminated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 05:29:06 -04:00
Adrià c3c45d73ab Merge pull request #13620 from PolkadotDom/fix/cfg-segment-relative-transfers
fix(relinker): keep segment-relative transfers unresolved in CFG
2026-10-31 10:28:55 +01:00
rooklz 95b392894c test(relinker): pin EH sdata2 datarel signed overflow 2026-10-31 10:20:08 +01:00
rooklz 4313a46db1 test(relinker): pin sleb128 funcrel overflow via LSDA path 2026-10-31 10:16:48 +01:00
rooklz fd154cb422 test(relinker): pin EH sleb128 funcrel signed overflow 2026-10-31 10:16:33 +01:00
JJenkxandClaude Opus 5.5 2250da786c perf(relinker): mark reached code in a map while collecting instructions
The control-flow walk kept the reachable instructions of a code segment
in a std::unordered_set: every decoded instruction looked itself up,
was inserted, and was inserted into and erased from a visited set. The
instruction collector also handed the same growing set to each pass of
its root loop and walked all of it again every time.

The walk now marks each text offset in a byte map: reached, queued or
not seen. Queued marks are cleared when a walk ends, as the per-call
visited set was. ExtendControlFlowGraph takes a caller's map and
returns only the addresses that one walk added, in address order. The
collector keeps one map per segment and handles just those addresses.
BuildControlFlowGraph with a reachable set fills the map from the set
and inserts the new addresses in the order they were found.

Converting Goat Simulator 3's (PPSA04158) eboot.elf with
relinker --windows takes 27.56 s instead of 45.26 s (median of six
alternating runs on a Ryzen 9 5950X). Four more titles' eboot.elf
convert 35-54% faster, and every run produces the same output files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 04:22:47 -04:00
rooklz 9473c87181 test(relinker): pin EH sdata8 funcrel signed pointer overflow 2026-10-31 09:10:43 +01:00
Qu Yi 134b6cf0be fix(relinker): ignore empty guest load ranges in overlap checks 2026-10-31 15:51:30 +08:00
AdriàandClaude Haiku 5.5 fe13b4d2df test(relinker): pin EH sdata4 funcrel signed overflow row
Standalone EH table fixture after the unwind record loop: CIE zPLR with
LSDA encoding 0x4B (sdata4 funcrel), FDE augmentation 0xFFFFEFFF with
functionBase at the FDE begin 0x1000. The signed branch of
EhFrameReader::encoded must reject it with "unwind pointer address
overflowed".

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-10-31 08:15:42 +01:00
rooklz 30eafc1ee3 test(relinker): pin EH sdata8 datarel signed overflow 2026-10-31 07:09:55 +01:00
dr-hoseyn 876e99fbb6 fix(web): keep standard modules in startup dependencies 2026-10-31 09:03:05 +03:30
dr-hoseyn e2d531921f fix(web): convert modules from all standard directories 2026-10-31 09:03:05 +03:30
rooklz 0d9e410b1a test(relinker): pin EH sdata4 datarel signed overflow 2026-10-31 05:12:57 +01:00
AdriàandClaude Haiku 5.5 aa968f07de test(relinker): pin EH table udata4 datarel overflow
Standalone block after the main table overflow case: encoding 0x33
(udata4 + datarel), u32 0xFFFFFFFF displacements at the real table
entry offsets 16 and 20, data base 0xFFFFFFFFFFFFF000 so max - base
is 0xFFF, and an assert on the overflow RelinkerException message.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-10-31 03:41:07 +01:00
PROGABBOMALA 695e2ec3d5 fix(relinker): resolve code and data boundaries in syscall scanner (#7547) 2026-10-31 02:14:04 +01:00
rooklz f3b32c8372 test(relinker): isolate EH sleb128 datarel signed overflow pin 2026-10-30 23:26:41 +00:00
rooklz a888cbecab test(relinker): pin EH sleb128 datarel signed overflow 2026-10-30 23:26:41 +00:00
dom 06340c0485 test(relinker): retain ignored prefixes and explicit CFG roots 2026-10-30 15:42:03 -04:00
dom e18bdde237 fix(relinker): keep segment-relative transfers unresolved in CFG 2026-10-30 15:40:18 -04:00
Adrià 4bc9e779aa Merge pull request #13334 from Filip722/refactor/cli-fixed-base-parser-20261030
refactor(relinker): share fixed-base argument parsing
2026-10-30 18:58:38 +01:00
Adrià 62bc07d3f0 Merge pull request #13046 from Nciibi/fix/relinker-address32-wide-store
fix(relinker): split 32-bit absolute wide stores at the displacement boundary
2026-10-30 18:58:21 +01:00
Adrià 556547da71 Merge pull request #13211 from Cool-Coder174/test/macos-loader-test-links
test(relinker): hard-link the shared native libraries of three macOS loader tests
2026-10-30 17:32:55 +01:00
Adrià b1b5353cfc Merge pull request #11413 from atinseau/codex/relinker-island-function-entry
fix(relinker): keep moved instructions off a function entry after padding
2026-10-30 14:48:59 +01:00
AdriàandClaude Sonnet 5.5 f0aac7e014 fix(relinker): treat VEX.X as an index when splitting 32-bit absolute wide stores
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 14:16:42 +01:00
Nciibi 5fc3344955 fix(relinker): restrict 32-bit wide-store splits to absolute operands 2026-10-30 14:16:32 +01:00
Nciibi b6f5abaf9f fix(relinker): split 32-bit absolute wide stores at the displacement boundary 2026-10-30 14:16:32 +01:00
Filip Michalski 88d80bd993 refactor(relinker): share fixed-base argument parsing 2026-10-30 13:58:36 +01:00
Adrià dd2386af42 Merge pull request #13010 from rooklz/fix/windows-tls-eip-relative-moves
fix(relinker): wrap EIP-relative operands moved into Windows TLS stubs
2026-10-30 10:56:03 +01:00
Adrià 2bf9fde0f0 Merge pull request #12554 from dkdhanda8/fix/entry-stub-rel32-wrap
fix(elfpatcher): reject an entry-stub rel32 distance that only fits after a 64-bit wrap
2026-10-30 10:51:50 +01:00
Adrià cfe82f6a2f Merge pull request #10142 from xTRACKGOD/fix/relinker-zero-finalizer
fix(relinker): preserve guest finalizers at address zero
2026-10-30 10:51:42 +01:00
atinseau 96581cb7d6 fix(relinker): keep moved instructions off a function entry after padding
An island or relocation window could start in the int3 or nop padding after a jump or return and run into the next function. A function that only a pointer reaches, such as a virtual method, is not a known branch target, so its first bytes became the middle of a jump to a stub. An instruction that follows a jump, a return, a trap or padding after one of them can now only start a window. An int3 inside a window does not count as such an instruction, so a window that lies entirely in int3 padding is still used, as before; nop padding stays excluded, since a function built with -fpatchable-function-entry can begin with a nop.
2026-10-30 09:58:27 +01:00