GELF\_GETCHDR(3) Libelf Programmer's Manual GELF\_GETCHDR(3)

# [NAME](#NAME)

gelf\_getchdr - retrieve the class-independent compression header for an ELF section with compressed data.

# [SYNOPSIS](#SYNOPSIS)

```
#include <gelf.h>
GElf_Chdr *gelf_getchdr (Elf_Scn *scn, GElf_Chdr *dest);
```

# [DESCRIPTION](#DESCRIPTION)

Retrieve the class-independent compression header for section *scn* with compressed data and store it in *dest*. Sections with compressed data are indicated with the **SHF\_COMPRESSED** flag. See [**libelf**(3)](/man/os/elfutils/libelf.3) for more information regarding the compression header.

# [PARAMETERS](#PARAMETERS)

[*scn*](#scn)

Section whose compression header will be retrieved. The section's **SHF\_COMPRESSED** flag must be set.

[*dest*](#dest)

Pointer to a caller-provided **GElf\_Chdr** structure that will receive the class-independent compression header for *scn*.

# [RETURN VALUE](#RETURN_VALUE)

On success, this function returns *dest*. On failure, it returns NULL and sets elf\_errno. If *scn* is NULL, then NULL is returned and elf\_errno is not set.

# [SEE ALSO](#SEE_ALSO)

[**elf32\_getchdr**(3)](/man/os/elfutils/elf32_getchdr.3), [**elf64\_getchdr**(3)](/man/os/elfutils/elf64_getchdr.3), [**elf\_compress**(3)](/man/os/elfutils/elf_compress.3), [**libelf**(3)](/man/os/elfutils/libelf.3), [**elf**(5)](/man/os/elfutils/elf.5)

# [ATTRIBUTES](#ATTRIBUTES)

**Interface** **Attribute** **Value** gelf\_getchdr () Thread safety MT-Safe

# [REPORTING BUGS](#REPORTING_BUGS)

Report bugs to &lt;elfutils-devel@sourceware.org&gt; or https://sourceware.org/bugzilla/.

# [HISTORY](#HISTORY)

**gelf\_getchdr** first appeared in elfutils 0.165.

2025-12-27 Libelf

---

Document: gelf_getchdr(3) from elfutils 0.197-r0 (Chainguard OS)
Source: https://sourceware.org/git/elfutils.git
