]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
doc: Add gelf_offscn.3
authorAaron Merey <amerey@redhat.com>
Tue, 28 Oct 2025 22:16:49 +0000 (18:16 -0400)
committerAaron Merey <amerey@redhat.com>
Tue, 28 Oct 2025 22:16:49 +0000 (18:16 -0400)
Signed-off-by: Aaron Merey <amerey@redhat.com>
doc/Makefile.am
doc/gelf_offscn.3 [new file with mode: 0644]

index 5ee5c38b328dd1984cd9df36f2fce7308c16c7b8..d8bbca5527c9be644d16af9126f8ae2996649467 100644 (file)
@@ -94,6 +94,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \
                        gelf_getclass.3 \
                        gelf_getehdr.3 \
                        gelf_getshdr.3 \
+                       gelf_offscn.3 \
                        libelf.3
 
 # libdebuginfod man pages (also notrans)
diff --git a/doc/gelf_offscn.3 b/doc/gelf_offscn.3
new file mode 100644 (file)
index 0000000..76eb702
--- /dev/null
@@ -0,0 +1,72 @@
+.TH GELF_OFFSCN 3 2025-09-22 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+gelf_offscn \- return descriptor for an ELF section at a given file offset
+
+.SH SYNOPSIS
+.nf
+.B #include <gelf.h>
+
+.BI "Elf_Scn *gelf_offscn(Elf *" elf ", GElf_Off " offset ");"
+.fi
+
+.SH DESCRIPTION
+.BR gelf_offscn ()
+retrieves the section descriptor for the non-empty section with
+.B sh_offset
+equal to
+.IR offset .
+This function will not return descriptors for
+.B SHT_NOBITS
+sections since they are empty by definition.
+
+.SH PARAMETERS
+.TP
+.I elf
+Pointer to an ELF descriptor with kind
+.BR ELF_K_ELF .
+
+.TP
+.I offset
+The file offset (in bytes) of the section to be retrieved.
+
+.SH RETURN VALUE
+On success,
+.BR gelf_offscn ()
+returns a pointer to the
+.I Elf_Scn
+of the non-empty section with a sh_offset matching
+.IR offset .
+
+On failure,
+.B NULL
+is returned and elf_errno is set to indicate the error.  If
+.I elf
+is NULL, then NULL is returned without setting elf_errno.
+
+.SH SEE ALSO
+.BR elf32_offscn (3),
+.BR elf64_offscn (3),
+.BR libelf (3),
+.BR elf (5)
+
+.SH ATTRIBUTES
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface      Attribute       Value
+T{
+.na
+.nh
+.BR gelf_offscn ()
+T}     Thread safety   MT-Safe
+.TE
+
+.SH REPORTING BUGS
+Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.
+
+HISTORY
+.B gelf_offscn
+first appeared in elfutils 0.112. This elfutils libelf function may not be
+found in other libelf implementations.