reloc helper

This commit is contained in:
Nikita Smith authored and Ryan Fleury committed 2025-09-24 12:42:17 -07:00
1 parent 0a930be613
commit 3c0c531c53
2 files changed
+17

No files matched your search

+15
View File
@@ -103,6 +103,21 @@ coff_read_symbol_name(String8 string_table, COFF_SymbolName *name)
return name_str;
}
internal U64
coff_is_addr_reloc(COFF_MachineType machine, U32 type)
{
U64 is_addr = 0;
switch (machine) {
case COFF_MachineType_Unknown: is_addr = 0; break;
case COFF_MachineType_X64: {
if (type == COFF_Reloc_X64_Addr32) is_addr = 4;
else if (type == COFF_Reloc_X64_Addr64) is_addr = 8;
} break;
default: NotImplemented; break;
}
return is_addr;
}
internal U64
coff_apply_size_from_reloc_x64(COFF_Reloc_X64 x)
{