ELF\_NEXTSCN(3) Libelf Programmer's Manual ELF\_NEXTSCN(3)

# [NAME](#NAME)

elf\_nextscn - Return the next section in an ELF descriptor.

# [SYNOPSIS](#SYNOPSIS)

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

# [DESCRIPTION](#DESCRIPTION)

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](#PARAMETERS)

[*elf*](#elf)

A pointer to an ELF descriptor.

[*scn*](#scn)

A section handle returned by [**elf\_getscn**(3)](/man/os/elfutils/elf_getscn.3), or NULL to begin iteration.

# [RETURN VALUE](#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.

# [SEE ALSO](#SEE_ALSO)

[**elf\_getscn**(3)](/man/os/elfutils/elf_getscn.3), [**elf\_newscn**(3)](/man/os/elfutils/elf_newscn.3), [**libelf**(3)](/man/os/elfutils/libelf.3), [**elf**(5)](/man/os/elfutils/elf.5)

# [ATTRIBUTES](#ATTRIBUTES)

**Interface** **Attribute** **Value** elf\_nextscn () Thread safety MT-Safe

# [REPORTING BUGS](#REPORTING_BUGS)

Report bugs to &lt;elfutils-devel@sourceware.org&gt; or https://sourceware.org/bugzilla/.

2025-06-30 Libelf

---

Document: elf_nextscn(3) from elfutils 0.196-r1 (Chainguard OS)
Source: https://sourceware.org/git/elfutils.git
