elf64_getehdr(3)

elf64_getehdr3

Retrieve the elf header for a 64-bit elf descriptor

Usage

#include <libelf.h>
Elf64_Ehdr *elf64_getehdr(Elf *elf);

Overview

elf64_getehdr retrieves the ELF header for the given 64-bit ELF descriptor elf. The ELF header contains crucial metadata about the ELF file, such as the type, machine, version, entry point, program header table offset, and section header table offset. See elf(5) for more information regarding the ELF header.

Parameters

elf

Pointer to the ELF descriptor from which to retrieve the ELF header.

Return value

On success, elf64_getehdr returns a pointer to the Elf64_Ehdr structure. If the ELF descriptor is invalid or not a 64-bit ELF, it returns NULL and sets an error code retrievable by elf_errno(3).

Releases

Unchanged in 2 releases since Debian 13 (Trixie).

  1. 13–Arch

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.