apply merge fixes

This commit is contained in:
Nikita Smith
2026-06-12 11:53:15 -07:00
parent 9ce6b9504b
commit 3f6d5df899
5 changed files with 17 additions and 5 deletions
+5 -4
View File
@@ -5422,8 +5422,9 @@ lnk_run_linker(TP_Context *tp, TP_Arena *arena, LNK_Config *config)
// //
// CodeView // CodeView
// //
LNK_CodeViewInput cv = lnk_make_code_view_input(tp, arena, config, debug_info_objs_count, debug_info_objs); LNK_RRT_Array rrt_input = lnk_rrt_array_from_config(arena->v[0], config);
LNK_MergedTypes cv_types = lnk_merge_types(tp, arena, &cv); LNK_CodeViewInput cv = lnk_make_code_view_input(tp, arena, config, debug_info_objs_count, debug_info_objs, rrt_input);
LNK_MergedTypes cv_types = lnk_merge_types(tp, arena, &cv, 0);
// //
// Debug Info // Debug Info
@@ -5659,8 +5660,8 @@ lnk_run_type_server(TP_Context *tp, TP_Arena *arena, LNK_Config *config)
if (debug_t_total_size) { if (debug_t_total_size) {
// merge & write types // merge & write types
LNK_CodeViewInput cv = lnk_make_code_view_input(tp, arena, config, objs_count, objs); LNK_CodeViewInput cv = lnk_make_code_view_input(tp, arena, config, objs_count, objs, (LNK_RRT_Array){0});
LNK_MergedTypes cv_types = lnk_merge_types(tp, arena, &cv); LNK_MergedTypes cv_types = lnk_merge_types(tp, arena, &cv, LNK_MergeTypeFlag_BuildObjTiMap|LNK_MergeTypeFlag_SkipSymbolTypeFixup|LNK_MergeTypeFlag_ExportHashes);
String8List pdb = lnk_build_pdb(tp, arena, str8_zero(), config, 0, &cv, cv_types, LNK_PDB_BuilderFlag_Tpi|LNK_PDB_BuilderFlag_Ipi); String8List pdb = lnk_build_pdb(tp, arena, str8_zero(), config, 0, &cv, cv_types, LNK_PDB_BuilderFlag_Tpi|LNK_PDB_BuilderFlag_Ipi);
lnk_write_data_list_to_file_path(config->pdb_name, config->temp_pdb_name, pdb); lnk_write_data_list_to_file_path(config->pdb_name, config->temp_pdb_name, pdb);
+1
View File
@@ -121,6 +121,7 @@ global read_only struct
{ "lib", LNK_Input_Lib }, { "lib", LNK_Input_Lib },
{ "rlib", LNK_Input_Lib }, // rust libs { "rlib", LNK_Input_Lib }, // rust libs
{ "res", LNK_Input_Res }, { "res", LNK_Input_Res },
{ "rrt", LNK_Input_RRT },
}; };
global read_only struct global read_only struct
+1
View File
@@ -164,6 +164,7 @@ typedef enum
LNK_Input_Lib, LNK_Input_Lib,
LNK_Input_Res, LNK_Input_Res,
LNK_Input_Manifest, LNK_Input_Manifest,
LNK_Input_RRT,
LNK_Input_Count LNK_Input_Count
} LNK_InputType; } LNK_InputType;
+9
View File
@@ -638,6 +638,15 @@ lnk_try_comdat_props_from_section_number(LNK_Obj *obj, U32 section_number, COFF_
return 0; return 0;
} }
internal COFF_SectionHeader *
lnk_coff_section_header_from_section_number(LNK_Obj *obj, U64 section_number)
{
Assert(section_number > 0);
U64 sect_idx = section_number - 1;
COFF_SectionHeader *section_table = str8_deserial_get_raw_ptr(obj->data, obj->header.section_table_range.min, dim_1u64(obj->header.section_table_range));
return &section_table[sect_idx];
}
internal COFF_ParsedSymbol internal COFF_ParsedSymbol
lnk_parsed_symbol_from_coff_symbol_idx(LNK_Obj *obj, U64 symbol_idx) lnk_parsed_symbol_from_coff_symbol_idx(LNK_Obj *obj, U64 symbol_idx)
{ {
+1 -1
View File
@@ -144,7 +144,7 @@ internal LNK_Symbol * lnk_obj_get_comdat_symlink(LNK_Obj *obj, U64 section_n
// --- Symbol & Section Helpers ------------------------------------------------ // --- Symbol & Section Helpers ------------------------------------------------
internal COFF_ParsedSymbol lnk_parsed_symbol_from_coff(LNK_Obj *obj, void *coff_symbol); internal COFF_SectionHeader * lnk_coff_section_header_from_section_number(LNK_Obj *obj, U64 section_number);
internal COFF_ParsedSymbol lnk_parsed_symbol_from_coff_symbol_idx(LNK_Obj *obj, U64 symbol_idx); internal COFF_ParsedSymbol lnk_parsed_symbol_from_coff_symbol_idx(LNK_Obj *obj, U64 symbol_idx);
internal U64 lnk_obj_sect_idx_from_section_number(LNK_Obj *obj, U64 section_number); internal U64 lnk_obj_sect_idx_from_section_number(LNK_Obj *obj, U64 section_number);
internal U64 lnk_obj_section_number_from_sect_idx(LNK_Obj *obj, U64 sect_idx); internal U64 lnk_obj_section_number_from_sect_idx(LNK_Obj *obj, U64 sect_idx);