GELF_GETCHDR(3)
π GELF_GETCHDR π
okay so bestie, welcome to the Libelf Programmer's Manual β¨ this one's all about gelf_getchdr β she retrieves the class-independent compression header for an ELF section that's got compressed data in it. no cap. π
πΈ NAME πΈ
gelf_getchdr β retrieve the class-independent compression header for an ELF section with compressed data.
like literally that's her whole job and she does it flawlessly π
β¨ SYNOPSIS β¨
#include <gelf.h>
GElf_Chdr *gelf_getchdr (Elf_Scn *scn, GElf_Chdr *dest);
π¦ DESCRIPTION π¦
So here's the vibe: you call this, and it grabs the class-independent compression header for the section scn β the one with compressed data β and drops it right into dest. π«Ά
How do you know a section is even compressed? The SHF_COMPRESSED flag, bestie. That's the signal. If you wanna know more about what the compression header even is, go peek at libelf(3) β she explains it. π
π PARAMETERS π
scnβ the section whose compression header you're retrieving. and listen, herSHF_COMPRESSEDflag must be set. that's not a suggestion, that's the requirement. β οΈdestβ a pointer to aGElf_Chdrstructure that you, the caller, provide. she's gonna fill it with the class-independent compression header forscn. it's giving "bring your own buffer" energy π§Ί
β RETURN VALUE β
- On success? She returns
dest. slay. π - On failure? She returns
NULLand setself_errno. π - And if
scnisNULL? She returnsNULLand does not setelf_errno. that's the special case, don't forget it, iykyk π
π SEE ALSO π
elf32_getchdr(3)elf64_getchdr(3)elf_compress(3)libelf(3)elf(5)
go read them all, they're iconic, fr fr π
π ATTRIBUTES π
gelf_getchdr()β Thread safety:MT-Safeβ
like she's safe to use across threads, we love a low-drama function β¨
π REPORTING BUGS π
Found a bug? Not her fault but okay, report it to <elfutils-devel@sourceware.org> or hit up https://sourceware.org/bugzilla/. be nice about it, the maintainers are doing their best π«Ά
π HISTORY π
gelf_getchdr first appeared in elfutils 0.165. a legend since day one, periodt. π
Libelf Β· 2025-12-27 β that's the source and date bestie, signing off πβ¨ mwah, go compress something responsibly π π¦
π¦ 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