ELF32\_OFFSCN(3) Libelf Programmer's Manual ELF32\_OFFSCN(3)

# [NAME](#NAME)

elf32\_offscn - retrieve a section descriptor by file offset for a 32-bit ELF file

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;libelf.h&gt;**

**Elf\_Scn \*elf32\_offscn(Elf \*elf, off\_t offset);**

# [DESCRIPTION](#DESCRIPTION)

The **elf32\_offscn** function retrieves the section descriptor for the non-empty section at the specified file offset in the ELF32 object referred to by *elf.*

# [PARAMETERS](#PARAMETERS)

[*elf*](#elf)

An *Elf pointer to the ELF object from which the section descriptor is to be retrieved.*

[*offset*](#offset)

An *off\_t* value representing the file offset of the section whose descriptor is to be retrieved.

# [RETURN VALUE](#RETURN_VALUE)

The **elf32\_offscn** function returns a pointer to the *Elf\_Scn* of the non-empty section with a sh\_offset matching *offset.* If an error occurs, it returns NULL and sets an appropriate libelf error code.

# [ATTRIBUTES](#ATTRIBUTES)

For an explanation of the terms used in this section, see [**attributes**(7)](/man/os/elfutils/attributes.7).

**Interface** **Attribute** **Value** elf32\_offscn () Thread safety MT-Safe

# [SEE ALSO](#SEE_ALSO)

[**elf64\_offscn**(3)](/man/os/elfutils/elf64_offscn.3), [**libelf**(3)](/man/os/elfutils/libelf.3), [**elf**(5)](/man/os/elfutils/elf.5),

# [REPORTING BUGS](#REPORTING_BUGS)

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

# [HISTORY](#HISTORY)

**elf32\_offscn** first appeared in elfutils 0.112. This elfutils libelf function may not be found in other libelf implementations.

2024-07-18 Libelf

---

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