feature. See also
. The project being documented here (as the example) is the Zig library itself.
elf.Elf64
pub const Elf64 = struct
File
Code
pub const Elf64 = struct {
pub const Addr = u64;
pub const Off = u64;
pub const Ehdr = extern struct {
ident: Ident,
type: ET,
machine: EM,
version: Word,
entry: Elf64.Addr,
phoff: Elf64.Off,
shoff: Elf64.Off,
flags: EhdrFlags,
ehsize: Half,
phentsize: Half,
phnum: Half,
shentsize: Half,
shnum: Half,
shstrndx: Half,
};
pub const Phdr = extern struct {
type: PT,
flags: PF,
offset: Elf64.Off,
vaddr: Elf64.Addr,
paddr: Elf64.Addr,
filesz: Xword,
memsz: Xword,
@"align": Xword,
};
pub const Shdr = extern struct {
name: Word,
type: SHT,
flags: packed struct(Xword) { shf: SHF, unused: Word = 0 },
addr: Elf64.Addr,
offset: Elf64.Off,
size: Xword,
link: Word,
info: Word,
addralign: Xword,
entsize: Xword,
};
pub const Chdr = extern struct {
type: COMPRESS,
reserved: Word = 0,
size: Xword,
addralign: Xword,
};
pub const Sym = extern struct {
name: Word,
info: Info,
other: Other,
shndx: Section,
value: Elf64.Addr,
size: Xword,
pub const Info = Elf32.Sym.Info;
pub const Other = Elf32.Sym.Other;
};
pub const Rel = extern struct {
offset: Elf64.Addr,
info: Info,
addend: u0 = 0,
pub const Info = packed struct(u64) {
type: u32,
sym: u32,
};
};
pub const Rela = extern struct {
offset: Elf64.Addr,
info: Info,
addend: i64,
pub const Info = Elf64.Rel.Info;
};
comptime {
assert(@sizeOf(Elf64.Ehdr) == 64);
assert(@sizeOf(Elf64.Phdr) == 56);
assert(@sizeOf(Elf64.Shdr) == 64);
assert(@sizeOf(Elf64.Sym) == 24);
assert(@sizeOf(Elf64.Rel) == 16);
assert(@sizeOf(Elf64.Rela) == 24);
}
}