Commit Graph
32 Commits
Author SHA1 Message Date
Nikita Smith 1dc72b2bcf replace single-hop associative section walk to multi-hop 2026-05-18 18:11:48 -07:00
Nikita Smith 630c3b42a7 do lightweight import gathering while resolving links 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 98a05728b3 add check for whether weak symbol is resolved 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 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 6a3d7e65f3 remove year from the copyright 2025-09-05 15:19:31 -07:00
Nikita Smith 43e81b934b move weak symbol replacer to the symbol table layer 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 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 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 9893a8135d fix crash when linking undefined weak symbol 2025-08-08 13:35:47 -07:00
Nikita Smith 4f6f9d61ed inline function for replacing weak symbols with default symbol 2025-08-07 17:41:45 -07:00
Nikita Smith 9a1f96bda2 progress on /opt:ref
Link the debugger and strip unreferenced sections
TODO: Mark referenced undefined symbols for unresolved symbol reporting
2025-08-07 17:36:11 -07:00
Nikita Smith d3dedd8bef simplifying symbol table scopes
Linker cannot register extern import symbols initially because
the import object files are not available until all other object files are
resolved. To work around this, we create a stub weak symbol and assign
it to each import symbol. This allows linker to proceed. Once the import
object files are generated, linker replaces the stub symbol with
the actual ones from the import objects.
2025-08-05 08:39:12 -07:00
Nikita Smith c1958809eb make use of undocumented anti-dependency search property on weak symbols
to implement alternate name using weak symbols
2025-08-05 08:39:11 -07:00
Nikita Smith 07c7178770 filter out removed COMDATs from the PDB public symbols 2025-07-23 16:09:48 -07:00
Nikita Smith d32667546d factor out weak symbol resolution logic and apply it to the symbol table
when building link context
2025-07-23 16:09:48 -07:00
Nikita Smith fcb06579a4 collapse symbol scope and symbol type enums 2025-06-25 10:53:25 -07:00
Nikita Smith 790c95fc80 organization pass over symbol table files 2025-06-25 10:53:24 -07:00
Nikita Smith 0aadf60359 update code block dividers 2025-06-25 10:53:24 -07:00
Nikita Smith 73fe9d223a handle /ALTERNATENAME directive 2025-06-25 10:53:22 -07:00
Nikita Smith f75cdd23d7 collapse linker input states into one state 2025-06-25 10:53:22 -07:00
Nikita Smith 69d5010245 WIP switching to creating import table objs 2025-06-25 10:53:22 -07:00
Nikita Smith 7c071e7238 linker checkpoint 2025-06-25 10:53:22 -07:00
Nikita Smith 19a7ada1dc make export table with COFF obj writer,
partially converted import table to COFF obj writer
2025-06-25 10:53:21 -07:00
Nikita Smith 03a87fd4ee cleaned up a bit symbol replacement logic 2025-03-31 22:47:57 -07:00
Nikita Smith 8e6a0ae4db errors and warnings fixes 2024-11-08 11:43:05 -08:00
Nikita Smith 4a2e1dd8d0 switch to thread safe hash trie map
Initial implementation of the symbol table allowed us to push symbols
from one thread at a time and required a wonky lock-step and spread out
logic for replacing symbols. And because it was a externally chained
hash table we had to guesstimate optimal capacity for small and big targets.
We erred on the side of larger capacity to prevent degradation and
rehashing, however this meant small targets had to spent unreasonable
amount of time memory allocing slots. With hash trie we can dynamically
scale up to 4 ^ 32 items and atomically replace symbols when needed. Neat!
2024-10-30 15:43:53 -07:00
Nikita Smith 932df7bf68 linker 2024-10-15 17:25:22 -07:00