authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-07-13 15:08:01+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-07-13 15:08:01+02:00
log0627ca527ac9b973ff0823c274913d2ece8ae6be
tree6faa89152524a316ff2699073836038d0472799e
parent4c3625d74546e22e1bd4695cc7bdde09f645bf30

elf: add ELF and GNU-specific missing defs


1 files changed, 60 insertions(+), 3 deletions(-)

lib/std/elf.zig+60-3
......@@ -221,6 +221,58 @@ pub const DT_IA_64_NUM = 1;
221221
222222pub const DT_NIOS2_GP = 0x70000002;
223223
224pub const DF_ORIGIN = 0x00000001;
225pub const DF_SYMBOLIC = 0x00000002;
226pub const DF_TEXTREL = 0x00000004;
227pub const DF_BIND_NOW = 0x00000008;
228pub const DF_STATIC_TLS = 0x00000010;
229
230pub const DF_1_NOW = 0x00000001;
231pub const DF_1_GLOBAL = 0x00000002;
232pub const DF_1_GROUP = 0x00000004;
233pub const DF_1_NODELETE = 0x00000008;
234pub const DF_1_LOADFLTR = 0x00000010;
235pub const DF_1_INITFIRST = 0x00000020;
236pub const DF_1_NOOPEN = 0x00000040;
237pub const DF_1_ORIGIN = 0x00000080;
238pub const DF_1_DIRECT = 0x00000100;
239pub const DF_1_TRANS = 0x00000200;
240pub const DF_1_INTERPOSE = 0x00000400;
241pub const DF_1_NODEFLIB = 0x00000800;
242pub const DF_1_NODUMP = 0x00001000;
243pub const DF_1_CONFALT = 0x00002000;
244pub const DF_1_ENDFILTEE = 0x00004000;
245pub const DF_1_DISPRELDNE = 0x00008000;
246pub const DF_1_DISPRELPND = 0x00010000;
247pub const DF_1_NODIRECT = 0x00020000;
248pub const DF_1_IGNMULDEF = 0x00040000;
249pub const DF_1_NOKSYMS = 0x00080000;
250pub const DF_1_NOHDR = 0x00100000;
251pub const DF_1_EDITED = 0x00200000;
252pub const DF_1_NORELOC = 0x00400000;
253pub const DF_1_SYMINTPOSE = 0x00800000;
254pub const DF_1_GLOBAUDIT = 0x01000000;
255pub const DF_1_SINGLETON = 0x02000000;
256pub const DF_1_STUB = 0x04000000;
257pub const DF_1_PIE = 0x08000000;
258
259pub const VERSYM_HIDDEN = 0x8000;
260pub const VERSYM_VERSION = 0x7fff;
261
262/// Symbol is local
263pub const VER_NDX_LOCAL = 0;
264/// Symbol is global
265pub const VER_NDX_GLOBAL = 1;
266/// Beginning of reserved entries
267pub const VER_NDX_LORESERVE = 0xff00;
268/// Symbol is to be eliminated
269pub const VER_NDX_ELIMINATE = 0xff01;
270
271/// Version definition of the file itself
272pub const VER_FLG_BASE = 1;
273/// Weak version identifier
274pub const VER_FLG_WEAK = 2;
275
224276/// Program header table entry unused
225277pub const PT_NULL = 0;
226278/// Loadable program segment
......@@ -298,6 +350,14 @@ pub const SHT_SYMTAB_SHNDX = 18;
298350pub const SHT_LOOS = 0x60000000;
299351/// LLVM address-significance table
300352pub const SHT_LLVM_ADDRSIG = 0x6fff4c03;
353/// GNU hash table
354pub const SHT_GNU_HASH = 0x6ffffff6;
355/// GNU version definition table
356pub const SHT_GNU_VERDEF = 0x6ffffffd;
357/// GNU needed versions table
358pub const SHT_GNU_VERNEED = 0x6ffffffe;
359/// GNU symbol version table
360pub const SHT_GNU_VERSYM = 0x6fffffff;
301361/// End of OS-specific
302362pub const SHT_HIOS = 0x6fffffff;
303363/// Start of processor-specific
......@@ -369,9 +429,6 @@ pub const STT_HP_STUB = (STT_LOOS + 0x2);
369429pub const STT_ARM_TFUNC = STT_LOPROC;
370430pub const STT_ARM_16BIT = STT_HIPROC;
371431
372pub const VER_FLG_BASE = 0x1;
373pub const VER_FLG_WEAK = 0x2;
374
375432pub const MAGIC = "\x7fELF";
376433
377434/// File types