2 * (C) Copyright 2007-2010 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
4 * This file is released under the GPLv2. See the COPYING file for more
19 #define EI_ABIVERSION 8
28 #define ELFCLASSNONE 0
38 #define ELFOSABI_NONE 0
45 #define ET_LOOS 0xfe00
46 #define ET_HIOS 0xfeff
47 #define ET_LOPROC 0xff00
48 #define ET_HIPROC 0xffff
53 #define SHT_PROGBITS 1
64 #define SHT_INIT_ARRAY 14
65 #define SHT_FINI_ARRAY 15
66 #define SHT_PREINI_ARRAY 16
68 #define SHT_SYMTAB_SHNDX 18
69 #define SHT_LOOS 0x60000000
70 #define SHT_HIOS 0x6fffffff
71 #define SHT_LOPROC 0x70000000
72 #define SHT_HIPROC 0x7fffffff
73 #define SHT_LOUSER 0x80000000
74 #define SHT_HIUSER 0xffffffff
84 #define PT_LOOS 0x60000000
85 #define PT_HIOS 0x6fffffff
86 #define PT_LOPROC 0x70000000
87 #define PT_HIPROC 0x7fffffff
92 #define PF_MASKOS 0x0ff00000
93 #define PF_MAKSPROC 0xf0000000
95 typedef u32 Elf32_Addr
;
96 typedef u32 Elf32_Off
;
97 typedef u16 Elf32_Half
;
98 typedef u32 Elf32_Word
;
99 typedef s32 Elf32_Sword
;
101 typedef u64 Elf64_Addr
;
102 typedef u64 Elf64_Off
;
103 typedef u16 Elf64_Half
;
104 typedef u32 Elf64_Word
;
105 typedef s32 Elf64_Sword
;
106 typedef u64 Elf64_Xword
;
107 typedef s64 Elf64_Sxword
;
113 unsigned char e_ident
[EI_NIDENT
]; /* ELF identification */
114 Elf32_Half e_type
; /* Object file type */
115 Elf32_Half e_machine
; /* Machine type */
116 Elf32_Word e_version
; /* Object file version */
117 Elf32_Addr e_entry
; /* Entry point address */
118 Elf32_Off e_phoff
; /* Program header offset */
119 Elf32_Off e_shoff
; /* Section header offset */
120 Elf32_Word e_flags
; /* Processor-specific flags */
121 Elf32_Half e_ehsize
; /* ELF header size */
122 Elf32_Half e_phentsize
; /* Size of program header entry */
123 Elf32_Half e_phnum
; /* Number of program header entries */
124 Elf32_Half e_shentsize
; /* Size of section header entries */
125 Elf32_Half e_shnum
; /* Number of section header entries */
126 Elf32_Half e_shstrndx
; /* Section name string table index */
130 unsigned char e_ident
[EI_NIDENT
]; /* ELF identification */
131 Elf64_Half e_type
; /* Object file type */
132 Elf64_Half e_machine
; /* Machine type */
133 Elf64_Word e_version
; /* Object file version */
134 Elf64_Addr e_entry
; /* Entry point address */
135 Elf64_Off e_phoff
; /* Program header offset */
136 Elf64_Off e_shoff
; /* Section header offset */
137 Elf64_Word e_flags
; /* Processor-specific flags */
138 Elf64_Half e_ehsize
; /* ELF header size */
139 Elf64_Half e_phentsize
; /* Size of program header entry */
140 Elf64_Half e_phnum
; /* Number of program header entries */
141 Elf64_Half e_shentsize
; /* Size of section header entries */
142 Elf64_Half e_shnum
; /* Number of section header entries */
143 Elf64_Half e_shstrndx
; /* Section name string table index */
146 /* combined header for easy pointer casting */
156 Elf32_Word sh_name
; /* Section name */
157 Elf32_Word sh_type
; /* Section type */
158 Elf32_Word sh_flags
; /* Section attributes */
159 Elf32_Addr sh_addr
; /* Virtual address in memory */
160 Elf32_Off sh_offset
; /* Offset in file */
161 Elf32_Word sh_size
; /* Size of section */
162 Elf32_Word sh_link
; /* Link to other section */
163 Elf32_Word sh_info
; /* Misc information */
164 Elf32_Word sh_addralign
; /* Address alignment boundary */
165 Elf32_Word sh_entsize
; /* Size of entries, if section has table */
169 Elf64_Word sh_name
; /* Section name */
170 Elf64_Word sh_type
; /* Section type */
171 Elf64_Xword sh_flags
; /* Section attributes */
172 Elf64_Addr sh_addr
; /* Virtual address in memory */
173 Elf64_Off sh_offset
; /* Offset in file */
174 Elf64_Xword sh_size
; /* Size of section */
175 Elf64_Word sh_link
; /* Link to other section */
176 Elf64_Word sh_info
; /* Misc information */
177 Elf64_Xword sh_addralign
; /* Address alignment boundary */
178 Elf64_Xword sh_entsize
; /* Size of entries, if section has table */
181 /* combined header for easy pointer casting */
191 Elf32_Word p_type
; /* Segment type */
192 Elf32_Off p_offset
; /* Segment file offset */
193 Elf32_Addr p_vaddr
; /* Segment virt. addr */
194 Elf32_Addr p_paddr
; /* <undefined> */
195 Elf32_Word p_filesz
; /* Segment size in file */
196 Elf32_Word p_memsz
; /* Segment size in mem */
197 Elf32_Word p_flags
; /* Segment flags */
198 Elf32_Word p_align
; /* Segment alignment */
202 Elf64_Word p_type
; /* Segment type */
203 Elf64_Word p_flags
; /* Segment file offset */
204 Elf64_Off p_offset
; /* Segment virt. addr */
205 Elf64_Addr p_vaddr
; /* <undefined> */
206 Elf64_Addr p_paddr
; /* Segment size in file */
207 Elf64_Xword p_filesz
; /* Segment size in mem */
208 Elf64_Xword p_memsz
; /* Segment flags */
209 Elf64_Xword p_align
; /* Segment alignment */
212 /* combined header for easy pointer casting */