Adding upstream version 3.50~pre5.
[syslinux-debian/hramrach.git] / com32 / include / sys / elf64.h
blob0b486ac26ef0eee7d692361dd7e7308ac5e64d4f
1 /*
2 * sys/elf64.h
3 */
5 #ifndef _SYS_ELF64_H
6 #define _SYS_ELF64_H
8 #include <sys/elfcommon.h>
10 /* ELF standard typedefs (yet more proof that <stdint.h> was way overdue) */
11 typedef uint16_t Elf64_Half;
12 typedef int16_t Elf64_SHalf;
13 typedef uint32_t Elf64_Word;
14 typedef int32_t Elf64_Sword;
15 typedef uint64_t Elf64_Xword;
16 typedef int64_t Elf64_Sxword;
18 typedef uint64_t Elf64_Off;
19 typedef uint64_t Elf64_Addr;
20 typedef uint16_t Elf64_Section;
22 /* Dynamic header */
24 typedef struct elf64_dyn {
25 Elf64_Sxword d_tag;
26 union {
27 Elf64_Xword d_val;
28 Elf64_Addr d_ptr;
29 } d_un;
30 } Elf64_Dyn;
32 /* Relocations */
34 #define ELF64_R_SYM(x) ((x) >> 32)
35 #define ELF64_R_TYPE(x) ((x) & 0xffffffff)
37 typedef struct elf64_rel {
38 Elf64_Addr r_offset;
39 Elf64_Xword r_info;
40 } Elf64_Rel;
42 typedef struct elf64_rela {
43 Elf64_Addr r_offset;
44 Elf64_Xword r_info;
45 Elf64_Sxword r_addend;
46 } Elf64_Rela;
48 /* Symbol */
50 typedef struct elf64_sym {
51 Elf64_Word st_name;
52 unsigned char st_info;
53 unsigned char st_other;
54 Elf64_Half st_shndx;
55 Elf64_Addr st_value;
56 Elf64_Xword st_size;
57 } Elf64_Sym;
59 /* Main file header */
61 typedef struct elf64_hdr {
62 unsigned char e_ident[EI_NIDENT];
63 Elf64_Half e_type;
64 Elf64_Half e_machine;
65 Elf64_Word e_version;
66 Elf64_Addr e_entry;
67 Elf64_Off e_phoff;
68 Elf64_Off e_shoff;
69 Elf64_Word e_flags;
70 Elf64_Half e_ehsize;
71 Elf64_Half e_phentsize;
72 Elf64_Half e_phnum;
73 Elf64_Half e_shentsize;
74 Elf64_Half e_shnum;
75 Elf64_Half e_shstrndx;
76 } Elf64_Ehdr;
78 /* Program header */
80 typedef struct elf64_phdr {
81 Elf64_Word p_type;
82 Elf64_Word p_flags;
83 Elf64_Off p_offset;
84 Elf64_Addr p_vaddr;
85 Elf64_Addr p_paddr;
86 Elf64_Xword p_filesz;
87 Elf64_Xword p_memsz;
88 Elf64_Xword p_align;
89 } Elf64_Phdr;
91 /* Section header */
93 typedef struct elf64_shdr {
94 Elf64_Word sh_name;
95 Elf64_Word sh_type;
96 Elf64_Xword sh_flags;
97 Elf64_Addr sh_addr;
98 Elf64_Off sh_offset;
99 Elf64_Xword sh_size;
100 Elf64_Word sh_link;
101 Elf64_Word sh_info;
102 Elf64_Xword sh_addralign;
103 Elf64_Xword sh_entsize;
104 } Elf64_Shdr;
106 /* Note header */
107 typedef struct elf64_note {
108 Elf64_Word n_namesz; /* Name size */
109 Elf64_Word n_descsz; /* Content size */
110 Elf64_Word n_type; /* Content type */
111 } Elf64_Nhdr;
113 #endif /* _SYS_ELF64_H */