5 #ifndef _SYS_ELFCOMMON_H
6 #define _SYS_ELFCOMMON_H
18 #define PT_LOOS 0x60000000
19 #define PT_HIOS 0x6fffffff
20 #define PT_LOPROC 0x70000000
21 #define PT_HIPROC 0x7fffffff
22 #define PT_GNU_EH_FRAME 0x6474e550 /* Extension, eh? */
30 #define ET_LOPROC 0xff00
31 #define ET_HIPROC 0xffff
33 /* ELF machine types */
40 #define EM_486 6 /* Not used in Linux at least */
42 #define EM_MIPS 8 /* R3k, bigendian(?) */
43 #define EM_MIPS_RS4_BE 10 /* R4k BE */
45 #define EM_SPARC32PLUS 18
50 #define EM_SPARCV9 43 /* v9 = SPARC64 */
53 #define EM_IA_64 50 /* Itanic */
57 #define EM_ALPHA 0x9026 /* Interrim Alpha that stuck around */
58 #define EM_CYGNUS_V850 0x9080 /* Old v850 ID used by Cygnus */
59 #define EM_S390_OLD 0xA390 /* Obsolete interrim value for S/390 */
61 /* Dynamic type values */
78 #define DT_SYMBOLIC 16
86 #define DT_LOPROC 0x70000000
87 #define DT_HIPROC 0x7fffffff
89 /* Auxilliary table entries */
90 #define AT_NULL 0 /* end of vector */
91 #define AT_IGNORE 1 /* entry should be ignored */
92 #define AT_EXECFD 2 /* file descriptor of program */
93 #define AT_PHDR 3 /* program headers for program */
94 #define AT_PHENT 4 /* size of program header entry */
95 #define AT_PHNUM 5 /* number of program headers */
96 #define AT_PAGESZ 6 /* system page size */
97 #define AT_BASE 7 /* base address of interpreter */
98 #define AT_FLAGS 8 /* flags */
99 #define AT_ENTRY 9 /* entry point of program */
100 #define AT_NOTELF 10 /* program is not ELF */
101 #define AT_UID 11 /* real uid */
102 #define AT_EUID 12 /* effective uid */
103 #define AT_GID 13 /* real gid */
104 #define AT_EGID 14 /* effective gid */
105 #define AT_PLATFORM 15 /* string identifying CPU for optimizations */
106 #define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
107 #define AT_CLKTCK 17 /* frequency at which times() increments */
109 #define AT_SECURE 23 /* secure mode boolean */
111 /* Program header permission flags */
116 /* Section header types */
118 #define SHT_PROGBITS 1
123 #define SHT_DYNAMIC 6
128 #define SHT_DYNSYM 11
130 #define SHT_LOPROC 0x70000000
131 #define SHT_HIPROC 0x7fffffff
132 #define SHT_LOUSER 0x80000000
133 #define SHT_HIUSER 0xffffffff
135 /* Section header flags */
136 #define SHF_WRITE 0x1
137 #define SHF_ALLOC 0x2
138 #define SHF_EXECINSTR 0x4
139 #define SHF_MASKPROC 0xf0000000
141 /* Special section numbers */
143 #define SHN_LORESERVE 0xff00
144 #define SHN_LOPROC 0xff00
145 #define SHN_HIPROC 0xff1f
146 #define SHN_ABS 0xfff1
147 #define SHN_COMMON 0xfff2
148 #define SHN_HIRESERVE 0xffff
150 /* Lenght of magic at the start of a file */
153 /* Magic number constants... */
154 #define EI_MAG0 0 /* e_ident[] indexes */
164 #define ELFMAG0 0x7f /* EI_MAG */
168 #define ELFMAG "\177ELF"
171 #define ELFCLASSNONE 0 /* EI_CLASS */
174 #define ELFCLASSNUM 3
176 #define ELFDATANONE 0 /* e_ident[EI_DATA] */
177 #define ELFDATA2LSB 1
178 #define ELFDATA2MSB 2
180 #define EV_NONE 0 /* e_version, EI_VERSION */
184 #define ELFOSABI_NONE 0
185 #define ELFOSABI_LINUX 3
187 #endif /* _SYS_ELFCOMMON_H */