Scroll to navigation

GELF_GETSHDR(3) Libelf Programmer's Manual GELF_GETSHDR(3)

NAME

gelf_getshdr - retrieve a section header into a class-independent structure

SYNOPSIS

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

DESCRIPTION

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

Pointer to a section descriptor of type Elf_Scn.

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.

SEE ALSO

elf32_getshdr(3), elf64_getshdr(3), gelf_update_shdr(3), libelf(3), elf(5)

ATTRIBUTES

Interface Attribute Value
gelf_getshdr () Thread safety MT-Safe

REPORTING BUGS

Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.

2025-09-22 Libelf