GELF_GETSHDR(3)
π GELF_GETSHDR π
okay bestie, welcome to the libelf programmer's manual, section 3 β this is the gelf_getshdr(3) page and it's literally so useful. sit down, grab a boba, let's get into it π§β¨
β¨ NAME β¨
gelf_getshdr β retrieve a section header into a class-independent structure
likeβ¦ it goes and gets the section header for you and hands it over in a form that doesn't care whether you're on 32-bit or 64-bit. iconic behavior honestly π
π SYNOPSIS π
#include <gelf.h>
GElf_Shdr *gelf_getshdr(Elf_Scn *scn, GElf_Shdr *dst);
π¦ DESCRIPTION π¦
so here's the vibe. gelf_getshdr() retrieves the section header that belongs to the section descriptor scn, and it translates it into the class-independent GElf_Shdr representation. then it copies that header into the structure that dst points at.
no cap, that's the whole thing. it's giving "glow-up your ELF section headers into one universal format" π
πΈ PARAMETERS πΈ
scnβ a pointer to a section descriptor of typeElf_Scn. this is your girl, the section you're curious about π«Άdstβ a pointer to a caller-providedGElf_Shdrstructure that's gonna receive the section header. you bring the container, it brings the contents π
β RETURN VALUE β
- on success,
gelf_getshdr()stores the section header indstand returnsdst. slay. - on failure,
NULLis returned andelf_errnois set. check it, bestie, it's telling you what went wrong π - special case: if
scnisNULL, thenNULLis returned without settingelf_errno. so likeβ¦ that one's on you, not on elf_errno π
π₯ SEE ALSO π₯
go read those next, iykyk π
π ATTRIBUTES π
- Interface:
gelf_getshdr() - Attribute: Thread safety
- Value:
MT-Safe
so yes, she's MT-Safe β you can call her from multiple threads and she won't start drama πβ¨
π REPORTING BUGS π
found a bug? not me manifesting that, but if it happens, report it to <elfutils-devel@sourceware.org> or hit up https://sourceware.org/bugzilla/. they wanna know fr fr π
okay that's the whole page, bestie π this was the Libelf programmer's manual, page GELF_GETSHDR(3), dated 2025-09-22. now go forth and get those section headers, you absolute main character ππ
π
π¦ 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