Add man pages for some libelf functions
Commit Message
Add man pages for elf32_offscn.3, elf64_offscn.3, elf_getscn.3 and
elf_ndxscn.3.
Signed-off-by: Aaron Merey <amerey@redhat.com>
---
doc/elf32_offscn.3 | 61 +++++++++++++++++++++++++++++++++++++++++++++
doc/elf64_offscn.3 | 62 ++++++++++++++++++++++++++++++++++++++++++++++
doc/elf_getscn.3 | 55 ++++++++++++++++++++++++++++++++++++++++
doc/elf_ndxscn.3 | 52 ++++++++++++++++++++++++++++++++++++++
4 files changed, 230 insertions(+)
create mode 100644 doc/elf32_offscn.3
create mode 100644 doc/elf64_offscn.3
create mode 100644 doc/elf_getscn.3
create mode 100644 doc/elf_ndxscn.3
new file mode 100644
@@ -0,0 +1,61 @@
+.TH ELF32_OFFSCN 3 2024-07-18 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+elf32_offscn \- retrieve a section descriptor by file offset for a 32-bit ELF file
+
+.SH SYNOPSIS
+.B #include <libelf.h>
+
+.BI "Elf_Scn *elf32_offscn(Elf *" elf ", off_t " offset ");"
+
+.SH DESCRIPTION
+The
+.B elf32_offscn
+function retrieves the section descriptor for the section at the specified file offset in the ELF32 object referred to by
+.I elf.
+
+.SH PARAMETERS
+.TP
+.I elf
+An
+.I Elf pointer to the ELF object from which the section descriptor is to be retrieved.
+
+.TP
+.I offset
+An
+.I off_t
+value representing the file offset of the section whose descriptor is to be retrieved.
+
+.SH RETURN VALUE
+The
+.B elf32_offscn
+function returns a pointer to the
+.I Elf_Scn
+for the section at the specified offset. If an error occurs, it returns NULL and sets an appropriate libelf error code.
+
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface Attribute Value
+T{
+.na
+.nh
+.BR elf32_offscn ()
+T} Thread safety MT-Safe
+.TE
+
+.SH SEE ALSO
+.BR elf64_offscn (3),
+.BR libelf (3),
+.BR elf (5),
+
+.SH REPORTING BUGS
+Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.
+
+.SH HISTORY
+.B elf32_offscn
+first appeared in elfutils 0.112.
new file mode 100644
@@ -0,0 +1,62 @@
+.TH ELF64_OFFSCN 3 2024-07-18 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+elf64_offscn \- retrieve a section descriptor by file offset for a 64-bit ELF file
+
+.SH SYNOPSIS
+.B #include <libelf.h>
+
+.BI "Elf_Scn *elf64_offscn(Elf *" elf ", off_t " offset ");"
+
+.SH DESCRIPTION
+The
+.B elf64_offscn
+function retrieves the section descriptor for the section at the specified file offset in the ELF64 object referred to by
+.I elf.
+
+.SH PARAMETERS
+.TP
+.I elf
+An
+.I Elf
+pointer to the ELF object from which the section descriptor is to be retrieved.
+
+.TP
+.I offset
+An
+.I off_t
+value representing the file offset of the section whose descriptor is to be retrieved.
+
+.SH RETURN VALUE
+The
+.B elf64_offscn
+function returns a pointer to the
+.I Elf_Scn
+for the section at the specified offset. If an error occurs, it returns NULL and sets an appropriate libelf error code.
+
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface Attribute Value
+T{
+.na
+.nh
+.BR elf64_offscn ()
+T} Thread safety MT-Safe
+.TE
+
+.SH SEE ALSO
+.BR elf32_offscn (3),
+.BR libelf (3),
+.BR elf (5),
+
+.SH REPORTING BUGS
+Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.
+
+.SH HISTORY
+.B elf64_offscn
+first appeared in elfutils 0.112.
new file mode 100644
@@ -0,0 +1,55 @@
+.TH ELF_GETSCN 3 2024-07-18 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+elf_getscn \- retrieve a descriptor for an ELF section at a specified index.
+
+.SH SYNOPSIS
+.B #include <libelf.h>
+
+.BI "Elf_Scn *elf_getscn(Elf *" elf ", size_t " index ");"
+
+.SH DESCRIPTION
+The .B elf_getscn function retrieves a section descriptor for the section at the specified index in the ELF object referred to by .I elf.
+
+.SH PARAMETERS
+.TP
+.I elf
+An
+.I Elf
+pointer to the ELF object from which the section descriptor is to be retrieved.
+
+.TP
+.I index
+A
+.I size_t
+value representing the index of the section whose descriptor is to be retrieved. Section indices start at 0.
+
+.SH RETURN VALUE
+The
+.B elf_getscn
+function returns a pointer to the
+.I Elf_Scn
+for the section at the specified index. If an error occurs, it returns NULL and sets an appropriate libelf error code.
+
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface Attribute Value
+T{
+.na
+.nh
+.BR elf_getscn ()
+T} Thread safety MT-Safe
+.TE
+
+.SH SEE ALSO
+.BR elf_errno (3),
+.BR libelf (3),
+.BR elf (5)
+
+.SH REPORTING BUGS
+Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.
new file mode 100644
@@ -0,0 +1,52 @@
+.TH ELF_NDXSCN 3 2024-07-18 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+elf_ndxscn \- retrieve the index of a descriptor for an ELF file section
+
+.SH SYNOPSIS
+.B #include <libelf.h>
+
+.BI "size_t elf_ndxscn(Elf_Scn *" scn ");"
+
+.SH DESCRIPTION
+The
+.B elf_ndxscn
+function retrieves the index of the section descriptor referred to by
+.I scn.
+
+.SH PARAMETERS
+.TP
+.I scn
+An
+.I Elf_Scn
+pointer to the section descriptor whose index is to be retrieved.
+
+.SH RETURN VALUE
+The
+.B elf_ndxscn
+function returns the index of the section descriptor. If
+.I scn
+is NULL, it returns
+.B SHN_UNDEF.
+
+.SH SEE ALSO
+.BR libelf (3),
+.BR elf (5)
+
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface Attribute Value
+T{
+.na
+.nh
+.BR elf_ndxscn ()
+T} Thread safety MT-Safe
+.TE
+
+.SH REPORTING BUGS
+Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.