feat(loader): add static x86_64 ELF loader
This commit is contained in:
1 parent
831a2e1de7
commit
afd0649188
2 files changed
+87
No files matched your search
@@ -0,0 +1,36 @@
|
||||
#ifndef FROSTBYTE_ELF_H
|
||||
#define FROSTBYTE_ELF_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
typedef struct Elf64Header {
|
||||
uint8 ident[16];
|
||||
uint16 type;
|
||||
uint16 machine;
|
||||
uint32 version;
|
||||
uint64 entry;
|
||||
uint64 programHeaderOffset;
|
||||
uint64 sectionHeaderOffset;
|
||||
uint32 flags;
|
||||
uint16 headerSize;
|
||||
uint16 programHeaderEntrySize;
|
||||
uint16 programHeaderCount;
|
||||
uint16 sectionHeaderEntrySize;
|
||||
uint16 sectionHeaderCount;
|
||||
uint16 sectionNameIndex;
|
||||
} __attribute__((packed)) Elf64Header;
|
||||
|
||||
typedef struct Elf64ProgramHeader {
|
||||
uint32 type;
|
||||
uint32 flags;
|
||||
uint64 offset;
|
||||
uint64 virtualAddr;
|
||||
uint64 physicalAddr;
|
||||
uint64 fileSize;
|
||||
uint64 memorySize;
|
||||
uint64 align;
|
||||
} __attribute__((packed)) Elf64ProgramHeader;
|
||||
|
||||
uint64 elfLoad(const void* image, uint64 imageSize);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user