mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-19 09:54:54 +00:00
started elf loader
This commit is contained in:
parent
be996892a9
commit
730f9ecdbb
2 changed files with 80 additions and 0 deletions
|
@ -32,6 +32,50 @@ struct self_segment_header
|
|||
u64 memory_size;
|
||||
};
|
||||
|
||||
struct elf_header
|
||||
{
|
||||
u08 e_ident[16]; /* ELF identification */
|
||||
u16 e_type; /* Object file type */
|
||||
u16 e_machine; /* Machine type */
|
||||
u32 e_version; /* Object file version */
|
||||
u64 e_entry; /* Entry point address */
|
||||
u64 e_phoff; /* Program header offset */
|
||||
u64 e_shoff; /* Section header offset */
|
||||
u32 e_flags; /* Processor-specific flags */
|
||||
u16 e_ehsize; /* ELF header size */
|
||||
u16 e_phentsize; /* Size of program header entry */
|
||||
u16 e_phnum; /* Number of program header entries */
|
||||
u16 e_shentsize; /* Size of section header entry */
|
||||
u16 e_shnum; /* Number of section header entries */
|
||||
u16 e_shstrndx; /* Section name string table index */
|
||||
};
|
||||
|
||||
struct elf_program_header
|
||||
{
|
||||
u32 p_type; /* Type of segment */
|
||||
u32 p_flags; /* Segment attributes */
|
||||
u64 p_offset; /* Offset in file */
|
||||
u64 p_vaddr; /* Virtual address in memory */
|
||||
u64 p_paddr; /* Reserved */
|
||||
u64 p_filesz; /* Size of segment in file */
|
||||
u64 p_memsz; /* Size of segment in memory */
|
||||
u64 p_align; /* Alignment of segment */
|
||||
};
|
||||
|
||||
struct elf_section_header
|
||||
{
|
||||
u32 sh_name; /* Section name */
|
||||
u32 sh_type; /* Section type */
|
||||
u64 sh_flags; /* Section attributes */
|
||||
u64 sh_addr; /* Virtual address in memory */
|
||||
u64 sh_offset; /* Offset in file */
|
||||
u64 sh_size; /* Size of section */
|
||||
u32 sh_link; /* Link to other section */
|
||||
u32 sh_info; /* Miscellaneous information */
|
||||
u64 sh_addralign; /* Address alignment boundary */
|
||||
u64 sh_entsize; /* Size of entries, if section has table */
|
||||
};
|
||||
|
||||
class Elf
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue