Commit Graph
54 Commits
Author SHA1 Message Date
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 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 d6596efac8 allow weak symbols to resolve to other weak symbols 2025-09-16 10:31:01 -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 240935f0cc WIP: use MSVC rule for COMDAT symbol replacement 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 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 89d496c855 fix replacement rule for weak search library vs undefined 2025-09-05 15:19:30 -07:00
Nikita Smith b56ce72b7f test cases for weak vs weak 2025-08-18 19:09:32 -07:00
Nikita Smith b05237ceec handle anti-dependency weak symbol 2025-08-18 19:09:32 -07:00
Nikita Smith 31b2b1c0f7 add replacement cases for weak vs. undefined and vice versa 2025-08-18 19:09:32 -07:00
Nikita Smith 1d6eae2b18 minor fixes for gathering library members 2025-08-12 19:03:51 -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 dd715dacf7 assign COMDAT symlinks as soon as the symbol table is processed 2025-08-05 08:39:11 -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 a6b2cf64ba WIP collect sections associations 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 7cd5a670e3 WIP factoring out symbol table fixups 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 75d02f1c1e check symbol presence using stable name pointer 2025-06-25 10:53:24 -07:00
Nikita Smith af00acd0f5 add missing symbol replacement logic 2025-06-25 10:53:24 -07:00
Nikita Smith 3d2b1e19e3 handle communal var vs regular non-comdat symbol 2025-06-25 10:53:23 -07:00
Nikita Smith fb0e8d7579 fix crash on COMDAT folding communal variable 2025-06-25 10:53:23 -07:00
Nikita Smith bf25b5b249 handle COMDAT Associative selection 2025-06-25 10:53:23 -07:00
Nikita Smith bde11caf11 improve exact match selection 2025-06-25 10:53:23 -07:00
Nikita Smith aafb980c6b prevent dropping of newly inserted symbol while selecting slot leader 2025-06-25 10:53:23 -07:00
Nikita Smith 3eb7debad5 check COMDAT symlink points to a defined symbol 2025-06-25 10:53:23 -07:00
Nikita Smith 3978181d02 check symbol type before patching section header 2025-06-25 10:53:23 -07:00
Nikita Smith 4aa6e6d132 store symbol links for COMDAT 2025-06-25 10:53:23 -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 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 153bbc7b1d pass over COFF layer
- updated naming convention on structs, enums, and macros to conform with code base style
- moved related structs closer to each other
- moved parser code to separate file
2025-01-20 19:31:52 -08:00