parallelize symbol tables patching

This commit is contained in:
Nikita Smith
2025-06-25 10:53:24 -07:00
committed by Ryan Fleury
parent d604456def
commit 205723f8d6
4 changed files with 2520 additions and 2333 deletions
+28 -2
View File
@@ -50,6 +50,31 @@ typedef struct LNK_BaseRelocPageArray
// --- Workers Contexts --------------------------------------------------------
typedef struct
{
LNK_SymbolTable *symtab;
LNK_SectionTable *sectab;
U64 default_align;
U64 objs_count;
LNK_Obj **objs;
LNK_SectionContrib ***sect_map;
LNK_SectionArray image_sects;
union {
struct {
HashTable **defns;
} gather_sects;
struct {
LNK_SectionContribChunk **chunks;
} sort_contribs;
struct {
B8 **was_symbol_patched;
LNK_Section *common_block_sect;
Rng1U64 *ranges;
LNK_CommonBlockContrib *common_block_contribs;
} patch_symtabs;
} u;
} LNK_BuildImageTask;
typedef struct
{
U64 page_size;
@@ -145,7 +170,7 @@ internal String8 lnk_manifest_from_inputs(Arena *arena, String8 mt_path, String8
internal String8 lnk_make_res_obj(Arena *arena, String8List res_file_list, String8List res_path_list, COFF_MachineType machine, U32 time_stamp, String8 work_dir, PathStyle system_path_style, String8 obj_name);
internal String8 lnk_make_linker_coff_obj(Arena *arena, COFF_TimeStamp time_stamp, COFF_MachineType machine, String8 cwd_path, String8 exe_path, String8 pdb_path, String8 cmd_line, String8 obj_name);
// --- Symbol Resolver ---------------------------------------------------------
// --- Link Context ------------------------------------------------------------
internal String8 lnk_get_lib_name(String8 path);
internal B32 lnk_is_lib_disallowed(HashTable *disallow_lib_ht, String8 path);
@@ -156,9 +181,10 @@ internal void lnk_push_loaded_lib(Arena *arena, HashTable *loaded_lib_ht, Str
internal LNK_InputObjList lnk_push_linker_symbols(Arena *arena, LNK_Config *config);
internal void lnk_queue_lib_member_input(Arena *arena, PathStyle path_style, LNK_SymbolLib *symbol, LNK_InputImportList *input_import_list, LNK_InputObjList *input_obj_list);
internal LNK_LinkContext lnk_build_link_context(TP_Context *tp, TP_Arena *tp_arena, LNK_Config *config);
// --- Win32 Image -------------------------------------------------------------
internal LNK_LinkContext lnk_build_link_context(TP_Context *tp, TP_Arena *tp_arena, LNK_Config *config);
internal String8List lnk_build_guard_tables(TP_Context *tp, LNK_SectionTable *sectab, LNK_SymbolTable *symtab, U64 objs_count, LNK_Obj **objs, COFF_MachineType machine, String8 entry_point_name, LNK_GuardFlags guard_flags, B32 emit_suppress_flag);
internal String8List lnk_build_base_relocs(TP_Context *tp, TP_Arena *tp_temp, LNK_Config *config, U64 objs_count, LNK_Obj **objs);
internal String8List lnk_build_win32_image_header(Arena *arena, LNK_SymbolTable *symtab, LNK_Config *config, LNK_SectionArray sect_arr, U64 expected_image_header_size);