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

# [NAME](#NAME)

elf32\_getchdr, elf64\_getchdr - retrieve the compression header for a section from a 32-bit or 64-bit ELF object file.

# [SYNOPSIS](#SYNOPSIS)

```
#include <libelf.h>
Elf32_Chdr *elf32_getchdr(Elf_Scn *scn);
Elf64_Chdr *elf64_getchdr(Elf_Scn *scn);
```

# [DESCRIPTION](#DESCRIPTION)

Retrieve the compression header for a section with compressed data. 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.

# [RETURN VALUE](#RETURN_VALUE)

On success, return a pointer to the compression header. On failure, return NULL and set a libelf error code.

# [SEE ALSO](#SEE_ALSO)

[**elf\_compress**(3)](/man/os/elfutils/elf_compress.3), [**elf\_errno**(3)](/man/os/elfutils/elf_errno.3), [**libelf**(3)](/man/os/elfutils/libelf.3), [**elf**(5)](/man/os/elfutils/elf.5)

# [ATTRIBUTES](#ATTRIBUTES)

For an explanation of the terms used in this section, see [**attributes**(7)](/man/os/elfutils/attributes.7).

**Interface** **Attribute** **Value** elf32\_getchdr (), elf64\_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)

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

2024-08-14 Libelf

---

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