mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 17:28:07 +00:00
remove structs that are now in GNU layer and add 32 -> 64 bit struct converters
This commit is contained in:
committed by
Ryan Fleury
parent
e6a01472c8
commit
d44efc15c8
@@ -112,6 +112,15 @@ elf_chdr64_from_chdr32(ELF_Chdr32 chdr32)
|
|||||||
return chdr64;
|
return chdr64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal ELF_Auxv64
|
||||||
|
elf_auxv64_from_auxv32(ELF_Auxv32 auxv32)
|
||||||
|
{
|
||||||
|
ELF_Auxv64 auxv64 = {0};
|
||||||
|
auxv64.a_type = auxv32.a_type;
|
||||||
|
auxv64.a_val = auxv32.a_val;
|
||||||
|
return auxv64;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|
||||||
internal String8
|
internal String8
|
||||||
@@ -141,3 +150,32 @@ arch_from_elf_machine(ELF_MachineKind e_machine)
|
|||||||
}
|
}
|
||||||
return arch;
|
return arch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
|
internal U64
|
||||||
|
elf_phdr_size_from_class(ELF_Class elf_class)
|
||||||
|
{
|
||||||
|
U64 result = 0;
|
||||||
|
switch (elf_class) {
|
||||||
|
case ELF_Class_None: break;
|
||||||
|
case ELF_Class_32: { result = sizeof(ELF_Phdr32); } break;
|
||||||
|
case ELF_Class_64: { result = sizeof(ELF_Phdr64); } break;
|
||||||
|
default: { NotImplemented; } break;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal U64
|
||||||
|
elf_dyn_size_from_class(ELF_Class elf_class)
|
||||||
|
{
|
||||||
|
U64 result = 0;
|
||||||
|
switch (elf_class) {
|
||||||
|
case ELF_Class_None: break;
|
||||||
|
case ELF_Class_32: { result = sizeof(ELF_Dyn32); } break;
|
||||||
|
case ELF_Class_64: { result = sizeof(ELF_Dyn64); } break;
|
||||||
|
default: { NotImplemented; } break;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-16
@@ -805,22 +805,6 @@ typedef struct ELF_Dyn64
|
|||||||
U64 val;
|
U64 val;
|
||||||
} ELF_Dyn64;
|
} ELF_Dyn64;
|
||||||
|
|
||||||
typedef struct ELF_LinkMap32
|
|
||||||
{
|
|
||||||
U32 base;
|
|
||||||
U32 name;
|
|
||||||
U32 ld;
|
|
||||||
U32 next;
|
|
||||||
} ELF_LinkMap32;
|
|
||||||
|
|
||||||
typedef struct ELF_LinkMap64
|
|
||||||
{
|
|
||||||
U64 base;
|
|
||||||
U64 name;
|
|
||||||
U64 ld;
|
|
||||||
U64 next;
|
|
||||||
} ELF_LinkMap64;
|
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
// Imports and Exports
|
// Imports and Exports
|
||||||
|
|
||||||
@@ -982,6 +966,7 @@ internal ELF_Sym64 elf_sym64_from_sym32 (ELF_Sym32 sym32);
|
|||||||
internal ELF_Rel64 elf_rel64_from_rel32 (ELF_Rel32 rel32);
|
internal ELF_Rel64 elf_rel64_from_rel32 (ELF_Rel32 rel32);
|
||||||
internal ELF_Rela64 elf_rela64_from_rela32(ELF_Rela32 rela32);
|
internal ELF_Rela64 elf_rela64_from_rela32(ELF_Rela32 rela32);
|
||||||
internal ELF_Chdr64 elf_chdr64_from_chdr32(ELF_Chdr32 chdr32);
|
internal ELF_Chdr64 elf_chdr64_from_chdr32(ELF_Chdr32 chdr32);
|
||||||
|
internal ELF_Auxv64 elf_auxv64_from_auxv32(ELF_Auxv32 auxv32);
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|
||||||
@@ -991,4 +976,9 @@ internal String8 elf_string_from_class(Arena *arena, ELF_Class v);
|
|||||||
|
|
||||||
internal Arch arch_from_elf_machine(ELF_MachineKind machine);
|
internal Arch arch_from_elf_machine(ELF_MachineKind machine);
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
|
internal U64 elf_phdr_size_from_class(ELF_Class elf_class);
|
||||||
|
internal U64 elf_dyn_size_from_class(ELF_Class elf_class);
|
||||||
|
|
||||||
#endif // ELF_H
|
#endif // ELF_H
|
||||||
|
|||||||
Reference in New Issue
Block a user