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

index 3c22f0aa00e268c46688eff92495c030dde94995..5ee5c38b328dd1984cd9df36f2fce7308c16c7b8 100644 (file)
@@ -93,6 +93,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \
                        elf_version.3 \
                        gelf_getclass.3 \
                        gelf_getehdr.3 \
+                       gelf_getshdr.3 \
                        libelf.3
 
 # libdebuginfod man pages (also notrans)
diff --git a/doc/gelf_getshdr.3 b/doc/gelf_getshdr.3
new file mode 100644 (file)
index 0000000..033f5dc
--- /dev/null
@@ -0,0 +1,66 @@
+.TH GELF_GETSHDR 3 2025-09-22 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+gelf_getshdr \- retrieve a section header into a class\-independent structure
+
+.SH SYNOPSIS
+.nf
+.B #include <gelf.h>
+
+.BI "GElf_Shdr *gelf_getshdr(Elf_Scn *" scn ", GElf_Shdr *" dst ");"
+.fi
+
+.SH DESCRIPTION
+.BR gelf_getshdr ()
+retrieves the section header associated with the section descriptor
+.IR scn ,
+translating it into the class\-independent
+.B GElf_Shdr
+representation. The header is copied into the structure referenced by
+.IR dst .
+
+.SH PARAMETERS
+.TP
+.I scn
+Pointer to a section descriptor of type
+.BR Elf_Scn .
+
+.TP
+.I dst
+Pointer to a caller\-provided
+.B GElf_Shdr
+structure to receive the section header.
+
+.SH RETURN VALUE
+On success,
+.B gelf_getshdr()
+stores the section header in
+.I dst
+and returns
+.IR dst .
+On failure, NULL is returned and elf_errno is set.  If
+.I scn
+is NULL then NULL is returned without setting elf_errno.
+
+.SH SEE ALSO
+.BR elf32_getshdr (3),
+.BR elf64_getshdr (3),
+.BR gelf_update_shdr (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_getshdr ()
+T}     Thread safety   MT-Safe
+.TE
+
+.SH REPORTING BUGS
+Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.