ELF32_GETCHDR(3)

πŸ“¦
version 0.197 Β· 2 versions
  • 0.197 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 15.1 Β· freebsd 14.5, freebsd 15.1, nixpkgs unstable
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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's SHF_COMPRESSED flag 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 πŸ’–


⭐ 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:

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