Source
pub const dl_phdr_info = switch (native_os) {
.linux => linux.dl_phdr_info,
.emscripten => emscripten.dl_phdr_info,
.freebsd => extern struct {
/// Module relocation base.
addr: std.elf.Addr,
/// Module name.
name: ?[*:0]const u8,
/// Pointer to module's phdr.
phdr: [*]std.elf.Phdr,
/// Number of entries in phdr.
phnum: u16,
/// Total number of loads.
adds: u64,
/// Total number of unloads.
subs: u64,
tls_modid: usize,
tls_data: ?*anyopaque,
},
.solaris, .illumos => extern struct {
addr: std.elf.Addr,
name: ?[*:0]const u8,
phdr: [*]std.elf.Phdr,
phnum: std.elf.Half,
/// Incremented when a new object is mapped into the process.
adds: u64,
/// Incremented when an object is unmapped from the process.
subs: u64,
},
// https://github.com/SerenityOS/serenity/blob/45d81dceed81df0c8ef75b440b20cc0938195faa/Userland/Libraries/LibC/link.h#L15-L20
.openbsd, .haiku, .dragonfly, .netbsd, .serenity => extern struct {
addr: usize,
name: ?[*:0]const u8,
phdr: [*]std.elf.Phdr,
phnum: std.elf.Half,
},
else => void,
}