-
Notifications
You must be signed in to change notification settings - Fork 4
/
elf128.h
80 lines (68 loc) · 1.58 KB
/
elf128.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef ELF128_H
#define ELF128_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "elf.h"
typedef uint16_t Elf128_Half;
typedef uint32_t Elf128_Word;
typedef __uint128_t Elf128_Xword;
typedef __uint128_t Elf128_Off;
typedef __uint128_t Elf128_Addr;
#define ELFCLASS128 3
typedef struct {
unsigned char e_ident[EI_NIDENT];
Elf128_Half e_type;
Elf128_Half e_machine;
Elf128_Word e_version;
Elf128_Addr e_entry;
Elf128_Off e_phoff;
Elf128_Off e_shoff;
Elf128_Word e_flags;
Elf128_Half e_ehsize;
Elf128_Half e_phentsize;
Elf128_Half e_phnum;
Elf128_Half e_shentsize;
Elf128_Half e_shnum;
Elf128_Half e_shstrndx;
} Elf128_Ehdr;
typedef struct {
Elf128_Word sh_name;
Elf128_Word sh_type;
Elf128_Xword sh_flags;
Elf128_Addr sh_addr;
Elf128_Off sh_offset;
Elf128_Xword sh_size;
Elf128_Word sh_link;
Elf128_Word sh_info;
Elf128_Xword sh_addralign;
Elf128_Xword sh_entsize;
} Elf128_Shdr;
typedef struct {
Elf128_Word p_type;
Elf128_Word p_flags;
Elf128_Off p_offset;
Elf128_Addr p_vaddr;
Elf128_Addr p_paddr;
Elf128_Xword p_filesz;
Elf128_Xword p_memsz;
Elf128_Xword p_align;
} Elf128_Phdr;
typedef struct {
Elf128_Word st_name;
unsigned char st_info;
unsigned char st_other;
Elf128_Half st_shndx;
Elf128_Addr st_value;
Elf128_Xword st_size;
} Elf128_Sym;
#ifdef __cplusplus
}
#include <string>
struct Options;
struct Assembler;
extern void ELFwriter64(const Options&, Assembler&, const std::string&);
extern void ELFwriter128(const Options&, Assembler&, const std::string&);
#endif
#endif /* ELF128_H */