Import sources
[yari.git] / swsim / elf.h
blob8430b8c7fbc7d651a3ef6e9c842ae34132bfe2db
1 #ifndef _ELF_H_
2 #define _ELF_H_ 1
4 #include <stdint.h>
6 #define EI_NIDENT 16
8 typedef uint32_t Elf32_Addr;
9 typedef uint32_t Elf32_Off;
11 typedef struct {
12 unsigned char e_ident[EI_NIDENT];
13 uint16_t e_type;
14 uint16_t e_machine;
15 uint32_t e_version;
16 Elf32_Addr e_entry;
17 Elf32_Off e_phoff;
18 Elf32_Off e_shoff;
19 uint32_t e_flags;
20 uint16_t e_ehsize;
21 uint16_t e_phentsize;
22 uint16_t e_phnum;
23 uint16_t e_shentsize;
24 uint16_t e_shnum;
25 uint16_t e_shstrndx;
26 } Elf32_Ehdr;
28 typedef struct {
29 uint32_t p_type;
30 Elf32_Off p_offset;
31 Elf32_Addr p_vaddr;
32 Elf32_Addr p_paddr;
33 uint32_t p_filesz;
34 uint32_t p_memsz;
35 uint32_t p_flags;
36 uint32_t p_align;
37 } Elf32_Phdr;
39 typedef struct {
40 uint32_t sh_name;
41 uint32_t sh_type;
42 uint32_t sh_flags;
43 Elf32_Addr sh_addr;
44 Elf32_Off sh_offset;
45 uint32_t sh_size;
46 uint32_t sh_link;
47 uint32_t sh_info;
48 uint32_t sh_addralign;
49 uint32_t sh_entsize;
50 } Elf32_Shdr;
52 #define ELFMAG "\177ELF"
53 #define SELFMAG 4
55 #define EI_DATA 5
57 #define ET_EXEC 2
59 #define EM_MIPS 8
61 #define PT_LOAD 1
63 #endif