ELF64_OFFSCN(3)
β¨ ELF64_OFFSCN(3) β¨
okay bestie, this is a page from the Libelf Programmer's Manual, and it's all about elf64_offscn β the function that gets you a section descriptor by file offset for a 64-bit ELF file. yes it's niche. yes it's iconic. let's go π
πΈ NAME πΈ
elf64_offscn β retrieve a section descriptor by file offset for a 64-bit ELF file π¦
π SYNOPSIS π
#include <libelf.h>
Elf_Scn *elf64_offscn(Elf *elf, off_t offset);
π DESCRIPTION π
okay so here's the tea: elf64_offscn retrieves the section descriptor for the non-empty section sitting at the specified file offset in the ELF64 object that elf points at. that's it, that's the whole vibe. you give it an offset, it gives you the section. main character energy fr fr β¨
π«Ά PARAMETERS π«Ά
elfβ anElfpointer to the ELF object you wanna pull the section descriptor out of. that's your target, bestie π―offsetβ anoff_tvalue, and it represents the file offset of the section whose descriptor you're trying to get. the exact spot, no cap π
β RETURN VALUE β
elf64_offscn returns a pointer to the Elf_Scn of the non-empty section whose sh_offset matches offset. slay. π
but if something goes wrong? it returns NULL and sets an appropriate libelf error code. so like, always check. don't be out here dereferencing NULL and acting surprised π
π ATTRIBUTES π
for an explanation of the terms used in this section, see attributes(7). (that's the standard disclaimer, not me being shady π)
here's the rundown:
- Interface:
elf64_offscn()- Attribute: Thread safety
- Value: MT-Safe β
so yeah, it's MT-Safe, she's safe to use across threads, we love a low-drama queen π
π SEE ALSO π
(the 32-bit sibling is right there if you need her π«Ά)
π REPORTING BUGS π
found a bug? don't suffer in silence, tell the devs:
- report bugs to
<elfutils-devel@sourceware.org> - or hit up
https://sourceware.org/bugzilla/
they wanna know, fr fr π
π§ HISTORY π§
elf64_offscn first appeared in elfutils 0.112. glow-up timeline, honestly π±β¨
β οΈ also important: this is an elfutils libelf function, so it may not be found in other libelf implementations. don't go assuming every libelf out there has her, because she's kind of exclusive π
and that's the whole page, bestie!! this was written for the Libelf manual, dated 2024-07-18, and it's giving elfutils 0.112 realness. go forth and find your 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