ELF32_OFFSCN(3)
π ELF32_OFFSCN(3) π
okay bestie, welcome to the Libelf Programmer's Manual β this one's elf32_offscn, and she's lowkey a little icon. let's get into it π¦
β¨ NAME β¨
elf32_offscn β grab yourself a section descriptor by file offset, specifically for a 32-bit ELF file. yes queen, offset-based lookup, we love to see it π
πΈ SYNOPSIS πΈ
#include <libelf.h>
Elf_Scn *elf32_offscn(Elf *elf, off_t offset);
π DESCRIPTION π
so the elf32_offscn function retrieves the section descriptor for the non-empty section at the specified file offset, inside the ELF32 object that elf points at. that's it, that's the job, and she does it flawlessly β¨
not me emphasizing non-empty β bestie, it literally only cares about non-empty sections. if it's empty, she's not looking at it, periodt π
π«Ά PARAMETERS π«Ά
elfβ anElfpointer to the ELF object you wanna pull the section descriptor out of. that's your girl, that's who we're working with πoffsetβ anoff_tvalue, and it represents the file offset of the section whose descriptor you're trying to retrieve. so like, the coordinates of the section you want π
π RETURN VALUE π
elf32_offscn returns a pointer to the Elf_Scn of the non-empty section whose sh_offset matches offset. matching, slaying, iconic π
but if an error happens? it returns NULL and sets an appropriate libelf error code. so like, check your return value, bestie, don't just assume π
π ATTRIBUTES π
for an explanation of the terms used in this section, go peek at attributes(7).
- Interface:
elf32_offscn() - Attribute: Thread safety
- Value: MT-Safe
MT-Safe meaning she's totally fine being called from multiple threads. main character energy that plays well with others π§
β SEE ALSO β
go read those too, iykyk π
π REPORTING BUGS π
found a bug? don't be shy, report it to <elfutils-devel@sourceware.org> or hit up https://sourceware.org/bugzilla/. we do NOT gatekeep problems here π«Ά
π HISTORY π
elf32_offscn first appeared in elfutils 0.112. and important tea: this elfutils libelf function may not be found in other libelf implementations. so like, don't assume every libelf out there has her β check first, fr fr π
and that's the whole page, bestie! this one came from the Libelf manual, dated 2024-07-18 β mwah, sending you off with a kiss, go slay some ELF sections πβ¨π
π¦ where this page comes from
- alpine 3.22: elfutils-doc 0.193-r0 Β· GPL-3.0-or-later AND ( GPL-2.0-or-later OR LGPL-3.0-or-later )
- alpine 3.23: elfutils-doc 0.194-r0 Β· GPL-3.0-or-later AND ( GPL-2.0-or-later OR LGPL-3.0-or-later )
- alpine 3.24: elfutils-doc 0.195-r0 Β· GPL-3.0-or-later AND ( GPL-2.0-or-later OR LGPL-3.0-or-later )
- arch rolling: libelf 0.196-1
- arch rolling: libelf 0.197-1 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- centos-stream 10: elfutils-libelf-devel 0.197-1.el10 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- centos-stream 9: elfutils-libelf-devel 0.197-1.el9 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- centos-stream 9: elfutils-libelf-devel 0.197-1.el9 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- debian trixie: libelf-dev 0.192-4 Β· GPL-3.0-or-later
- fedora 43: elfutils-libelf-devel 0.193-3.fc43 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 43: elfutils-libelf-devel 0.193-3.fc43 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 43: elfutils-libelf-devel 0.196-1.fc43
- fedora 43: elfutils-libelf-devel 0.196-1.fc43
- fedora 43: elfutils-libelf-devel 0.197-1.fc43 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 43: elfutils-libelf-devel 0.197-1.fc43 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 44: elfutils-libelf-devel 0.194-5.fc44 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 44: elfutils-libelf-devel 0.194-5.fc44 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 44: elfutils-libelf-devel 0.196-1.fc44
- fedora 44: elfutils-libelf-devel 0.196-1.fc44
- fedora 44: elfutils-libelf-devel 0.197-1.fc44 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 44: elfutils-libelf-devel 0.197-1.fc44 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- nixos 26.05: elfutils 0.194
- nixpkgs unstable: elfutils 0.195
- opensuse-leap 16.0: libelf-devel 0.192-160000.3.1 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- opensuse-leap 16.0: libelf-devel 0.192-160000.3.1 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- opensuse-leap 16.0: libelf-devel 0.192-160000.3.1 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- opensuse-leap 16.0: libelf-devel 0.192-160000.3.1 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- ubuntu questing: libelf-dev 0.193-1
- ubuntu resolute: libelf-dev 0.194-4 Β· GPL-3.0-or-later
- ubuntu stonking: libelf-dev 0.196-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms