helper for querying machine specific relocation for virtual offset relocation

This commit is contained in:
Nikita Smith
2025-05-12 16:00:08 -07:00
committed by Ryan Fleury
parent c55c60549e
commit 3ffd8c19ea
2 changed files with 14 additions and 1 deletions
+12
View File
@@ -253,6 +253,18 @@ coff_pick_reloc_value_x64(COFF_Reloc_X64 type,
return result;
}
internal COFF_RelocType
coff_virt_off_reloc_from_machine(COFF_MachineType machine)
{
COFF_RelocType result = 0;
switch (machine) {
case COFF_MachineType_Unknown: break;
case COFF_MachineType_X64: result = COFF_Reloc_X64_Addr32Nb; break;
default: { NotImplemented; } break;
}
return result;
}
internal String8
coff_make_import_lookup(Arena *arena, U16 hint, String8 name)
{
+2 -1
View File
@@ -602,7 +602,8 @@ internal String8 coff_read_symbol_name(String8 string_table, COFF_SymbolName *na
internal U64 coff_apply_size_from_reloc_x64(COFF_Reloc_X64 x);
internal U64 coff_apply_size_from_reloc_x86(COFF_Reloc_X86 x);
internal COFF_RelocValue coff_pick_reloc_valuex64(COFF_Reloc_X64 type, U64 reloc_virtual_offset, U32 symbol_section_number, U32 symbol_section_offset, U32 symbol_virtual_offset, U64 symbol_address);
internal COFF_RelocValue coff_pick_reloc_value_x64(COFF_Reloc_X64 type, U64 reloc_virtual_offset, U32 symbol_section_number, U32 symbol_section_offset, U32 symbol_virtual_offset, U64 symbol_address);
internal COFF_RelocType coff_virt_off_reloc_from_machine(COFF_MachineType machine);
////////////////////////////////
// Import