mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-09 11:01:37 -07:00
parallelize symbol tables patching
This commit is contained in:
committed by
Ryan Fleury
parent
d604456def
commit
205723f8d6
+2488
-2324
File diff suppressed because it is too large
Load Diff
+28
-2
@@ -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);
|
||||
|
||||
@@ -1740,7 +1740,7 @@ lnk_apply_cmd_option_to_config(Arena *arena, LNK_Config *config, String8 cmd_nam
|
||||
} break;
|
||||
|
||||
case LNK_CmdSwitch_Rad_PageSize: {
|
||||
lnk_cmd_switch_parse_u64(obj_path, lib_path, cmd_switch, value_strings, &config->page_size, 0);
|
||||
lnk_cmd_switch_parse_u64(obj_path, lib_path, cmd_switch, value_strings, &config->machine_page_size, 0);
|
||||
} break;
|
||||
|
||||
case LNK_CmdSwitch_Rad_PathStyle: {
|
||||
@@ -1935,13 +1935,13 @@ lnk_unwrap_rsp(Arena *arena, String8List arg_list)
|
||||
}
|
||||
|
||||
internal LNK_Config *
|
||||
lnk_config_from_cmd_line(Arena *arena, LNK_CmdLine cmd_line)
|
||||
lnk_config_from_cmd_line(Arena *arena, String8List raw_cmd_line, LNK_CmdLine cmd_line)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
LNK_Config *config = push_array(arena, LNK_Config, 1);
|
||||
config->raw_cmd_line = str8_list_copy(arena, &cmd_line.raw_cmd_line);
|
||||
config->raw_cmd_line = str8_list_copy(arena, &raw_cmd_line);
|
||||
config->work_dir = os_get_current_path(arena);
|
||||
config->build_imp_lib = 1;
|
||||
config->build_exp = 1;
|
||||
|
||||
@@ -319,7 +319,7 @@ typedef struct LNK_Config
|
||||
U64 heap_commit;
|
||||
U64 user_base_addr;
|
||||
U64 max_image_size;
|
||||
U64 page_size;
|
||||
U64 machine_page_size;
|
||||
U64 pdb_page_size;
|
||||
U64 worker_count;
|
||||
U64 max_worker_count;
|
||||
@@ -583,6 +583,3 @@ internal B32 lnk_parse_merge_directive(String8 string, LNK_MergeDirective *parse
|
||||
|
||||
internal void lnk_apply_cmd_option_to_config(Arena *arena, LNK_Config *config, String8 name, String8List value_list, String8 obj_path, String8 lib_path);
|
||||
|
||||
internal LNK_Config * lnk_config_from_raw_cmd_line(Arena *arena, String8List raw_cmd_line);
|
||||
internal LNK_Config * lnk_build_config (Arena *arena, int argc, char **argv);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user