[5/9,v2] doc: Add elf32_getshdr.3 and elf64_getshdr.3

Message ID 20241003022610.129834-5-amerey@redhat.com
State Committed
Headers
Series [1/9,v2] doc: Add elf32_checksum.3 and elf64_checksum.3 |

Commit Message

Aaron Merey Oct. 3, 2024, 2:26 a.m. UTC
  Signed-off-by: Aaron Merey <amerey@redhat.com>
---

v2 changes:
Mention elf_flagshdr.

Mention NULL is returned if scn is NULL.

 doc/elf32_getshdr.3 | 59 +++++++++++++++++++++++++++++++++++++++++++++
 doc/elf64_getshdr.3 |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 doc/elf32_getshdr.3
 create mode 100644 doc/elf64_getshdr.3
  

Comments

Mark Wielaard Oct. 15, 2024, 3:36 p.m. UTC | #1
Hi Aaron,

On Wed, 2024-10-02 at 22:26 -0400, Aaron Merey wrote:
> Signed-off-by: Aaron Merey <amerey@redhat.com>
> ---
> 
> v2 changes:
> Mention elf_flagshdr.
> 
> Mention NULL is returned if scn is NULL.

This version looks good to me.

Thanks,

Mark
  

Patch

diff --git a/doc/elf32_getshdr.3 b/doc/elf32_getshdr.3
new file mode 100644
index 00000000..abc8aaeb
--- /dev/null
+++ b/doc/elf32_getshdr.3
@@ -0,0 +1,59 @@ 
+.TH ELF32_GETSHDR 3 2024-08-14 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+elf32_getshdr, elf64_getshdr \- retrieve the section header for a section
+in 32-bit or 64-bit ELF object file
+
+.SH SYNOPSIS
+.nf
+.B #include <libelf.h>
+
+.BI "Elf32_Shdr *elf32_getshdr(Elf_Scn *" scn ");"
+.BI "Elf64_Shdr *elf64_getshdr(Elf_Scn *" scn ");"
+
+.SH DESCRIPTION
+Retrieve the section header for the section referred to by
+.IR scn .
+If the retrieved section header is modified,
+.B elf_flagshdr
+must be called
+with
+.B ELF_C_SET
+and
+.B ELF_F_DIRTY
+in order to write the modified section header to disk.
+
+.SH PARAMETERS
+.TP
+.I scn
+The section descriptor whose section header is to be retrieved.
+
+.SH RETURN VALUE
+On success, return a pointer to the section header.  If scn is NULL then
+NULL will be returned.  If an error occurs, return NULL and set a libelf
+error code.
+
+.SH SEE ALSO
+.BR elf_errno (3),
+.BR elf_flagshdr (3),
+.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 elf32_getshdr (),
+.BR elf64_getshdr ()
+T}	Thread safety	MT-Safe
+.TE
+
+.SH REPORTING BUGS
+Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.
diff --git a/doc/elf64_getshdr.3 b/doc/elf64_getshdr.3
new file mode 100644
index 00000000..c0d2410c
--- /dev/null
+++ b/doc/elf64_getshdr.3
@@ -0,0 +1 @@ 
+.so man3/elf32_getshdr.3