26 Commits
Author SHA1 Message Date
Dean 3fa7e3f9cc Merge pull request #10545 from Bram910/fix/file-prefix-allocation
fix(io): avoid allocating the entire file prefix limit
2026-10-27 09:00:30 +13:00
Dean db1a91f42b Merge pull request #10303 from Bram910/fix/native-path-null-bytes
fix(io): reject NUL bytes in native file paths
2026-10-26 14:39:36 +13:00
Dean d4b8883fca Merge pull request #10393 from Bram910/fix/output-temporary-name-length
fix(io): stage long-named outputs with short temporary names
2026-10-26 11:01:21 +13:00
Bram910 8dfc1ef5e5 Merge remote-tracking branch 'origin/main' into fix/native-path-null-bytes 2026-10-25 09:35:37 +01:00
Bram910 4866d9e976 fix(io): avoid allocating the entire file prefix limit 2026-10-24 11:15:05 +02:00
Bram910 2d2c58d805 fix(io): stage long-named outputs with short temporary names 2026-10-23 22:45:55 +02:00
Bram910 8cfa0cbf6f fix(io): reject NUL bytes in native file paths 2026-10-23 18:50:12 +02:00
MarcZX10 88b1027c46 test(relinker): assert missing path error details 2026-10-23 16:18:01 +00:00
MarcZX10 c1f2d7a69e fix(relinker): reject missing paths in same-file checks 2026-10-23 16:00:15 +00: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 5748d7ce81 fix(relinker): compare Windows file identities by their 128-bit file ID 2026-10-21 06:09:46 +01: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
MarcZX10 8625b4802b fix(relinker): normalize input prefix paths 2026-10-20 21:07:53 +00:00
MarcZX10 33c1f2365f fix(relinker): validate ELF prefix before reading full input 2026-10-20 21:07:34 +00:00
NikoandClaude Opus 5.5 3abfe906bd test(relinker): run the file writer's replacement test on a copy of itself
The running-executable replacement test copied /bin/sleep under the
names "running" and "leftover" and started the copy. On Ubuntu 26.04
/bin/sleep is the uutils multi-call coreutils binary, which picks the
utility from the file name of the path it was started through, not
from argv[0], so the copy printed "coreutils: unknown program
'running'" and exited, and file_writer_binary and file_writer_text
failed without ever replacing a running executable. The test now
copies its own executable and starts it with a "wait" argument that
sleeps, so it no longer depends on how a system binary reads its name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 21:31:32 +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
SandstromPLandClaude Opus 5.5 26c62cc63d fix(relinker): give the output's temporary file a unique name
A relink killed between writing <output>.tmp and renaming it left that
file behind, and every later relink of the output then fell back to the
in-place write, bringing back the failure on a running build. The
temporary file is now created under a new name beside the output with
O_CREAT | O_EXCL and the previous permission bits, and written through
that descriptor, so a file left by an earlier run never blocks a
replacement and is never touched.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 07:27:54 +05:30
boykopovar b42aa8c540 feat(relinker): expose in-memory conversion through a portable core library 2026-10-13 12:57:53 +03:00
SandstromPLandClaude Opus 5.5 92618d25c3 fix(relinker): replace output files instead of rewriting them in place
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 13:56:15 +05:30
aplatogg b74774f713 fix(relinker): support non-ASCII input paths on Windows
The MinGW CRT delivers argv to main as ANSI code page bytes, and every narrow string became a filesystem path through the same code page, so a game in a directory with characters outside the code page failed to open (#2692). Read the command line as Unicode (wmain via -municode), keep paths as UTF-8 strings, convert at the filesystem boundaries through Io::NativePath and Io::Utf8Path, and run the --autorun output through CreateProcessW.

(cherry picked from commit 30a5181f8a)
2026-10-10 17:22:07 +00:00
Cursor Agent eba1dec764 fix(relinker): reject non-regular input files
A directory opens and tellg reports an enormous size, so the relinker
tried to allocate it and failed with std::bad_alloc. Require a regular
file and a non-negative size before allocating the input buffer.
2026-10-10 08:26:32 +02:00
Tomás Ortellado 9f9e4e28b8 fix(relinker): reject invalid and overflowing alignment 2026-10-05 08:44:55 -03:00
DiulioAires b6c97084ed fix(relinker): check byte writer bounds 2026-10-04 20:17:21 -03:00
RomainROCH b6ff4a2116 fix(relinker): reject overflowing buffer offsets 2026-09-30 18:07:26 +02:00
Darko Gjorgjijoski 42594eecd4 fix(relinker): report buffered output write failures 2026-09-28 00:25:42 +02:00
boykopovar 4b643c6655 refactor(core): seprated folders for relinker and libs 2026-09-11 14:53:01 +03:00