Signed-off-by: Aaron Merey <[email protected]>
---
 doc/Makefile.am   |  1 +
 doc/gelf_offscn.3 | 66 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
 create mode 100644 doc/gelf_offscn.3

diff --git a/doc/Makefile.am b/doc/Makefile.am
index bc0ade8a..e8d4c0a6 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -94,6 +94,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \
                        gelf_getclass.3 \
                        gelf_getehdr.3 \
                        gelf_newehdr.3 \
+                       gelf_offscn.3 \
                        gelf_update_ehdr.3 \
                        libelf.3
 
diff --git a/doc/gelf_offscn.3 b/doc/gelf_offscn.3
new file mode 100644
index 00000000..628e83df
--- /dev/null
+++ b/doc/gelf_offscn.3
@@ -0,0 +1,66 @@
+.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
+.B gelf_offscn()
+retrieves the section descriptor for the non-empty section at the specified
+file offset in the ELF object referred to by
+.IR elf .
+
+.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 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 <[email protected]> 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.
-- 
2.51.0

Reply via email to