mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 22:08:41 +00:00
move helpers to COFF layer
This commit is contained in:
committed by
Ryan Fleury
parent
a484906cf9
commit
ecdee57c60
@@ -337,6 +337,35 @@ coff_make_import_header(Arena *arena,
|
|||||||
return import_data;
|
return import_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal U8
|
||||||
|
coff_code_align_byte_from_machine(COFF_MachineType machine)
|
||||||
|
{
|
||||||
|
U8 align_byte = 0;
|
||||||
|
switch (machine) {
|
||||||
|
case COFF_MachineType_Unknown: break;
|
||||||
|
case COFF_MachineType_X64:
|
||||||
|
case COFF_MachineType_X86: {
|
||||||
|
align_byte = 0xCC;
|
||||||
|
} break;
|
||||||
|
default: { NotImplemented; } break;
|
||||||
|
}
|
||||||
|
return align_byte;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal U16
|
||||||
|
coff_default_align_from_machine(COFF_MachineType machine)
|
||||||
|
{
|
||||||
|
U16 align = 0;
|
||||||
|
switch (machine) {
|
||||||
|
case COFF_MachineType_Unknown: break;
|
||||||
|
case COFF_MachineType_X64: {
|
||||||
|
align = 16;
|
||||||
|
} break;
|
||||||
|
default: { NotImplemented; } break;
|
||||||
|
}
|
||||||
|
return align;
|
||||||
|
}
|
||||||
|
|
||||||
internal U64
|
internal U64
|
||||||
coff_word_size_from_machine(COFF_MachineType machine)
|
coff_word_size_from_machine(COFF_MachineType machine)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -617,6 +617,8 @@ internal String8 coff_make_import_header(Arena *arena, COFF_MachineType machine,
|
|||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
// Misc
|
// Misc
|
||||||
|
|
||||||
|
internal U16 coff_default_align_from_machine (COFF_MachineType machine);
|
||||||
|
internal U8 coff_code_align_byte_from_machine (COFF_MachineType machine);
|
||||||
internal U64 coff_word_size_from_machine (COFF_MachineType machine);
|
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_exe_base_from_machine(COFF_MachineType machine);
|
||||||
internal U64 coff_default_dll_base_from_machine(COFF_MachineType machine);
|
internal U64 coff_default_dll_base_from_machine(COFF_MachineType machine);
|
||||||
|
|||||||
Reference in New Issue
Block a user