mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-22 03:35:00 -07:00
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
This commit is contained in:
+4
-4
@@ -1394,8 +1394,8 @@ lnk_build_link_context(TP_Context *tp, TP_Arena *tp_arena, LNK_Config *config)
|
||||
|
||||
// create import stubs (later replaced with acutal imports generated by linker)
|
||||
LNK_Symbol *import_stub = lnk_symbol_table_search(symtab, LNK_SymbolScope_Defined, str8_lit(LNK_IMPORT_STUB));
|
||||
LNK_Symbol *thunk_symbol = lnk_make_defined_symbol(scratch.arena, import_header.func_name, import_stub->u.defined.obj, import_stub->u.defined.symbol_idx);
|
||||
LNK_Symbol *imp_symbol = lnk_make_defined_symbol(scratch.arena, push_str8f(scratch.arena, "__imp_%S", import_header.func_name), import_stub->u.defined.obj, import_stub->u.defined.symbol_idx);
|
||||
LNK_Symbol *thunk_symbol = lnk_make_defined_symbol(symtab->arena->v[0], import_header.func_name, import_stub->u.defined.obj, import_stub->u.defined.symbol_idx);
|
||||
LNK_Symbol *imp_symbol = lnk_make_defined_symbol(symtab->arena->v[0], push_str8f(scratch.arena, "__imp_%S", import_header.func_name), import_stub->u.defined.obj, import_stub->u.defined.symbol_idx);
|
||||
lnk_symbol_table_push(symtab, LNK_SymbolScope_Defined, thunk_symbol);
|
||||
lnk_symbol_table_push(symtab, LNK_SymbolScope_Defined, imp_symbol);
|
||||
|
||||
@@ -4749,8 +4749,8 @@ lnk_run(TP_Context *tp, TP_Arena *arena, LNK_Config *config)
|
||||
ProfBegin("Build Import Library");
|
||||
lnk_timer_begin(LNK_Timer_Lib);
|
||||
String8 linker_debug_symbols = lnk_make_linker_debug_symbols(scratch.arena, config->machine);
|
||||
String8List lib_list = pe_make_import_lib(arena->v[0], config->machine, config->time_stamp, str8_skip_last_slash(config->image_name), linker_debug_symbols, config->export_symbol_list);
|
||||
lnk_write_data_list_to_file_path(config->imp_lib_name, str8_zero(), lib_list);
|
||||
String8 lib = pe_make_import_lib(arena->v[0], config->machine, config->time_stamp, str8_skip_last_slash(config->image_name), linker_debug_symbols, config->export_symbol_list);
|
||||
lnk_write_data_to_file_path(config->imp_lib_name, str8_zero(), lib);
|
||||
lnk_timer_end(LNK_Timer_Lib);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user