Commit Graph
4415 Commits
Author SHA1 Message Date
Nikita SmithandRyan Fleury 4cc0f4813b WIP cache COFF symbol interp 2026-07-27 14:47:23 -07:00
Nikita SmithandRyan Fleury a779d3f1a5 WIP assigned symbols 2026-07-27 14:47:22 -07:00
Nikita SmithandRyan Fleury 493241c1da WIP light COFF symbol table parse 2026-07-27 14:47:22 -07:00
Nikita SmithandRyan Fleury bd2cbfc127 gate for page pre-faulting on windows 2026-07-27 14:47:21 -07:00
Nikita SmithandRyan Fleury cb6443ce4e release file maps before exit in parallel before exit 2026-07-27 14:47:20 -07:00
Nikita SmithandRyan Fleury 58b5b3d92d search chunks only grow while resolving libraries, so revisit only symbols appended since this library's last search 2026-07-27 14:47:20 -07:00
Nikita SmithandRyan Fleury b84d32d9fb optimize ICF refinement and COMDAT handling
Cache immutable section and relocation metadata before color refinement,
then reuse generated-tagged concurrent tables.

Parallelize grouping and fold marking.

Include associative COMDAT descendants in contribution hashes and
canonicalize relocation targets to selected COMDAT leaders.
2026-07-27 14:47:19 -07:00
Nikita SmithandRyan Fleury abfea7c33a update CHANGELOG.md 2026-07-27 14:47:18 -07:00
Nikita SmithandRyan Fleury d1b0bc0af7 refine COMDAT symlink handling
Stop treating COMDAT section-definition symbols as symlink anchors.
Keep zero-sized COMDAT sections only when they have an owned symlink,
so referenced empty COMDAT symbols still resolve while marker sections
like .gsspr/.gssep are skipped.

Update COMDAT/ICF tests to cover zero-sized COMDAT relocation behavior
and the adjusted removed-COMDAT handling.
2026-07-27 14:47:18 -07:00
Nikita SmithandRyan Fleury 8ec931d724 fix import data directory bounds
Include the null import descriptor in the import directory size and derive
the IAT directory RVA from the first import descriptor of the start of
the .idata contribution.
2026-07-27 14:47:17 -07:00
Nikita SmithandRyan Fleury 048b93b166 remove empty sections if it does not have any section contributions too 2026-07-27 14:47:17 -07:00
Nikita SmithandRyan Fleury f3d2792fb8 simplify COMDAT leader symbol patching
Collapse COMDAT leader symbol patching to a single raw-symbol write path
and make the same-object versus cross-object symlink handling explicit.
Preserve public symbol offsets for ICF folds while avoiding cross-object
section number rewrites.
2026-07-27 14:47:16 -07:00
Nikita SmithandRyan Fleury 7197398f31 split external-symbol handling from section-definition fallbacks 2026-07-27 14:47:15 -07:00
Nikita SmithandRyan Fleury d790412219 refactor radlink section gathering
Fold section definition and contributions collection into a worker-count
task with barriers around the serial merge. Share section filtering
between both phases and keep zero-size COMDATs so offset-zero symbols
still map to a section.
2026-07-27 14:47:15 -07:00
Nikita SmithandRyan Fleury b77c958b5f add DEF, GUARD, and SECTION config support
Parse /DEF, /GUARD, and /SECTION switches, including DEF
handling for NAME/LIBRARY, BASE, VERSION, HEAPSIZE, STACKSIZE, EXPORTS,
and SECTIONS.

Store section directives in linker config and apply them consistently
when gathering object sections when pushing/searching image sections.

Pull load-config symbols for /GUARD without setting GUARD_CF until guard
tables are emitted.

Add coverage for DEF file parity, section directives, and guard
load-config handling.
2026-07-27 14:47:14 -07:00
Nikita SmithandRyan Fleury 35722f2a01 handle BOMs in linker response files
Decode UTF-16LE response files with a BOM and strip UTF-8 BOMs before
parsing arguments. Add coverage for UTF-16 response-file input.
2026-07-27 14:47:13 -07:00
Nikita SmithandRyan Fleury 25430ea522 assign COMDAT symlinks after weak symbol replacement
Previously, COMDAT symlinks were assigned as each object batch was loaded.
Weak symbol replacement could later change the selected leader, leaving
objects from earlier passes with stale COMDAT leader refs. Library search
does not need symlinks to be valid, so solve this by doing a single sweep
assignment of COMDAT leaders after a fixed point is found.
2026-07-27 14:47:13 -07:00
Nikita SmithandRyan Fleury 65541eaf91 LLVM BC magic sniffer 2026-07-27 14:47:12 -07:00
Nikita SmithandRyan Fleury afd454b41f fix DBI SC image-section range mapping
Log and skip section contributions that fail to map into the linked image.
Keep a file-range-to-section-number map so compact file ranges produce the
correct DBI section numbers.
2026-07-27 14:47:12 -07:00
Nikita SmithandRyan Fleury 541727b819 debug log unresolved symbols specified in .llvm_addrsig 2026-07-27 14:47:11 -07:00
Nikita SmithandRyan Fleury 3eeae8d365 enable binary for stdout and stderr to bypass CRLF mangling issues in
captured output under build systems
2026-07-27 14:47:10 -07:00
Nikita SmithandRyan Fleury 83c55aebdc check that __imp_* archive symbols are import members before applying
import queue flags to the member
2026-07-27 14:47:09 -07:00
Nikita SmithandRyan Fleury 941b8a011e duplicate identical search aliases are not an error case 2026-07-27 14:47:09 -07:00
Nikita SmithandRyan Fleury d34e1a7802 implement /OPT:ICF
Add identical COMDAT folding using a color-refinement over foldable
read-only sections. Hash section contents, relocation targets, and target
colors until partitions stabilize, then redirect folded COMDAT symlinks
and discard duplicate sections.

Honor .llvm_addrsig via /LLVM_ADDRSIG so address-significant sections
are not folded, keep separate color space for code, unwind info, and
MSVC vftables, and update COMDAT symbol/section mapping after folding.

Add linker tests covering function folding, relocation-sensitive folds,
alignment, color-space separation, symlink chains, .llvm_addrsig,
pdata/xdata, and C++ ICF cases.
2026-07-27 14:47:08 -07:00
Nikita SmithandRyan Fleury 1ea9fae835 debug report live stats after /OPT:REF pass 2026-07-27 14:47:08 -07:00
Ryan Fleury 62328cea3f checkpoint on text patches 2026-07-27 14:47:07 -07:00
Ryan Fleury 20cd955cc9 eval2: first pass at type_key -> string path 2026-07-27 14:47:06 -07:00
Ryan Fleury 0963f4a6de const/volatile/unsigned/signed type operators 2026-07-27 14:47:06 -07:00
Ryan Fleury 78d12eb914 custom module loads -> support manually specifying pdb path 2026-07-23 20:28:52 -07:00
Ryan Fleury b0841ff2da first pass at custom load-module exception (long term for JIT) 2026-07-23 20:22:54 -07:00
Ryan Fleury 16c447bb79 eval2: leaf bytecode in ir tree 2026-06-28 07:36:24 -07:00
Ryan Fleury 96cfb441fd correctly use command titles in native file explorer 2026-06-27 12:07:24 -07:00
Ryan Fleury 0e2b4ac5e7 ui discoverability adjustments 2026-06-27 06:21:31 -07:00
Ryan Fleury 969851b6f0 flip NO_ASYNC; turn on as needed, if a layer requiring it is included 2026-06-27 04:54:30 -07:00
Ryan Fleury 410a8e3afa eval2: function pointer type parsing/compiling 2026-06-27 04:43:58 -07:00
Ryan Fleury cae9754099 eval2: fix parsing task popping rules, still give chance to rhs when popping tasks in all cases 2026-06-27 04:25:05 -07:00
Ryan Fleury b704e797e2 notes 2026-06-27 03:50:17 -07:00
Ryan Fleury 773e6554dc cycle detection in fully qualified string generation 2026-06-26 20:35:50 -07:00
Ryan Fleury fdbcf7ccdc eval2: first pass at c recursive type expression parsing 2026-06-26 16:19:19 -07:00
Ryan Fleury f1f654ecfd eval2: simplify expression parsing info, allow child reversal (for parsing non-canonical expression orders into canonical shapes, e.g. Rust-style casts like 123 as float32 -> cast(float32, 123); ptr/array type operators, etc./ 2026-06-26 13:20:38 -07:00
Ryan Fleury 60b266a1cc support size_of and type_of in clike expressions 2026-06-26 11:28:01 -06:00
Ryan Fleury 9491fdf5c2 eval2: split out expression kinds from parse styles of expressions - lets us separate semantic expression tree from frontend, so that we can easily switch frontend 2026-06-26 11:22:43 -06:00
Ryan Fleury bcbc5e4a2a eval2: macro argument expression tree parsing 2026-06-26 10:07:02 -06:00
Ryan Fleury d7393b2f65 eval2: split string -> expr compilation path into frontend / middle end - string -> expr, where expr is a loose structural syntax tree (where we can get macros and stuff without doing typechecking etc.), and expr -> irtree, where irtree is the usual typed / typechecked / ir structured representation - preserve minimal identifier resolution path for parser, but move most resolution things to the middle-end 2026-06-25 15:48:14 -07:00
Ryan Fleury c2b74260ef eval2: opkind -> exprkind, prepare for exprs being looser 2026-06-25 13:58:03 -07:00
Ryan Fleury 6b52d68c62 eval2 checkpoint: type operations, constructed types, checkpoint before splitting back to frontend / compiler split - we need to do things with the parse tree that we can't with an ir tree 2026-06-25 13:50:16 -07:00
Ryan Fleury c1b3461709 eval2: switch to extrusive lists for expression lists - this lets us reuse expression trees. also solve strange isolated unload module events in win32 demon as well 2026-06-25 11:36:18 -06:00
Ryan Fleury 6c309038ce dbg_engine: ctrl thread - be robust to strange duplicate module unload events 2026-06-25 09:51:13 -06:00
Ryan Fleury 9d651f4bd5 EpicGamesExt -> EpicGames 2026-06-25 09:08:52 -06:00
Ryan Fleury 38c1e2a414 eval2: ptr arithmetic & comparisons 2026-06-25 09:07:34 -06:00