MicrOS
elf_header.h
Go to the documentation of this file.
1
#ifndef ELF_HEADER_H
2
#define ELF_HEADER_H
3
4
#include <stdint.h>
5
6
typedef
enum
elf_instruction_set
7
{
8
elf_instruction_set_32_bit
= 1,
9
elf_instruction_set_64_bit
= 2
10
}
elf_instruction_set
;
11
12
typedef
enum
elf_endian
13
{
14
little_endian
= 1,
15
big_endian
= 2
16
}
elf_endian
;
17
18
typedef
enum
elf_type
19
{
20
elf_type_relocatable
= 1,
21
elf_type_executable
= 2,
22
elf_type_shared
= 3,
23
elf_type_core
= 4,
24
25
_elf_type_extend_to_16_bit
= 0xFFFF
26
}
elf_type
;
27
28
typedef
enum
elf_architecture
29
{
30
elf_architecture_unspecified
= 0,
31
elf_architecture_sparc
= 2,
32
elf_architecture_x86
= 3,
33
elf_architecture_mips
= 8,
34
elf_architecture_power_pc
= 0x14,
35
elf_architecture_arm
= 0x28,
36
elf_architecture_super_h
= 0x2A,
37
elf_architecture_ia_64
= 0x32,
38
elf_architecture_x86_64
= 0x3E,
39
elf_architecture_aarch64
= 0xB7,
40
41
_elf_architecture_extend_to_16_bit
= 0xFFFF
42
}
elf_architecture
;
43
44
typedef
struct
elf_header
45
{
46
uint8_t
magic_number
;
47
uint8_t
elf_ascii
[3];
48
elf_instruction_set
instruction_set
;
49
elf_endian
endian
;
50
uint8_t
version_8
;
51
uint8_t
os_abi
;
52
uint64_t
reserved
;
53
elf_type
type
;
54
elf_architecture
architecture
;
55
uint32_t
version_32
;
56
uint32_t
entry_position
;
57
uint32_t
program_header_table_position
;
58
uint32_t
section_header_table_position
;
59
uint32_t
flags
;
60
uint16_t
header_size
;
61
uint16_t
program_header_table_entry_size
;
62
uint16_t
program_header_table_entries_count
;
63
uint16_t
section_header_table_entry_in_section_size
;
64
uint16_t
section_header_table_entries_in_section_count
;
65
uint16_t
section_header_table_section_names_index
;
66
} __attribute__((packed))
elf_header
;
67
68
#endif
_elf_type_extend_to_16_bit
Definition:
elf_header.h:25
elf_header::section_header_table_entries_in_section_count
uint16_t section_header_table_entries_in_section_count
Definition:
elf_header.h:64
elf_architecture_aarch64
Definition:
elf_header.h:39
elf_type_core
Definition:
elf_header.h:23
elf_header::program_header_table_entry_size
uint16_t program_header_table_entry_size
Definition:
elf_header.h:61
_elf_architecture_extend_to_16_bit
Definition:
elf_header.h:41
elf_header::version_32
uint32_t version_32
Definition:
elf_header.h:55
elf_header::section_header_table_section_names_index
uint16_t section_header_table_section_names_index
Definition:
elf_header.h:65
elf_type_relocatable
Definition:
elf_header.h:20
elf_header::endian
elf_endian endian
Definition:
elf_header.h:49
elf_header::program_header_table_position
uint32_t program_header_table_position
Definition:
elf_header.h:57
elf_architecture_x86
Definition:
elf_header.h:32
elf_instruction_set_64_bit
Definition:
elf_header.h:9
elf_header::version_8
uint8_t version_8
Definition:
elf_header.h:50
elf_type
elf_type
Definition:
elf_header.h:18
elf_header::reserved
uint64_t reserved
Definition:
elf_header.h:52
big_endian
Definition:
elf_header.h:15
elf_architecture_unspecified
Definition:
elf_header.h:30
elf_header::magic_number
uint8_t magic_number
Definition:
elf_header.h:46
elf_instruction_set
elf_instruction_set
Definition:
elf_header.h:6
elf_architecture_x86_64
Definition:
elf_header.h:38
elf_architecture_sparc
Definition:
elf_header.h:31
elf_header
Definition:
elf_header.h:44
elf_architecture
elf_architecture
Definition:
elf_header.h:28
little_endian
Definition:
elf_header.h:14
elf_architecture_arm
Definition:
elf_header.h:35
elf_architecture_super_h
Definition:
elf_header.h:36
elf_header::section_header_table_position
uint32_t section_header_table_position
Definition:
elf_header.h:58
elf_header::os_abi
uint8_t os_abi
Definition:
elf_header.h:51
elf_header::section_header_table_entry_in_section_size
uint16_t section_header_table_entry_in_section_size
Definition:
elf_header.h:63
elf_header::elf_ascii
uint8_t elf_ascii[3]
Definition:
elf_header.h:47
elf_type_executable
Definition:
elf_header.h:21
elf_architecture_power_pc
Definition:
elf_header.h:34
elf_header::instruction_set
elf_instruction_set instruction_set
Definition:
elf_header.h:48
elf_header::flags
uint32_t flags
Definition:
elf_header.h:59
elf_type_shared
Definition:
elf_header.h:22
elf_instruction_set_32_bit
Definition:
elf_header.h:8
elf_header::entry_position
uint32_t entry_position
Definition:
elf_header.h:56
elf_endian
elf_endian
Definition:
elf_header.h:12
elf_architecture_ia_64
Definition:
elf_header.h:37
uint32_t
size_t uint32_t
Unsigned integral type.
Definition:
string.h:8
elf_architecture_mips
Definition:
elf_header.h:33
elf_header::header_size
uint16_t header_size
Definition:
elf_header.h:60
elf_header::type
elf_type type
Definition:
elf_header.h:53
elf_header::program_header_table_entries_count
uint16_t program_header_table_entries_count
Definition:
elf_header.h:62
elf_header::architecture
elf_architecture architecture
Definition:
elf_header.h:54
os
kernel
src
process
elf
parser
elf_header.h
Generated by
1.8.13