1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COURGETTE_ELF_TYPES_H_
6 #define COURGETTE_ELF_TYPES_H_
9 // This header defines various types from the ELF file spec, but no code
10 // related to using them.
13 typedef uint32 Elf32_Addr; // Unsigned program address
14 typedef uint16 Elf32_Half; // Unsigned medium integer
15 typedef uint32 Elf32_Off; // Unsigned file offset
16 typedef int32 Elf32_Sword; // Signed large integer
17 typedef uint32 Elf32_Word; // Unsigned large integer
20 // The header at the top of the file
22 unsigned char e_ident[16];
31 Elf32_Half e_phentsize;
33 Elf32_Half e_shentsize;
35 Elf32_Half e_shstrndx;
38 // values for header->e_type
40 ET_NONE = 0, // No file type
41 ET_REL = 1, // Relocatable file
42 ET_EXEC = 2, // Executable file
43 ET_DYN = 3, // Shared object file
44 ET_CORE = 4, // Core file
45 ET_LOPROC = 0xff00, // Processor-specific
46 ET_HIPROC = 0xfff // Processor-specific
49 // values for header->e_machine
50 enum e_machine_values {
51 EM_NONE = 0, // No machine
52 EM_386 = 3, // Intel Architecture
53 EM_ARM = 40, // ARM Architecture
54 EM_x86_64 = 62, // Intel x86-64 Architecture
55 // Other values skipped
58 // A section header in the section header table
68 Elf32_Word sh_addralign;
69 Elf32_Word sh_entsize;
72 // Values for the section type field in a section header
88 SHT_LOPROC = 0x70000000,
89 SHT_HIPROC = 0x7fffffff,
90 SHT_LOUSER = 0x80000000,
91 SHT_HIUSER = 0xffffffff,
105 // Values for the segment type field in a program segment header
106 enum ph_type_values {
114 PT_LOPROC = 0x70000000,
115 PT_HIPROC = 0x7fffffff
126 Elf32_Sword r_addend;
129 enum elf32_rel_386_type_values {
141 R_386_TLS_TPOFF = 14,
144 enum elf32_rel_arm_type_values {
148 #endif // COURGETTE_ELF_TYPES_H_