gelf_getehdr(3)

gelf_getehdr3

Retrieve the header of an elf binary as a class-independent structure

Usage

#include <gelf.h>
GElf_Ehdr *gelf_getehdr(Elf *elf, GElf_Ehdr *dest );

Overview

gelf_getehdr() retrieve the ELF header of the binary referenced by elf as a class-independent GElf_Ehdr representation.

Parameters

elf

Pointer to an ELF descriptor.

dest

Pointer to a caller-provided GElf_Ehdr structure that will receive the translated file header. Must not be NULL. On success, the function stores the header in *dest.

Return value

On success, returns dest. On failure, returns NULL and sets elf_errno. If elf is NULL, NULL is returned and elf_errno is not set.

Attributes

InterfaceAttributeValue
gelf_getehdr()Thread safetyMT-Safe

Reporting bugs

Report bugs to <[email protected]> or https://sourceware.org/bugzilla/.

From libelf 0.197-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.