Nikita Smith
e33a95bfe2
do not embed time stamp with /brepro
2025-09-17 15:21:37 -07:00
Nikita Smith
0b154cef46
stub /brepro
2025-09-17 15:21:37 -07:00
Nikita Smith
c653410af5
stub /errorreportlevel
2025-09-17 15:21:37 -07:00
Nikita Smith
28aec349fd
update readme
2025-09-17 15:21:37 -07:00
Nikita Smith
b646e1cd43
fix compiler errors
2025-09-17 15:21:37 -07:00
Nikita Smith
fe63983d4a
u32 decrement intrinsic
2025-09-17 15:21:37 -07:00
Nikita Smith
5a12513306
parallelize section garbage collection
...
currently we tag pointers to solve ABA problem however if the list
has more than max_U16 items, the tag will overflow and cause serious issues.
To fix this, we need to use 64-bit tags together with 128-bit interlocked
compare-exchange intrinsic
2025-09-17 15:21:37 -07:00
Nikita Smith
cc8fdc6c6f
order check for COMDATs with any property
2025-09-17 15:21:37 -07:00
Nikita Smith
630c3b42a7
do lightweight import gathering while resolving links
2025-09-17 15:21:37 -07:00
Nikita Smith
d4ac5ede77
assign correct removed section type
2025-09-17 15:21:37 -07:00
Nikita Smith
8a46ee0ad2
return full path to the first matched file
2025-09-17 15:21:37 -07:00
Nikita Smith
0b5dd92a87
minor tweaks
2025-09-17 15:21:37 -07:00
Nikita Smith
ded932e3ba
skip library searches for import stubs
2025-09-17 15:21:37 -07:00
Nikita Smith
98eaf67dd8
while symbol table is being built sort weak and undefined symbols to
...
separate chunk lists to speed up library search
2025-09-17 15:21:37 -07:00
Nikita Smith
4e1ebe5a6b
change import stub symbol characteristic to search alias to skip them
...
on subsequent searches
2025-09-17 15:21:37 -07:00
Nikita Smith
80967fac12
pre-parse section names and flag debug info sections
2025-09-16 10:31:02 -07:00
Nikita Smith
3224c5e0aa
skip linker info sections during relocation patching, also log a message
...
when encountering an unsupported machine type
2025-09-16 10:31:01 -07:00
Nikita Smith
488849792c
change file search to return on first match
2025-09-16 10:31:01 -07:00
Nikita Smith
7095a8cd6e
fix bug where new object tracking failed, causing certain objs to be
...
skipped during the symbol table input step
2025-09-16 10:31:01 -07:00
Nikita Smith
5aff575feb
discard empty symbol nodes
2025-09-16 10:31:01 -07:00
Nikita Smith
b5a2bbaf54
early-out of default library searches
2025-09-16 10:31:01 -07:00
Nikita Smith
d6596efac8
allow weak symbols to resolve to other weak symbols
2025-09-16 10:31:01 -07:00
Nikita Smith
c47b35f635
update link symbol set logic to replace import address symbols with jump
...
thunk symbols
2025-09-16 10:31:01 -07:00
Nikita Smith
c7c86cd360
do not report unresolved symbols in debug info sections
2025-09-16 10:31:01 -07:00
Nikita Smith
b1609017c5
inline xxhash functions
2025-09-08 16:07:31 -07:00
Nikita Smith
763bb57459
revert hasher
2025-09-08 16:07:31 -07:00
Nikita Smith
98a05728b3
add check for whether weak symbol is resolved
2025-09-08 16:07:31 -07:00
Nikita Smith
fc0a7d51d3
warning fixes
2025-09-08 16:07:31 -07:00
Nikita Smith
58e3af5b3c
test for linking using first and second lib headers
2025-09-08 16:07:31 -07:00
Nikita Smith
bbe430cc2f
write first linker member header with symbol names grouped by member
2025-09-08 16:07:31 -07:00
Nikita Smith
24b427fe72
delete unused blake3 headers
2025-09-08 16:07:31 -07:00
Nikita Smith
ee3832ea3b
parallel for lib symbol search
2025-09-08 16:07:31 -07:00
Nikita Smith
fb46d0bba4
sort symbol names in first member header
2025-09-08 16:07:31 -07:00
Nikita Smith
7193986305
binary search for strings
2025-09-08 16:07:31 -07:00
Nikita Smith
00536f7ea8
rewrite set linked symbol logic to respect declaration order in obj symbol table
2025-09-08 16:07:31 -07:00
Nikita Smith
8a22910d9b
add "Links" log type for diagnosing linked lib members
2025-09-08 16:07:31 -07:00
Nikita Smith
082f6cf6fd
fix free block check and remove unused free_size field
2025-09-08 16:07:31 -07:00
Nikita Smith
8f749f4239
use global symbol table to detect duplicate imports
2025-09-08 16:07:31 -07:00
Nikita Smith
7cea036bc1
clean up pass over symbol table
...
- rename functions for consistency
- remove unused code
2025-09-08 16:07:31 -07:00
Nikita Smith
222c220d99
make xxhash API funcs static and hash string size too
2025-09-08 16:07:31 -07:00
Nikita Smith
069d683690
fix crash when obj does not have debug info
2025-09-06 09:54:23 -07:00
Nikita Smith
3459070f71
remove windows.h from blake3
2025-09-06 09:54:23 -07:00
Nikita Smith
a6432cce8e
improve unresolved symbol errors
...
- collect symbol references and print out objs that reference
unresolved symbol
- print source file location of the references
2025-09-06 09:54:23 -07:00
Nikita Smith
d92f45784d
rename defined symbol to obj ref, as the symbol table no longer has
...
scopes and it makes no sense to refer to them that way
2025-09-06 09:54:22 -07:00
Nikita Smith
21163264d4
redirect entry point to CRT version if name is inferred
2025-09-06 09:54:22 -07:00
Nikita Smith
a11406ac51
declare thunk symobls as functions
2025-09-06 09:54:22 -07:00
Nikita Smith
11373f4432
disable COFF group info generation
2025-09-05 15:19:31 -07:00
Nikita Smith
f2ee135439
fix up symbols visibility
2025-09-05 15:19:31 -07:00
Nikita Smith
56c43ad614
clean up HashTable, removed unused command line switches, added
...
list wrapper for alt names, added natvis for HashTable, AltNameList,
MergeDirectiveList, and IncludeSymbolList
2025-09-05 15:19:31 -07:00
Nikita Smith
6a3d7e65f3
remove year from the copyright
2025-09-05 15:19:31 -07:00
Nikita Smith
e88dc44f31
clean up debug leftovers
2025-09-05 15:19:31 -07:00
Nikita Smith
580303b0dd
emit jump thunks for imports only when needed
2025-09-05 15:19:30 -07:00
Nikita Smith
43e81b934b
move weak symbol replacer to the symbol table layer
2025-09-05 15:19:30 -07:00
Nikita Smith
8d75497bba
do not set function pad min switch by default
2025-09-05 15:19:30 -07:00
Nikita Smith
0b0a2664d1
merge .idata with .rdata
2025-09-05 15:19:30 -07:00
Nikita Smith
a64f8f4196
clean up over base strings in the linker layer
2025-09-05 15:19:30 -07:00
Nikita Smith
9f6da0ec63
simplify section removal and purging
2025-09-05 15:19:30 -07:00
Nikita Smith
43b35d43dc
change lib sort to preserve input order
2025-09-05 15:19:30 -07:00
Nikita Smith
845e225e81
push alt name strings after they are copied to the config arena
2025-09-05 15:19:30 -07:00
Nikita Smith
fdad3f4f58
natvis for lib member ref
2025-09-05 15:19:30 -07:00
Nikita Smith
78b1f7e701
optionally emit import thunks
2025-09-05 15:19:30 -07:00
Nikita Smith
1aac27095e
WIP: reorder input and library search order to match MSVC behavior
2025-09-05 15:19:30 -07:00
Nikita Smith
240935f0cc
WIP: use MSVC rule for COMDAT symbol replacement
2025-09-05 15:19:30 -07:00
Nikita Smith
d9eb26a830
infer subsystem when only entry point is specified
2025-09-05 15:19:30 -07:00
Nikita Smith
b0db2b19f8
move entry point name redirection helper to MSCRT layer
2025-09-05 15:19:30 -07:00
Nikita Smith
e1b7168605
update weak vs undefined replacement rule
2025-09-05 15:19:30 -07:00
Nikita Smith
d7cdaa98b5
oops forgot to set enum type
2025-09-05 15:19:30 -07:00
Nikita Smith
c397b1dfb1
handle common section case
2025-09-05 15:19:30 -07:00
Nikita Smith
843de72f64
add U8 atomic exchange for clang and gcc
2025-09-05 15:19:30 -07:00
Nikita Smith
0dac1a91db
fix u128 make
2025-09-05 15:19:30 -07:00
Nikita Smith
fc4e269211
ignore sign conversions in stb_sprintf.h
2025-09-05 15:19:30 -07:00
Nikita Smith
daf69ff1c7
fix sign conversion in radsort.h
2025-09-05 15:19:30 -07:00
Nikita Smith
971f1b9a2f
ignore sign conversions in blake3
2025-09-05 15:19:30 -07:00
Nikita Smith
1a9e17ee37
remove invalid normalize helpers for integer vectors (they always produce zero)
2025-09-05 15:19:30 -07:00
Nikita Smith
e0c409e3f4
move prototype decl to base_core.h to fix implicit function usage
2025-09-05 15:19:30 -07:00
Nikita Smith
3bd8f0e1d5
fix argument expansion in github actions and build.bat
2025-09-05 15:19:30 -07:00
Nikita Smith
41fe8a7410
merge undefined and weak search passes
2025-09-05 15:19:30 -07:00
Nikita Smith
b64e1dca9a
WIP fix lib push order and sort new inputs
2025-09-05 15:19:30 -07:00
Nikita Smith
67e66dc26e
WIP switching to serial library search-style, removed lib scope from
...
the symbol table
2025-09-05 15:19:30 -07:00
Nikita Smith
330c8ead38
move member queue-attempt flag from symbol to lib struct
2025-09-05 15:19:30 -07:00
Nikita Smith
f1b22dbe27
change library to use compressed member offsets
2025-09-05 15:19:30 -07:00
Nikita Smith
89d496c855
fix replacement rule for weak search library vs undefined
2025-09-05 15:19:30 -07:00
Nikita Smith
0ceadff525
maintain input order of objs in PDB
2025-09-05 15:19:30 -07:00
Nikita Smith
1bca83610f
changed symbol search logic to run in three steps: undefined, weak,
...
and anti-dependency weak, allowing linking to proceed only after
symbols from previous step are added to the symbol table
this solves the problem of anti-dependency symbols because they are
searched in libraries if the dependency is unresolved weak symbol
2025-08-18 19:09:32 -07:00
Nikita Smith
e1786d0a11
discard delay loads in the config before they get to link context builder
2025-08-18 19:09:32 -07:00
Nikita Smith
1ce2fbfd1a
helper for setting default symbol
2025-08-18 19:09:32 -07:00
Nikita Smith
a3582332ee
push a null symbol as a terminator for /alternatename weak symbol chain
2025-08-18 19:09:31 -07:00
Nikita Smith
04d2877b40
strip leading white space
2025-08-18 19:09:31 -07:00
Nikita Smith
81381f9a6d
minor cleanups
2025-08-18 19:09:31 -07:00
Nikita Smith
81c68cfdd3
register common and absolute symbols in library's symbol table
2025-08-18 19:09:31 -07:00
Nikita Smith
e27831902e
note
2025-08-18 19:09:31 -07:00
Nikita Smith
c53b8d43d0
assign symbol indices before serializing symbols so forward-references
...
are possible
2025-08-18 19:09:31 -07:00
Nikita Smith
1d6eae2b18
minor fixes for gathering library members
2025-08-12 19:03:51 -07:00
Nikita Smith
086d774b8b
fix ELF compressed header and skip duplicate sections
2025-08-12 14:10:13 -07:00
Nikita Smith
b50f309422
modified member queue logic to prioritize libs where pull-in reference
...
symbol is declared
2025-08-11 23:28:03 -07:00
Nikita Smith
829a35430c
add flag to exclude objs from debug info input
2025-08-11 02:49:26 -07:00
Nikita Smith
702fd74b23
minor cleanup in obj initer
2025-08-10 21:41:39 -07:00
Nikita Smith
2b02f5cec6
lifetime fixes
...
- fully serialize the lib because we cannot guarantee that its members
will have the same lifetime as the serialized lib
- put import stub symbols on the symbol table arena
2025-08-10 21:35:33 -07:00
Nikita Smith
7466da1479
mark referenced symbols as live for unresolved-symbol detection
2025-08-08 15:54:21 -07:00
Nikita Smith
9893a8135d
fix crash when linking undefined weak symbol
2025-08-08 13:35:47 -07:00