header string table" entry offset */
} Elf32_Ehdr;
+typedef struct {
+ unsigned char e_ident[EI_NIDENT]; /* ELF Identification */
+ Elf64_Half e_type; /* object file type */
+ Elf64_Half e_machine; /* machine */
+ Elf64_Word e_version; /* object file version */
+ Elf64_Addr e_entry; /* virtual entry point */
+ Elf64_Off e_phoff; /* program header table offset */
+ Elf64_Off e_shoff; /* section header table offset */
+ Elf64_Word e_flags; /* processor-specific flags */
+ Elf64_Half e_ehsize; /* ELF header size */
+ Elf64_Half e_phentsize; /* program header entry size */
+ Elf64_Half e_phnum; /* number of program header entries */
+ Elf64_Half e_shentsize; /* section header entry size */
+ Elf64_Half e_shnum; /* number of section header entries */
+ Elf64_Half e_shstrndx; /* section header table's "section
+ header string table" entry offset */
+} Elf64_Ehdr;
+
/* e_type */
#define ET_NONE 0 /* No file type */
#define ET_REL 1 /* relocatable file */
Elf32_Word sh_entsize; /* section entry size */
} Elf32_Shdr;
+typedef struct {
+ Elf64_Word sh_name; /* name - index into section header
+ string table section */
+ Elf64_Word sh_type; /* type */
+ Elf64_Xword sh_flags; /* flags */
+ Elf64_Addr sh_addr; /* address */
+ Elf64_Off sh_offset; /* file offset */
+ Elf64_Xword sh_size; /* section size */
+ Elf64_Word sh_link; /* section header table index link */
+ Elf64_Word sh_info; /* extra information */
+ Elf64_Xword sh_addralign; /* address alignment */
+ Elf64_Xword sh_entsize; /* section entry size */
+} Elf64_Shdr;
+
/* Special Section Indexes */
#define SHN_UNDEF 0 /* undefined */
#define SHN_LORESERVE 0xff00 /* lower bounds of reserved indexes */
Elf32_Word p_align; /* memory alignment */
} Elf32_Phdr;
+typedef struct {
+ Elf64_Word p_type; /* segment type */
+ Elf64_Word p_flags; /* flags */
+ Elf64_Off p_offset; /* segment offset */
+ Elf64_Addr p_vaddr; /* virtual address of segment */
+ Elf64_Addr p_paddr; /* physical address of segment */
+ Elf64_Xword p_filesz; /* number of bytes in file for seg */
+ Elf64_Xword p_memsz; /* number of bytes in mem. for seg */
+ Elf64_Xword p_align; /* memory alignment */
+} Elf64_Phdr;
+
/* Segment types - p_type */
#define PT_NULL 0 /* unused */
#define PT_LOAD 1 /* loadable segment */