diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2018-04-11 22:02:13 -0700 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2018-04-16 16:54:51 +0800 |
commit | 2bce3f595d224fc620b07449d47fa2b08151a890 (patch) | |
tree | ef642480ccd813e5a6c3b0616e6de532cc383a8f /include/elf.h | |
parent | df635df2e0f2d7a54401377bbc59e98ec2fa8753 (diff) |
elf: Add ELF64 related structure defines
This adds ELF header, program header and section header structure
defines for the 64-bit ELF image.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/elf.h')
-rw-r--r-- | include/elf.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/elf.h b/include/elf.h index 47425979807..248ba59cd6a 100644 --- a/include/elf.h +++ b/include/elf.h @@ -107,6 +107,24 @@ typedef struct { 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 */ @@ -224,6 +242,20 @@ typedef struct { 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 */ @@ -408,6 +440,17 @@ typedef struct { 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 */ |