elf_nextscn(3)

elf_nextscn3

Return the next section in an elf descriptor.

Usage

#include <libelf.h>
Elf_Scn *elf_nextscn(Elf *elf, Elf_Scn *scn);

Overview

The elf_nextscn() function returns a handle to the next section in the ELF object descriptor elf. If scn is NULL, the first section (with index 1) is returned. Section index 0 is reserved and skipped.

If scn is not NULL, the section immediately following it is returned. If there are no further sections, NULL is returned.

Parameters

elf

A pointer to an ELF descriptor.

scn

A section handle returned by elf_getscn(3), or NULL to begin iteration.

Return value

Returns a pointer to the next Elf_Scn structure in the section list, or NULL if there are no more sections or if elf is NULL.

Attributes

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