mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-13 07:32:23 -07:00
better place for this helper function
This commit is contained in:
+1
-7
@@ -866,12 +866,6 @@ lnk_make_linker_coff_obj(Arena *arena,
|
||||
return obj;
|
||||
}
|
||||
|
||||
internal U32
|
||||
lnk_removed_section_number_from_obj(LNK_Obj *obj)
|
||||
{
|
||||
return obj->header.is_big_obj ? LNK_REMOVED_SECTION_NUMBER_32 : LNK_REMOVED_SECTION_NUMBER_16;
|
||||
}
|
||||
|
||||
internal String8
|
||||
lnk_get_lib_name(String8 path)
|
||||
{
|
||||
@@ -2957,7 +2951,7 @@ THREAD_POOL_TASK_FUNC(lnk_obj_reloc_patcher)
|
||||
COFF_ParsedSymbol symbol = lnk_parsed_symbol_from_coff_symbol_idx(obj, reloc->isymbol);
|
||||
COFF_SymbolValueInterpType interp = coff_interp_symbol(symbol.section_number, symbol.value, symbol.storage_class);
|
||||
if (interp == COFF_SymbolValueInterp_Regular) {
|
||||
if (symbol.section_number == lnk_removed_section_number_from_obj(obj)) {
|
||||
if (symbol.section_number == lnk_obj_get_removed_section_number(obj)) {
|
||||
if (!lnk_is_coff_section_debug(obj, sect_idx)) {
|
||||
String8 sect_name = coff_name_from_section_header(string_table, §ion_table[sect_idx]);
|
||||
lnk_error_obj(LNK_Error_RelocationAgainstRemovedSection, obj, "relocating against symbol that is in a removed section (symbol: %S, reloc-section: %S 0x%llx, reloc-index: 0x%llx)", symbol.name, sect_name, sect_idx+1, reloc_idx);
|
||||
|
||||
@@ -206,8 +206,6 @@ internal String8 lnk_make_null_obj(Arena *arena);
|
||||
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);
|
||||
|
||||
internal U32 lnk_removed_section_number_from_obj(LNK_Obj *obj);
|
||||
|
||||
// --- Link Context ------------------------------------------------------------
|
||||
|
||||
internal String8 lnk_get_lib_name(String8 path);
|
||||
|
||||
@@ -3023,7 +3023,7 @@ THREAD_POOL_TASK_FUNC(lnk_build_pdb_public_symbols_defined_task)
|
||||
LNK_Symbol *symbol = chunk->v[i].symbol;
|
||||
COFF_ParsedSymbol symbol_parsed = lnk_parsed_symbol_from_defined(symbol);
|
||||
|
||||
if (symbol_parsed.section_number == lnk_removed_section_number_from_obj(symbol->u.defined.obj)) { continue; }
|
||||
if (symbol_parsed.section_number == lnk_obj_get_removed_section_number(symbol->u.defined.obj)) { continue; }
|
||||
|
||||
COFF_SymbolValueInterpType symbol_interp = coff_interp_from_parsed_symbol(symbol_parsed);
|
||||
if (symbol_interp != COFF_SymbolValueInterp_Regular) { continue; }
|
||||
|
||||
@@ -493,6 +493,12 @@ lnk_obj_get_lib_path(LNK_Obj *obj)
|
||||
return lib_path;
|
||||
}
|
||||
|
||||
internal U32
|
||||
lnk_obj_get_removed_section_number(LNK_Obj *obj)
|
||||
{
|
||||
return obj->header.is_big_obj ? LNK_REMOVED_SECTION_NUMBER_32 : LNK_REMOVED_SECTION_NUMBER_16;
|
||||
}
|
||||
|
||||
internal COFF_SectionHeader *
|
||||
lnk_coff_section_header_from_section_number(LNK_Obj *obj, U64 section_number)
|
||||
{
|
||||
|
||||
@@ -105,6 +105,7 @@ internal U32 lnk_obj_get_features(LNK_Obj *obj);
|
||||
internal U32 lnk_obj_get_comp_id(LNK_Obj *obj);
|
||||
internal U32 lnk_obj_get_vol_md(LNK_Obj *obj);
|
||||
internal String8 lnk_obj_get_lib_path(LNK_Obj *obj);
|
||||
internal U32 lnk_obj_get_removed_section_number(LNK_Obj *obj);
|
||||
|
||||
// --- Symbol & Section Helpers ------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user