Commit Graph
100 Commits
Author SHA1 Message Date
Nikita Smith 048b93b166 remove empty sections if it does not have any section contributions too 2026-07-27 14:47:17 -07:00
Nikita Smith 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 Smith 7197398f31 split external-symbol handling from section-definition fallbacks 2026-07-27 14:47:15 -07:00
Nikita Smith 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 Smith 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 Smith 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 Smith 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 Smith 65541eaf91 LLVM BC magic sniffer 2026-07-27 14:47:12 -07:00
Nikita Smith 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 Smith 541727b819 debug log unresolved symbols specified in .llvm_addrsig 2026-07-27 14:47:11 -07:00
Nikita Smith 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 Smith 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 Smith 941b8a011e duplicate identical search aliases are not an error case 2026-07-27 14:47:09 -07:00
Nikita Smith 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 Smith 1ea9fae835 debug report live stats after /OPT:REF pass 2026-07-27 14:47:08 -07:00
Nikita Smith 4daefad31e map GNU lib extension 2026-06-23 12:32:52 -07:00
Nikita Smith 765b61152d sort import library member refs by input index 2026-06-23 12:32:52 -07:00
Nikita Smith ad20900fc0 import hash table -> hash map 2026-06-23 12:32:51 -07:00
Nikita Smith 8dbced6995 set flag on import member from the originally linked library, otherwise
on subsequent passes linker may queue same import
2026-06-23 12:32:50 -07:00
Nikita Smith 84d025e940 force inline string compars 2026-06-23 12:32:50 -07:00
Nikita Smith 4f899ac678 update memfun 2026-06-19 20:12:27 -07:00
Nikita Smith 05a024ddb3 remove /RAD_ALT_PCH_DIR
* Instead of matching on file path in LF_PRECOMP, loop over the objects
  with .debug$P and probe leaves at the index specified in LF_PRECOMP.
  If signatures match, use the PCH.
* Demote LNK_Error_PrecompObjNotFound to a recoverable error.
2026-06-19 20:12:27 -07:00
Nikita Smith 9b63131f37 ditch semaphores in thread pool in favor of barriers 2026-06-19 20:12:26 -07:00
Nikita Smith 6ea9bfc5a3 fix tail comparisons 2026-06-19 20:12:25 -07:00
Nikita Smith c81c072018 includes for rdi_from_codeview 2026-06-19 20:12:25 -07:00
Nikita Smith 3534100e8d lazy touch obj string tables 2026-06-19 20:12:24 -07:00
Nikita Smith 9616307503 add extra node to the symbol ref for better insertion per 2026-06-19 20:12:24 -07:00
Nikita Smith 871f94a202 use vectorized memory functions in the base strings 2026-06-19 20:12:23 -07:00
Nikita Smith ba32d7fdec use CL driver when compiling with clang on windows to simplify compile and link lines 2026-06-19 20:12:22 -07:00
Nikita Smith 8ef58def99 update torture
* factor test registration logic out of the macro to improve debuggability
* expand the test registration logic
* rename group -> layer for consistency
* fix indentation in the slow tests summary
2026-06-19 20:12:22 -07:00
Nikita Smith b8bad9a82e range helper that computes max part from min+size 2026-06-16 17:22:53 -07:00
Nikita Smith 267b8fc519 missing count in the range list concat 2026-06-16 17:22:52 -07:00
Nikita Smith 956df5527a switch type server from PDB to a custom file format (RRT) 2026-06-16 17:22:50 -07:00
Nikita Smith c030488814 fallback on PCH signature when file path match fails 2026-06-13 06:20:40 -07:00
Nikita Smith c6a4e4c02b skip broken tests 2026-06-12 15:34:30 -07:00
Nikita Smith 41e6470d28 fix radbin launch in p2r determinism test 2026-06-12 15:34:29 -07:00
Nikita Smith 7d8aa18e4d make debug hash section tests error number agnostic 2026-06-12 13:54:29 -07:00
Nikita Smith ac0c7d9441 on checkout do git LFS in github actions 2026-06-12 13:35:10 -07:00
Nikita Smith 7ad422f8ad make run_tests.sh executable 2026-06-12 13:21:31 -07:00
Nikita Smith 2a5070bb87 update change log 2026-06-12 13:17:21 -07:00
Nikita Smith ac8c3e7a2d do not emit relocation for empty resource entry 2026-06-12 12:05:45 -07:00
Nikita Smith 3f6d5df899 apply merge fixes 2026-06-12 11:53:15 -07:00
Nikita Smith 9ce6b9504b centralize section header reads and writes 2026-06-12 11:40:03 -07:00
Nikita Smith 42cf820972 cache for section flags
modifying the section flags is expensive with COW file mappings, Windows
maps are set to 64k granularity
2026-06-12 11:40:02 -07:00
Nikita Smith 3452f23839 add a new boot mode to RADLINK for launching as a type server
checkpoint
2026-06-12 11:40:01 -07:00
Nikita Smith 541d3afefa WIP /RAD_TYPE_SERVER
env vars

replace HashTable with HashMap in config
2026-06-02 12:11:12 -07:00
Nikita Smith 4c8d66b431 fix accidental removal of debug info sections resulting in non-eligible
sections not getting marked with 'is_live'
2026-06-02 12:11:11 -07:00
Nikita Smith 98a281c8a0 hint for installing external libraries 2026-06-02 12:11:11 -07:00
Nikita Smith a151df283f skip tests without directive, and escape * in ubuntu run 2026-06-02 12:11:00 -07:00
Nikita Smith 3a109a7343 sketch test for SYSV and GNU style hash tables 2026-06-02 12:11:00 -07:00
Nikita Smith 637a0f88b2 add run_to_line command; clean up pass over script parser; changed
harness to always compile and link tests to prevent code rotting
2026-06-02 12:10:59 -07:00
Nikita Smith e3fa8e4830 improve error reports in tests 2026-06-02 12:10:58 -07:00
Nikita Smith fe2778133f rework file directive handling; remove T_Group; add SKIP to disable
tests that are not passing; change command line syntax for easier
test run/skip/force; updated help; shortened --dbg_graphical -> --gui;
add 'skip' directive to the dbg scripts
2026-06-02 12:10:58 -07:00
Nikita Smith a21a256333 .gitattributes 2026-06-02 12:10:57 -07:00
Nikita Smith 3a7586e84b export line and column numbers from MD 2026-06-02 12:10:56 -07:00
Nikita Smith b1d58fb4f9 skip DWARF line table and checksum tests 2026-06-02 12:10:54 -07:00
Nikita Smith e06e7f1c9f split voff_range into two fields 2026-06-02 12:10:54 -07:00
Nikita Smith c875c912d2 update IPC parser 2026-06-02 12:10:53 -07:00
Nikita Smith ec6f569181 set CLOCK_MONOTONIC on conditional variables 2026-06-02 12:10:51 -07:00
Nikita Smith e3587dcb9f use GetForegroundWindow for foucs detection with parented debuggers 2026-06-02 12:10:50 -07:00
Nikita Smith 568a77b73c fix up scratch conflicts 2026-06-02 12:10:50 -07:00
Nikita Smith 4ff6d2cc6c use the make library to generate RDI 2026-06-02 12:10:49 -07:00
Nikita Smith eb90ddc739 remove eval_compiler_basics 2026-06-02 12:10:46 -07:00
Nikita Smith b2318803a1 report radbin errors 2026-06-02 12:10:46 -07:00
Nikita Smith e637149ae3 broadcasting a stack pointer and then leaving scope in optimized
mode may cause use-after-free
2026-06-02 12:10:45 -07:00
Nikita Smith 79cb6c3c5e step into tests 2026-06-02 12:10:45 -07:00
Nikita Smith 09afff7957 improve error handling in the debugger harness (source file + line
number for error reports and allow scripts without header)
2026-06-02 12:10:44 -07:00
Nikita Smith eb8cee76c0 update .gitattributes to set LF endings on meta files so metagen
files have consistent line endings regardless of the host preference
2026-06-02 12:10:42 -07:00
Nikita Smith 4a57087d81 dump RDI local vars 2026-06-02 12:10:40 -07:00
Nikita Smith 8127763fa4 fix linux build 2026-06-02 12:10:40 -07:00
Nikita Smith 2e4069b89a debug stats for /OPT:REF 2026-06-02 12:10:39 -07:00
Nikita Smith c5677cf5f4 wire DWARF expression eval to the unwinder 2026-06-02 12:10:39 -07:00
Nikita Smith 8126f1f18e first popped value off the stack is right-hand-side 2026-06-02 12:10:38 -07:00
Nikita Smith 03180247c9 rebase fixes 2026-06-02 12:10:38 -07:00
Nikita Smith 1883649e18 debug util for PDB section map 2026-06-02 12:10:37 -07:00
Nikita Smith 2f799e0e0e more /OPT:REF tests 2026-06-02 12:10:37 -07:00
Nikita Smith 49af8248ef update tests summary 2026-06-02 12:10:36 -07:00
Nikita Smith 31662822db rebase 2026-06-02 12:10:36 -07:00
Nikita Smith 19cee2d646 todo 2026-06-02 12:10:35 -07:00
Nikita Smith cc93bf4439 mismatched type on 'blur_count' 2026-06-02 12:10:34 -07:00
Nikita Smith c62afbcf83 normalize line endings in generated files 2026-06-02 12:10:34 -07:00
Nikita Smith 9447cce94d open generated files as binary so we have consistent line endings across
Linux and Windows
2026-06-02 12:10:33 -07:00
Nikita Smith 5089a01058 change make_directory behavior on Linux to match Windows behavior 2026-06-02 12:10:32 -07:00
Nikita Smith a1f0df2d76 run clang build for now 2026-06-02 12:10:32 -07:00
Nikita Smith fb48dcf42b update defines for non-graphical debugger build 2026-06-02 12:10:31 -07:00
Nikita Smith 612ac8f414 fix regression introduced in aea4a4ff 2026-06-02 12:10:31 -07:00
Nikita Smith 1e0f1d026b sanity-check scissor region, fix var shadowing bug in blur GLSL shader,
and remove 'blur_count' that causes linking issues

[OpenGL] GL_INVALID_OPERATION in glGetUniformLocation(program not linked)
[OpenGL] GL_INVALID_OPERATION in glUniform(program not linked)
[OpenGL] GL_INVALID_VALUE in glScissor
2026-06-02 12:10:30 -07:00
Nikita Smith 15bf343168 gate for dwarf converter 2026-06-02 12:10:30 -07:00
Nikita Smith a3bac20a73 rebase fixes
normalize line endings

sort test pointers

rebase fixes

rebase fixes
2026-06-02 12:10:29 -07:00
Nikita Smith 58fc57f6a3 torture_dbg: reuse Windows env-var expander in the harness compile/link/launch steps 2026-06-02 12:10:28 -07:00
Nikita Smith 96e20759d5 file endings 2026-06-02 12:10:28 -07:00
Nikita Smith 65288208af dbg_engine: extend trap-net range across contiguous same-source-line ranges 2026-06-02 12:10:27 -07:00
Nikita Smith d7e5c5a830 dbg_engine: bugfix memory fetch in step_over, step_over_inst, and step_into
and incorrect boolean logic for trap-net
2026-06-02 12:10:27 -07:00
Nikita Smith 4acd8a9b86 fill out address 2026-06-02 12:10:26 -07:00
Nikita Smith 528b0fde56 replace hard-coded visual studio path with vswhere 2026-06-02 12:10:26 -07:00
Nikita Smith 3e9fff93f1 tidy up names in builds.yml 2026-06-02 12:10:25 -07:00
Nikita Smith 146ef012c4 on error restore PATH 2026-06-02 12:10:24 -07:00
Nikita Smith ec3da44568 minor fix 2026-06-02 12:10:24 -07:00
Nikita Smith 266d66250c process join 2026-06-02 12:10:23 -07:00
Nikita Smith a60b61cafd run 2026-06-02 12:10:23 -07:00