gelf_getshdr(3)

gelf_getshdr3

Retrieve a section header into a class-independent structure

Usage

#include <gelf.h>
GElf_Shdr *gelf_getshdr(Elf_Scn *scn, GElf_Shdr *dst);

Overview

gelf_getshdr() retrieves the section header associated with the section descriptor scn, translating it into the class-independent GElf_Shdr representation. The header is copied into the structure referenced by dst.

Parameters

scn

Pointer to a section descriptor of type Elf_Scn.

dst

Pointer to a caller-provided GElf_Shdr structure to receive the section header.

Return value

On success, gelf_getshdr() stores the section header in dst and returns dst. On failure, NULL is returned and elf_errno is set. If scn is NULL then NULL is returned without setting elf_errno.

Attributes

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