GELF_GETPHDR(3)
π GELF_GETPHDR(3) π
okay bestie, welcome to the Libelf Programmer's Manual β¨ this one is literally called gelf_getphdr and it's here to hand you program header table entries that don't care about class π«Ά
πΈ NAME πΈ
gelf_getphdr β Retrieve class-independent program header table entries for an ELF object file
β¨ SYNOPSIS β¨
#include <gelf.h>
GElf_Phdr *gelf_getphdr (Elf *elf, int ndx, GElf_Phdr *dst);
π¦ DESCRIPTION π¦
so basically π you're retrieving the class-independent program header table entry sitting at index ndx inside the ELF descriptor elf, and you're stashing it in dst. that's the whole vibe. slay.
and if you're like "okay but how many entries even are there tho" β go check elf_getphdrnum(3), it tells you exactly how to acquire the number of entries in the program header table. no cap. π
π PARAMETERS π
elfβ the ELF descriptor of kindELF_K_ELFthat you're pulling the program header table entry out of π§ndxβ the index of the program header table entry you want, like a lil number ticket ποΈdstβ pointer to aGElf_Phdrthat you provide, bestie, and it receives the requested program header table entry π
β RETURN VALUE β
on success? the requested entry gets copied into dst and then dst is returned. iconic. β
on failure? NULL comes back and elf_errno gets set. π
and if elf is NULL? then NULL is returned and elf_errno is not set. like, we're not even gonna touch it. π
π SEE ALSO π
elf32_getphdr(3), elf64_getphdr(3), elf_getphdrnum(3), gelf_newphdr(3), gelf_update_phdr(3), libelf(3), elf(5)
π ATTRIBUTES π
- Interface:
gelf_getphdr() - Attribute: Thread safety
- Value:
MT-Safe
so yeah, she's thread-safe, she can hang with everybody at once π β¨
π REPORTING BUGS π
found a bug? don't gatekeep, tell somebody fr fr:
- Report bugs to <elfutils-devel@sourceware.org>
- or hit up https://sourceware.org/bugzilla/
and that's the whole page, bestie!! this lil manual page came to you from Libelf, dated 2025-12-23, and it's giving GELF_GETPHDR(3) energy all the way through ππ¦πΈ periodt β¨
π¦ where this page comes from
- alpine 3.24: elfutils-doc 0.195-r0 Β· GPL-3.0-or-later AND ( GPL-2.0-or-later OR LGPL-3.0-or-later )
- arch rolling: libelf 0.196-1
- arch rolling: libelf 0.197-1 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- centos-stream 10: elfutils-libelf-devel 0.197-1.el10 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- centos-stream 9: elfutils-libelf-devel 0.197-1.el9 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- centos-stream 9: elfutils-libelf-devel 0.197-1.el9 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 43: elfutils-libelf-devel 0.196-1.fc43
- fedora 43: elfutils-libelf-devel 0.196-1.fc43
- fedora 43: elfutils-libelf-devel 0.197-1.fc43 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 43: elfutils-libelf-devel 0.197-1.fc43 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 44: elfutils-libelf-devel 0.196-1.fc44
- fedora 44: elfutils-libelf-devel 0.196-1.fc44
- fedora 44: elfutils-libelf-devel 0.197-1.fc44 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 44: elfutils-libelf-devel 0.197-1.fc44 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- nixpkgs unstable: elfutils 0.195
- ubuntu stonking: libelf-dev 0.196-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms