arch -> COFF machine

This commit is contained in:
Nikita Smith
2026-02-09 23:40:31 -08:00
parent 1579e6eae6
commit 33b1e25295
2 changed files with 18 additions and 2 deletions
+15
View File
@@ -455,6 +455,21 @@ arch_from_coff_machine(COFF_MachineType machine)
return result;
}
internal COFF_MachineType
coff_machine_from_arch(Arch arch)
{
COFF_MachineType machine = COFF_MachineType_Unknown;
switch (arch) {
case Arch_Null: machine = COFF_MachineType_Unknown; break;
case Arch_x86: machine = COFF_MachineType_X86; break;
case Arch_x64: machine = COFF_MachineType_X64; break;
case Arch_arm64: machine = COFF_MachineType_Arm64; break;
case Arch_arm32: machine = COFF_MachineType_Arm; break;
default: InvalidPath; break;
}
return machine;
}
internal U64
coff_foff_from_voff(COFF_SectionHeader *sections, U64 section_count, U64 voff)
{
+3 -2
View File
@@ -628,8 +628,9 @@ internal U64 coff_word_size_from_machine (COFF_MachineType machine);
internal U64 coff_default_exe_base_from_machine(COFF_MachineType machine);
internal U64 coff_default_dll_base_from_machine(COFF_MachineType machine);
internal Arch arch_from_coff_machine(COFF_MachineType machine);
internal U64 coff_foff_from_voff(COFF_SectionHeader *sections, U64 section_count, U64 voff);
internal Arch arch_from_coff_machine(COFF_MachineType machine);
internal COFF_MachineType coff_machine_from_arch(Arch arch);
internal U64 coff_foff_from_voff(COFF_SectionHeader *sections, U64 section_count, U64 voff);
////////////////////////////////
//~ rjf: Enum <=> String