SELF File Format
Jump to navigation
Jump to search
File Format
ELF Program Headers
Struct
typedef struct {
uint32_t p_type; /* type of segment */
uint32_t p_flags; /* segment attributes */
uint64_t p_offset; /* offset in file */
uint64_t p_vaddr; /* virtual address in memory */
uint64_t p_paddr; /* reserved */
uint64_t p_filesz; /* size of segment in file */
uint64_t p_memsz; /* size of segment in memory */
uint64_t p_align; /* alignment of segment */
} __attribute__((packed)) ELF_PHDR;
Table
Comments
See Spec here: ELF Program Headers
ELF Section Headers
Struct
typedef struct {
uint32_t sh_name; /* section name */
uint32_t sh_type; /* section type */
uint64_t sh_flags; /* section attributes */
uint64_t sh_addr; /* virtual address in memory */
uint64_t sh_offset; /* offset in file */
uint64_t sh_size; /* size of section */
uint32_t sh_link; /* link to other section */
uint32_t sh_info; /* miscellaneous information */
uint64_t sh_addralign; /* address alignment boundary */
uint64_t sh_entsize; /* size of entries, if section has table */
} __attribute__((packed)) ELF_SHDR;