The OpenD Programming Language

1 /**
2  * D header file for GNU/Linux
3  *
4  * $(LINK2 http://sourceware.org/git/?p=glibc.git;a=blob;f=elf/elf.h, glibc elf/elf.h)
5  */
6 module core.sys.linux.elf;
7 
8 version (linux):
9 extern (C):
10 pure:
11 nothrow:
12 
13 import core.stdc.stdint;
14 public import core.sys.elf;
15 
16 extern (D)
17 {
18     auto ELF32_ST_VISIBILITY(O)(O o) { return o & 0x03; }
19     alias ELF32_ST_VISIBILITY ELF64_ST_VISIBILITY;
20 }
21 
22 struct Elf32_Nhdr
23 {
24   Elf32_Word n_namesz;
25   Elf32_Word n_descsz;
26   Elf32_Word n_type;
27 }
28 
29 struct Elf64_Nhdr
30 {
31   Elf64_Word n_namesz;
32   Elf64_Word n_descsz;
33   Elf64_Word n_type;
34 }
35 
36 enum NT_PRSTATUS =     1;
37 enum NT_FPREGSET =     2;
38 enum NT_PRPSINFO =     3;
39 enum NT_PRXREG =       4;
40 enum NT_TASKSTRUCT =   4;
41 enum NT_PLATFORM =     5;
42 enum NT_AUXV =         6;
43 enum NT_GWINDOWS =     7;
44 enum NT_ASRS =         8;
45 enum NT_PSTATUS =      10;
46 enum NT_PSINFO =       13;
47 enum NT_PRCRED =       14;
48 enum NT_UTSNAME =      15;
49 enum NT_LWPSTATUS =    16;
50 enum NT_LWPSINFO =     17;
51 enum NT_PRFPXREG =     20;
52 enum NT_SIGINFO =      0x53494749;
53 enum NT_FILE =         0x46494c45;
54 enum NT_PRXFPREG =     0x46e62b7f;
55 enum NT_PPC_VMX =      0x100;
56 enum NT_PPC_SPE =      0x101;
57 enum NT_PPC_VSX =      0x102;
58 enum NT_386_TLS =      0x200;
59 enum NT_386_IOPERM =   0x201;
60 enum NT_X86_XSTATE =   0x202;
61 enum NT_S390_HIGH_GPRS =       0x300;
62 enum NT_S390_TIMER =   0x301;
63 enum NT_S390_TODCMP =  0x302;
64 enum NT_S390_TODPREG = 0x303;
65 enum NT_S390_CTRS =    0x304;
66 enum NT_S390_PREFIX =  0x305;
67 enum NT_S390_LAST_BREAK =      0x306;
68 enum NT_S390_SYSTEM_CALL =     0x307;
69 enum NT_S390_TDB =     0x308;
70 enum NT_ARM_VFP =      0x400;
71 enum NT_ARM_TLS =      0x401;
72 enum NT_ARM_HW_BREAK = 0x402;
73 enum NT_ARM_HW_WATCH = 0x403;
74 
75 enum NT_VERSION =      1;
76 
77 struct Elf32_Dyn
78 {
79   Elf32_Sword   d_tag;
80   union _d_un
81   {
82       Elf32_Word d_val;
83       Elf32_Addr d_ptr;
84   } _d_un d_un;
85 }
86 
87 struct Elf64_Dyn
88 {
89   Elf64_Sxword  d_tag;
90   union _d_un
91   {
92       Elf64_Xword d_val;
93       Elf64_Addr d_ptr;
94   } _d_un d_un;
95 }
96 
97 enum NT_GNU_ABI_TAG =      1;
98 enum NT_GNU_HWCAP =        2;
99 enum NT_GNU_BUILD_ID =     3;
100 enum NT_GNU_GOLD_VERSION = 4;
101 
102 struct Elf32_auxv_t
103 {
104     uint32_t a_type;
105     union _a_un
106     {
107         uint32_t a_val;
108     } _a_un a_un;
109 }
110 
111 struct Elf64_auxv_t
112 {
113     uint64_t a_type;
114     union _a_un
115     {
116         uint64_t a_val;
117     } _a_un a_un;
118 }
119 
120 enum AT_NULL =         0;
121 enum AT_IGNORE =       1;
122 enum AT_EXECFD =       2;
123 enum AT_PHDR =         3;
124 enum AT_PHENT =        4;
125 enum AT_PHNUM =        5;
126 enum AT_PAGESZ =       6;
127 enum AT_BASE =         7;
128 enum AT_FLAGS =        8;
129 enum AT_ENTRY =        9;
130 enum AT_NOTELF =       10;
131 enum AT_UID =          11;
132 enum AT_EUID =         12;
133 enum AT_GID =          13;
134 enum AT_EGID =         14;
135 enum AT_CLKTCK =       17;
136 enum AT_PLATFORM =     15;
137 enum AT_HWCAP =        16;
138 enum AT_FPUCW =        18;
139 enum AT_DCACHEBSIZE =  19;
140 enum AT_ICACHEBSIZE =  20;
141 enum AT_UCACHEBSIZE =  21;
142 enum AT_IGNOREPPC =    22;
143 
144 enum AT_SECURE =       23;
145 
146 enum AT_BASE_PLATFORM = 24;
147 
148 enum AT_RANDOM =       25;
149 
150 enum AT_HWCAP2 =       26;
151 
152 enum AT_EXECFN =       31;
153 enum AT_SYSINFO =      32;
154 enum AT_SYSINFO_EHDR = 33;
155 
156 enum AT_L1I_CACHESHAPE =       34;
157 enum AT_L1D_CACHESHAPE =       35;
158 enum AT_L2_CACHESHAPE =        36;
159 enum AT_L3_CACHESHAPE =        37;