Rev 938 | Rev 1702 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 938 | Rev 952 | ||
---|---|---|---|
Line 242... | Line 242... | ||
242 | elf_half e_shnum; |
242 | elf_half e_shnum; |
243 | elf_half e_shstrndx; |
243 | elf_half e_shstrndx; |
244 | }; |
244 | }; |
245 | 245 | ||
246 | /* |
246 | /* |
- | 247 | * ELF segment header. |
|
- | 248 | * Segments headers are also known as program headers. |
|
- | 249 | */ |
|
- | 250 | struct elf32_segment_header { |
|
- | 251 | elf_word p_type; |
|
- | 252 | elf32_off p_offset; |
|
- | 253 | elf32_addr p_vaddr; |
|
- | 254 | elf32_addr p_paddr; |
|
- | 255 | elf_word p_filesz; |
|
- | 256 | elf_word p_memsz; |
|
- | 257 | elf_word p_flags; |
|
- | 258 | elf_word p_align; |
|
- | 259 | }; |
|
- | 260 | struct elf64_segment_header { |
|
- | 261 | elf_word p_type; |
|
- | 262 | elf_word p_flags; |
|
- | 263 | elf64_off p_offset; |
|
- | 264 | elf64_addr p_vaddr; |
|
- | 265 | elf64_addr p_paddr; |
|
- | 266 | elf_xword p_filesz; |
|
- | 267 | elf_xword p_memsz; |
|
- | 268 | elf_xword p_align; |
|
- | 269 | }; |
|
- | 270 | ||
- | 271 | /* |
|
247 | * ELF section header |
272 | * ELF section header |
248 | */ |
273 | */ |
249 | struct elf32_section_header { |
274 | struct elf32_section_header { |
250 | elf_word sh_name; |
275 | elf_word sh_name; |
251 | elf_word sh_type; |
276 | elf_word sh_type; |
Line 289... | Line 314... | ||
289 | elf_half st_shndx; |
314 | elf_half st_shndx; |
290 | elf64_addr st_value; |
315 | elf64_addr st_value; |
291 | elf_xword st_size; |
316 | elf_xword st_size; |
292 | }; |
317 | }; |
293 | 318 | ||
294 | /* |
- | |
295 | * ELF program header entry |
- | |
296 | */ |
- | |
297 | struct elf32_ph_entry { |
- | |
298 | elf_word p_type; |
- | |
299 | elf32_off p_offset; |
- | |
300 | elf32_addr p_vaddr; |
- | |
301 | elf32_addr p_paddr; |
- | |
302 | elf_word p_filesz; |
- | |
303 | elf_word p_memsz; |
- | |
304 | elf_word p_flags; |
- | |
305 | elf_word p_align; |
- | |
306 | }; |
- | |
307 | struct elf64_ph_entry { |
- | |
308 | elf_word p_type; |
- | |
309 | elf_word p_flags; |
- | |
310 | elf64_off p_offset; |
- | |
311 | elf64_addr p_vaddr; |
- | |
312 | elf64_addr p_paddr; |
- | |
313 | elf_xword p_filesz; |
- | |
314 | elf_xword p_memsz; |
- | |
315 | elf_xword p_align; |
- | |
316 | }; |
- | |
317 | - | ||
318 | #ifdef __32_BITS__ |
319 | #ifdef __32_BITS__ |
319 | typedef struct elf32_header elf_header_t; |
320 | typedef struct elf32_header elf_header_t; |
- | 321 | typedef struct elf32_segment_header elf_segment_header_t; |
|
320 | typedef struct elf32_section_header elf_section_header_t; |
322 | typedef struct elf32_section_header elf_section_header_t; |
321 | typedef struct elf32_symbol elf_symbol_t; |
323 | typedef struct elf32_symbol elf_symbol_t; |
322 | typedef struct elf32_ph_entry elf_ph_entry_t; |
- | |
323 | #endif |
324 | #endif |
324 | #ifdef __64_BITS__ |
325 | #ifdef __64_BITS__ |
325 | typedef struct elf64_header elf_header_t; |
326 | typedef struct elf64_header elf_header_t; |
- | 327 | typedef struct elf64_segment_header elf_segment_header_t; |
|
326 | typedef struct elf64_section_header elf_section_header_t; |
328 | typedef struct elf64_section_header elf_section_header_t; |
327 | typedef struct elf64_symbol elf_symbol_t; |
329 | typedef struct elf64_symbol elf_symbol_t; |
328 | typedef struct elf64_ph_entry elf_ph_entry_t; |
- | |
329 | #endif |
330 | #endif |
330 | 331 | ||
331 | extern int elf_load(elf_header_t *header, as_t * as); |
332 | extern int elf_load(elf_header_t *header, as_t * as); |
332 | extern char *elf_error(int rc); |
333 | extern char *elf_error(int rc); |
333 | 334 |