xref: /xv6-public/elf.h (revision 29270816)
1 #define ELF_MAGIC 0x464C457FU	/* "\x7FELF" in little endian */
2 
3 struct elfhdr {
4 	uint magic;	// must equal ELF_MAGIC
5 	uchar elf[12];
6 	ushort type;
7 	ushort machine;
8 	uint version;
9 	uint entry;
10 	uint phoff;
11 	uint shoff;
12 	uint flags;
13 	ushort ehsize;
14 	ushort phentsize;
15 	ushort phnum;
16 	ushort shentsize;
17 	ushort shnum;
18 	ushort shstrndx;
19 };
20 
21 struct proghdr {
22 	uint type;
23 	uint offset;
24 	uint va;
25 	uint pa;
26 	uint filesz;
27 	uint memsz;
28 	uint flags;
29 	uint align;
30 };
31 
32 // Values for Proghdr type
33 #define ELF_PROG_LOAD		1
34 
35 // Flag bits for Proghdr flags
36 #define ELF_PROG_FLAG_EXEC	1
37 #define ELF_PROG_FLAG_WRITE	2
38 #define ELF_PROG_FLAG_READ	4
39 
40