ELF32_GETCHDR(3)
β¨ ELF32_GETCHDR(3) β¨
okay bestie, sit down, hydrate, and let me tell you about elf32_getchdr and elf64_getchdr β two lil functions from the Libelf Programmer's Manual whose whole entire job is grabbing the compression header for a section out of a 32-bit or 64-bit ELF object file. yes ma'am, that's the vibe. π
π NAME π
elf32_getchdr, elf64_getchdr β retrieve the compression header for a section from a 32-bit or 64-bit ELF object file. it's giving "where's the compression info, bestie?" and the answer is right here. π«Ά
π¦ SYNOPSIS π¦
#include <libelf.h>
Elf32_Chdr *elf32_getchdr(Elf_Scn *scn);
Elf64_Chdr *elf64_getchdr(Elf_Scn *scn);
πΈ DESCRIPTION πΈ
So like, this function retrieves the compression header for a section that has compressed data. how do you know a section is serving compressed-data realness? it's got the SHF_COMPRESSED flag set, periodt. π
want the whole lore on what a compression header even is? check out libelf(3) β it spills all the tea. no cap. β¨
π PARAMETERS π
scnβ the section whose compression header is getting retrieved, iykyk. and listen: that section'sSHF_COMPRESSEDflag must be set. like, it's not optional, bestie. it's the whole prerequisite. π¨
π RETURN VALUE π
on success? you get a pointer to the compression header. iconic. π
on failure? you get NULL, and a libelf error code gets set. it's giving "something went wrong and we're telling you about it". check elf_errno(3) if you wanna know the deets. π
π SEE ALSO π
elf_compress(3)elf_errno(3)libelf(3)elf(5)
β ATTRIBUTES β
for an explanation of the terms used in this section, see attributes(7).
- Interface:
elf32_getchdr(),elf64_getchdr() - Attribute: Thread safety
- Value:
MT-Safe
translation: she's MT-Safe, bestie. you can thread her. π
π REPORTING BUGS π
found a bug? don't be shy, tell the people:
- email: <elfutils-devel@sourceware.org>
- or file it at: <https://sourceware.org/bugzilla/>
they wanna hear it, fr fr. π
π§ HISTORY π§
elf32_getchdr first appeared in elfutils 0.165. a true queen, an OG, a legend. π
okay that's the whole page, mwah π β this was the Libelf manual, dated 2024-08-14, and the source/version tag on this whole thing is Libelf. bye bestie, go compress something responsibly π«Άβ¨
π¦ where this page comes from
- alpine 3.22: elfutils-doc 0.193-r0 Β· GPL-3.0-or-later AND ( GPL-2.0-or-later OR LGPL-3.0-or-later )
- alpine 3.23: elfutils-doc 0.194-r0 Β· GPL-3.0-or-later AND ( GPL-2.0-or-later OR LGPL-3.0-or-later )
- 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
- debian trixie: libelf-dev 0.192-4 Β· GPL-3.0-or-later
- fedora 43: elfutils-libelf-devel 0.193-3.fc43 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 43: elfutils-libelf-devel 0.193-3.fc43 Β· 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.194-5.fc44 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 44: elfutils-libelf-devel 0.194-5.fc44 Β· 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
- nixos 26.05: elfutils 0.194
- nixpkgs unstable: elfutils 0.195
- opensuse-leap 16.0: libelf-devel 0.192-160000.3.1 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- opensuse-leap 16.0: libelf-devel 0.192-160000.3.1 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- opensuse-leap 16.0: libelf-devel 0.192-160000.3.1 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- opensuse-leap 16.0: libelf-devel 0.192-160000.3.1 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- ubuntu questing: libelf-dev 0.193-1
- ubuntu resolute: libelf-dev 0.194-4 Β· GPL-3.0-or-later
- 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