Commit Graph
1292 Commits
Author SHA1 Message Date
Dean 54d68449b3 Merge pull request #12166 from slopgobblercobbler/fix/relinker-relative-table-address-space-bounds
fix(relinker): validate text section range before reading relative table targets
2026-10-29 07:25:58 +13:00
Dean b2b6f7faf5 Merge pull request #11881 from roboterspinne/fix/relinker-non-tls-relocations-tls-symbols
fix(relinker): reject non-TLS executable relocations against STT_TLS symbols
2026-10-29 07:23:45 +13:00
Adrià e4da19aff0 Merge pull request #11880 from roboterspinne/fix/relinker-guest-declared-module-binding
fix(relinker): bind imports declared from a guest module only to that module's exports on Linux and macOS
2026-10-28 18:46:00 +01:00
Adrià 470a562903 Merge pull request #11226 from ebosido444-ai/docs/relinker-help
docs(relinker): describe every option in the usage text
2026-10-28 18:20:18 +01:00
Adrià fb39cc928c Merge pull request #11722 from cocoa55/fix/rewriter-truncated-branch-into-cut
fix(codegen): reject 16-bit branches into a rewritten instruction
2026-10-28 17:35:42 +01:00
Dean 37f7b0947f Merge pull request #12286 from B-Howell/test/relinker-masked-store-flag-diagnostics
test(relinker): report the case and flag values when a masked store stub changes the flags
2026-10-29 00:31:13 +13:00
Dean 68372dbb45 Merge pull request #11925 from Mherberts/codex/fix-unresolved-restricted-symbols
fix(relinker): validate visibility of undefined strong symbols
2026-10-28 22:53:21 +13:00
Dean 5a6e7d9591 Merge pull request #12015 from slopgobblercobbler/test/relinker-call-registry-writer-utf8-json-coverage
test(relinker): add UTF-8 validation and JSON escaping tests for call registry writer
2026-10-28 22:39:14 +13:00
Dean e02b43abef Merge pull request #11972 from rooklz/test/annotate-guest-module-contract
test(relinker): pin annotate_module against the guest module writer
2026-10-28 22:35:27 +13:00
Dean d84a43404d Merge pull request #11959 from roboterspinne/fix/relinker-linux-executable-ident-padding
fix(relinker): zero the e_ident padding of the Linux executable
2026-10-28 22:33:39 +13:00
Dean bd6a4096ff Merge pull request #11958 from roboterspinne/fix/relinker-windows-image-size-limit
fix(relinker): reject Windows images larger than the loader maps
2026-10-28 22:33:22 +13:00
Dean 55612e50ab Merge pull request #11923 from rooklz/fix/strict-filter-duplicate-relocations
fix(relinker): accept an identical duplicate pointer relocation in the strict filter
2026-10-28 22:31:01 +13:00
Dean 8eb8458fa7 Merge pull request #11882 from roboterspinne/fix/relinker-reject-et-exec-input
fix(relinker): reject ET_EXEC executable input
2026-10-28 22:27:58 +13:00
Adrià cc672fdfc6 Merge pull request #11366 from guglia001/test/relinker-conversion-fuzzer
test(relinker): add a libFuzzer target for the whole conversion
2026-10-28 09:56:49 +01:00
Adrià cd3c3ba033 docs(relinker): list --lazy-binding under Deprecated and mark --trap-sdk-syscall-stubs as debugging 2026-10-28 09:22:45 +01:00
ebosido444-ai d6322a801f docs(relinker): describe every option in the usage text
--help printed three syntax lines with no explanation, so the only
discovery surface was the 67 KB USAGE.md. List every option with a
one-line description, grouped by purpose, plus the exit codes. The first
line keeps the "Usage: relinker" prefix the CLI tests match.
2026-10-28 09:22:41 +01:00
B-HowellandClaude Opus 5.5 b8636b11f7 test(relinker): report the case and flag values when a masked store stub changes the flags
masked_store_lowering failed twice under Rosetta on GitHub's macOS x86_64
runner (runs 40216485859 and 40438653738) with only "Masked store stub
changed the flags", while the stored bytes, faults, vector and general
registers, red zone and RSP all matched. The message now names the form,
width, addressing mode, offset, mask pattern, fault count and the flags
before and after, so the next occurrence shows which flags change and
whether the probe faulted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 03:11:41 -04:00
Adrià 16954551ed Merge pull request #11382 from roboterspinne/fix/relinker-dynstr-leading-nul
fix(relinker): reject an executable dynamic string table that does not begin with NUL
2026-10-28 06:11:40 +01:00
Adrià 46031052fc Merge pull request #11381 from roboterspinne/fix/relinker-executable-export-attributes
fix(relinker): validate executable export names and attributes like guest modules
2026-10-28 06:05:18 +01:00
Dean adbcdcdd58 Merge pull request #11463 from Mherberts/codex/feat-elf-relr-relocations
feat(relinker): support packed ELF64 relative relocations
2026-10-28 17:50:40 +13:00
slopgobblercobbler 5fe90dcdbf fix(relinker): validate text section range before reading relative table targets 2026-10-28 05:26:38 +01:00
Dean 415e87a180 Merge pull request #10999 from plexerPK/fix/redzone-opcode-rsp-uses
fix(relinker): preserve opcode-encoded stack register uses
2026-10-28 13:50:41 +13:00
Dean 09919b040d Merge pull request #10537 from nedra23/fix/relinker-syscall-number-rex-prefixes
fix(relinker): honor prefixes in the syscall number byte walk
2026-10-28 13:49:13 +13:00
Dean a36e9b2442 Merge pull request #11489 from WhiteAssassins/feat/patch-catalog-metadata
feat(tools): add optional patch catalog metadata
2026-10-28 12:58:25 +13:00
Dean 9880159f82 Merge pull request #10240 from Project-MOC/codex/test-windows-file-writer
test(relinker): cover Windows file writer behavior
2026-10-28 12:03:16 +13:00
Adrià 9af563f33d Merge pull request #11284 from iamthehimansh/split/macos-game-start
fix(relinker): reserve space after the Mach-O load commands for the code signature
2026-10-27 19:43:38 +01:00
Adrià 254240c747 Merge pull request #11045 from roboterspinne/fix/relinker-macos-fixups-writable
fix(relinker): reject macOS fixups outside writable segments
2026-10-27 18:29:51 +01:00
slopgobblercobbler 9b791df163 test(relinker): add UTF-8 validation and JSON escaping tests for call registry writer 2026-10-27 18:06:21 +01:00
Dean 737f17291a Merge pull request #10680 from dkdhanda8/fix/relinker-to-intel-branch-target-overflow
fix(relinker): collect --to-intel branch targets without signed overflow
2026-10-28 05:56:34 +13:00
Dean 4078986a1c Merge pull request #10679 from roboterspinne/fix/relinker-registry-pc32-name
fix(relinker): name R_X86_64_PC32 in the import registry
2026-10-28 05:56:00 +13:00
Adrià 2222bae20b Merge pull request #11225 from ebosido444-ai/feat/relinker-version
feat(relinker): report the build revision with --version
2026-10-27 16:16:57 +01:00
Matheus Herberts 7c90e64474 chore(relinker): group RELR tests with relocation tests 2026-10-27 11:59:03 -03:00
Matheus Herberts 06a1dec6fb chore(relinker): separate RELR include from data-table changes 2026-10-27 11:58:25 -03:00
Matheus Herberts 1c02c55cef test(relinker): validate Linux fixture results before trapping 2026-10-27 11:58:25 -03:00
Matheus Herberts 458da3450e feat(relinker): support packed ELF64 relative relocations 2026-10-27 11:58:24 -03:00
Adrià f2f759ae31 Merge pull request #10712 from roboterspinne/fix/relinker-macos-reject-lazy-binding
fix(relinker): reject --lazy-binding for macOS output
2026-10-27 15:35:26 +01:00
rooklz d9b9cb6b79 test(relinker): pin annotate_module against the guest module writer 2026-10-27 14:06:17 +00:00
roboterspinne c18ee35e52 fix(relinker): reject Windows images larger than the loader maps
The Windows writer accepted any image up to the 2 GiB RVA bound, so an
image with a SizeOfImage above 0x77000000 converted with exit 0 and then
failed to start with ERROR_BAD_EXE_FORMAT (193). WindowsPeWriter::Write
now refuses such an image, matching the loader's SizeOfImage >
MM_SIZE_OF_LARGEST_IMAGE (0x77000000) test, which applies to executables
and to bundled modules alike. Images with a SizeOfImage of at most
0x77000000 are written unchanged.
2026-10-27 14:16:56 +01:00
roboterspinne beb46de57d fix(relinker): zero the e_ident padding of the Linux executable
LinuxElfPatcher::Patch zeroed only e_ident bytes 7 and 8 of the output
executable, and ElfReader checks only bytes 0 to 6, so nonzero EI_PAD
bytes 9 to 15 of the input reached the output in every Linux mode. The
gABI reserves EI_PAD as zero, and glibc's open_verify refuses an object
with nonzero padding when ld.so maps the program itself, as under ldd
or an explicit ld-linux-x86-64.so.2 invocation. The patcher now zeroes
bytes 7 to 15, the rule that #11582 applies to guest modules. Only
reserved bytes change, and a direct exec is unaffected either way.
2026-10-27 14:03:02 +01:00
Matheus Herberts 3ab97351f2 fix(relinker): validate visibility of undefined strong symbols 2026-10-27 09:40:19 -03:00
rooklz 0f75fd0662 fix(relinker): accept an identical duplicate pointer relocation in the strict filter
A RELA entry repeated with the same target, type and addend writes the
same value twice, so applying it once is equivalent. 9673868d5f made the
Windows relocation builder and the code analysis accept such duplicates,
but the strict unused-NID filter still refused one as overlapping, so
the same ELF converted with unused-filter=0 or 1 and failed with
unused-filter=2. The strict filter now records a pointer relocation
only when its slot is new or its target is identical, and still refuses
a distinct entry at one slot and a slot that an import relocation
already owns.

AI-assisted: yes
2026-10-27 12:38:18 +00:00
Adrià 2635028370 Merge pull request #11061 from roboterspinne/fix/relinker-red-zone-body-pushes
fix(relinker): refuse red-zone leaves without a frame pointer that push or pop
2026-10-27 12:00:25 +01:00
roboterspinne c70008b853 fix(relinker): reject ET_EXEC executable input
RelinkerPipeline::Relink accepted ET_EXEC input, and every Linux mode
placed it at base + p_vaddr: at 0x400000 by default, at the
--linux-fixed-base address, or at a load bias as ET_DYN with
--lazy-binding, so its absolute references that carry no relocation
kept pointing at the link addresses. The gABI chapter on program
loading says the segments of an executable file must reside at the
virtual addresses used to build it. ET_DYN and the SCE dynamic types
0xfe10 and 0xfe18, the types WindowsLoadImage already accepts as
position independent, may be placed at a base. Relink now rejects
ET_EXEC on every target before the allowlist, which accepts ET_DYN,
0xfe10 and 0xfe18. ET_EXEC input now exits 2 without writing output;
outputs for the other accepted types are unchanged.
2026-10-27 10:47:32 +01:00
roboterspinne b6c9e39abb fix(relinker): reject non-TLS executable relocations against STT_TLS symbols
An executable relocation of type R_X86_64_64, PC32, 32, GLOB_DAT or
JUMP_SLOT against an STT_TLS symbol, defined or undefined, became a
named import, and the Linux output kept it typed STT_TLS. The gABI
allows STT_TLS symbols only in TLS relocations, since their value is
an offset in the TLS block and not an address, and GuestImageReader
already rejects such relocations in guest modules. The pipeline now
fails on them in extractRela for every target and writes no output.
2026-10-27 10:32:28 +01:00
roboterspinne a5e1bc5c3a Merge remote-tracking branch 'upstream/main' into fix/relinker-guest-declared-module-binding 2026-10-27 10:12:52 +01:00
guglia001 1bdb8388ed test(relinker): add a libFuzzer target for the whole conversion
ANYPS5_BUILD_FUZZERS builds relinker_conversion_fuzzer with AddressSanitizer
and UndefinedBehaviorSanitizer in relinker-only Clang builds on Linux. The
first input byte selects the target system, --to-intel and the unused-filter
level; the rest is the executable passed to Conversion::Convert, the path the
web converter takes. tools/relinker_fuzz_seeds.py writes the relinker test
fixtures as seeds, and CTest runs a short smoke run.
2026-10-27 10:12:35 +01:00
Dean 00c28bf688 Merge pull request #10390 from roboterspinne/fix/relinker-validation-offset-once
fix(relinker): print the unsupported relocation offset once
2026-10-27 21:34:15 +13:00
Dean 06e4e4606c Merge pull request #11367 from roboterspinne/fix/relinker-null-symbol-entry
fix(relinker): reject relocations against a non-null executable symbol entry 0
2026-10-27 21:23:51 +13:00
Dean b4445c5b16 Merge pull request #8118 from RockENZO/codex/macos-guest-weak-exports
fix(relinker): preserve weak guest exports on macOS
2026-10-27 21:04:56 +13:00
Adrià ea048ce2c3 Merge pull request #11033 from mzaeemnasir/fix/relinker-collector-signed-branch-target
fix(relinker): collect reachable branch targets without signed overflow
2026-10-27 08:40:36 +01:00