gelf_update_shdr(3)

gelf_update_shdr3

Copy a class-independent section header into a section descriptor

Usage

#include <gelf.h>
int gelf_update_shdr(Elf_Scn *scn, GElf_Shdr *src);

Overview

gelf_update_shdr() copies the class-independent section header referenced by src into the section descriptor scn. The section header is translated as necessary to match the class ( ELFCLASS32 or ELFCLASS64) of the underlying ELF object. If the underlying ELF object has class ELFCLASS32 then the struct members of src must fit into 32-bit field values.

Parameters

scn

Pointer to a section descriptor of type Elf_Scn.

src

Pointer to a GElf_Shdr structure containing the caller’s desired section header contents.

Return value

On success, gelf_update_shdr() returns a non-zero value and marks scn with the ELF_F_DIRTY flag. On failure, this function returns 0 and elf_errno is set. If scn or src are NULL, then 0 is returned without setting elf_errno.

Attributes

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