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_x86_64
= 62, // Intel x86-64 Architecture
54 // Other values skipped
57 // A section header in the section header table
67 Elf32_Word sh_addralign
;
68 Elf32_Word sh_entsize
;
71 // Values for the section type field in a section header
85 SHT_LOPROC
= 0x70000000,
86 SHT_HIPROC
= 0x7fffffff,
87 SHT_LOUSER
= 0x80000000,
88 SHT_HIUSER
= 0xffffffff,
102 // Values for the segment type field in a program segment header
103 enum ph_type_values
{
111 PT_LOPROC
= 0x70000000,
112 PT_HIPROC
= 0x7fffffff
123 Elf32_Sword r_addend
;
126 enum elf32_rel_386_type_values
{
138 R_386_TLS_TPOFF
= 14,
141 #endif // COURGETTE_ELF_TYPES_H_