gelf_getphdr(3)

gelf_getphdr3

Retrieve class-independent program header table entries for an elf object file

Usage

#include <gelf.h>
GElf_Phdr *gelf_getphdr (Elf *elf, int ndx, GElf_Phdr *dst);

Overview

Retrieve the class-independent program header table entry at index ndx for ELF descriptor elf and store it in dst. See elf_getphdrnum(3) for information on how to acquire the number of entries in the program header table.

Parameters

elf

ELF descriptor of kind ELF_K_ELF from which to retrieve the program header table entry.

ndx

The index of the program header table entry to be retrieved.

dst

Pointer to a caller-provided GElf_Phdr that will receive the requested program header table entry.

Return value

On success, the requested entry is copied into dst and dst is returned. On failure, NULL is returned and elf_errno is set. If elf is NULL, then NULL is returned and elf_errno is not set.

Attributes

InterfaceAttributeValue
gelf_getphdr()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.