From: Aaron Merey Date: Tue, 28 Oct 2025 22:16:49 +0000 (-0400) Subject: doc: Add gelf_offscn.3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c4ffaa2515c0bffff8a47752671c47e300eb6db;p=thirdparty%2Felfutils.git doc: Add gelf_offscn.3 Signed-off-by: Aaron Merey --- diff --git a/doc/Makefile.am b/doc/Makefile.am index 5ee5c38b..d8bbca55 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_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 index 00000000..76eb7028 --- /dev/null +++ b/doc/gelf_offscn.3 @@ -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 + +.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 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.