gelf_getehdr - Man Page
retrieve the header of an ELF binary as a class-independent structure
Synopsis
#include <gelf.h> GElf_Ehdr *gelf_getehdr(Elf *elf, GElf_Ehdr *dest );
Description
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.
See Also
Attributes
| Interface | Attribute | Value |
|---|---|---|
| gelf_getehdr() | Thread safety | MT-Safe |
Reporting Bugs
Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.
Referenced By
2025-09-14 Libelf Programmer's Manual