[3/9,v2] doc: Add elf32_getchdr.3 and elf64_getchdr.3

Message ID 20241003022610.129834-3-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 that SHF_COMPRESSED must be set.

Add elf_compress (3) to SEE ALSO.

Remove "This elfutils libelf function may not be
found in other libelf implementations".

On Tue, Aug 27, 2024 at 1:23 PM Mark Wielaard <mark@klomp.org> wrote:
>
> It should also mention what the Elf32_Chdr structure looks
> like and what the meaning the fields have. What the legal values of
> ch_type are, that ch_size is the uncompressed section data size, and
> that ch_addralign is the alignment of the uncompressed data.

I will include this information in the upcoming libelf man page.

 doc/elf32_getchdr.3 | 60 +++++++++++++++++++++++++++++++++++++++++++++
 doc/elf64_getchdr.3 |  1 +
 2 files changed, 61 insertions(+)
 create mode 100644 doc/elf32_getchdr.3
 create mode 100644 doc/elf64_getchdr.3
  

Comments

Mark Wielaard Oct. 15, 2024, 3:25 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 that SHF_COMPRESSED must be set.
> 
> Add elf_compress (3) to SEE ALSO.
> 
> Remove "This elfutils libelf function may not be
> found in other libelf implementations".
> 
> On Tue, Aug 27, 2024 at 1:23 PM Mark Wielaard <mark@klomp.org> wrote:
> > 
> > It should also mention what the Elf32_Chdr structure looks
> > like and what the meaning the fields have. What the legal values of
> > ch_type are, that ch_size is the uncompressed section data size, and
> > that ch_addralign is the alignment of the uncompressed data.
> 
> I will include this information in the upcoming libelf man page.

OK. Then this version of the man page looks good.

Thanks,

Mark

>  doc/elf32_getchdr.3 | 60 +++++++++++++++++++++++++++++++++++++++++++++
>  doc/elf64_getchdr.3 |  1 +
>  2 files changed, 61 insertions(+)
>  create mode 100644 doc/elf32_getchdr.3
>  create mode 100644 doc/elf64_getchdr.3
> 
> diff --git a/doc/elf32_getchdr.3 b/doc/elf32_getchdr.3
> new file mode 100644
> index 00000000..f7f35c96
> --- /dev/null
> +++ b/doc/elf32_getchdr.3
> @@ -0,0 +1,60 @@
> +.TH ELF32_GETCHDR 3 2024-08-14 "Libelf" "Libelf Programmer's Manual"
> +
> +.SH NAME
> +elf32_getchdr, elf64_getchdr \- retrieve the compression header for a
> +section from a 32-bit or 64-bit ELF object file.
> +
> +.SH SYNOPSIS
> +.nf
> +.B #include <libelf.h>
> +
> +.BI "Elf32_Chdr *elf32_getchdr(Elf_Scn *" scn ");"
> +.BI "Elf64_Chdr *elf64_getchdr(Elf_Scn *" scn ");"
> +
> +.SH DESCRIPTION
> +Retrieve the compression header for a section with compressed data.
> +Sections with compressed data are indicated with the
> +.B SHF_COMPRESSED
> +flag.  See
> +.BR libelf (3)
> +for more information regarding the compression header.
> +
> +.SH PARAMETERS
> +.TP
> +.I scn
> +Section whose compression header will be retrieved. The section's
> +.B SHF_COMPRESSED
> +flag must be set.
> +
> +.SH RETURN VALUE
> +On success, return a pointer to the compression header. On failure,
> +return NULL and set a libelf error code.
> +
> +.SH SEE ALSO
> +.BR elf_compress (3),
> +.BR elf_errno (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_getchdr (),
> +.BR elf64_getchdr ()
> +T}	Thread safety	MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.
> +
> +.SH HISTORY
> +.B elf32_getchdr
> +first appeared in elfutils 0.165.
> diff --git a/doc/elf64_getchdr.3 b/doc/elf64_getchdr.3
> new file mode 100644
> index 00000000..fa49616b
> --- /dev/null
> +++ b/doc/elf64_getchdr.3
> @@ -0,0 +1 @@
> +.so man3/elf32_getchdr.3
  

Patch

diff --git a/doc/elf32_getchdr.3 b/doc/elf32_getchdr.3
new file mode 100644
index 00000000..f7f35c96
--- /dev/null
+++ b/doc/elf32_getchdr.3
@@ -0,0 +1,60 @@ 
+.TH ELF32_GETCHDR 3 2024-08-14 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+elf32_getchdr, elf64_getchdr \- retrieve the compression header for a
+section from a 32-bit or 64-bit ELF object file.
+
+.SH SYNOPSIS
+.nf
+.B #include <libelf.h>
+
+.BI "Elf32_Chdr *elf32_getchdr(Elf_Scn *" scn ");"
+.BI "Elf64_Chdr *elf64_getchdr(Elf_Scn *" scn ");"
+
+.SH DESCRIPTION
+Retrieve the compression header for a section with compressed data.
+Sections with compressed data are indicated with the
+.B SHF_COMPRESSED
+flag.  See
+.BR libelf (3)
+for more information regarding the compression header.
+
+.SH PARAMETERS
+.TP
+.I scn
+Section whose compression header will be retrieved. The section's
+.B SHF_COMPRESSED
+flag must be set.
+
+.SH RETURN VALUE
+On success, return a pointer to the compression header. On failure,
+return NULL and set a libelf error code.
+
+.SH SEE ALSO
+.BR elf_compress (3),
+.BR elf_errno (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_getchdr (),
+.BR elf64_getchdr ()
+T}	Thread safety	MT-Safe
+.TE
+
+.SH REPORTING BUGS
+Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.
+
+.SH HISTORY
+.B elf32_getchdr
+first appeared in elfutils 0.165.
diff --git a/doc/elf64_getchdr.3 b/doc/elf64_getchdr.3
new file mode 100644
index 00000000..fa49616b
--- /dev/null
+++ b/doc/elf64_getchdr.3
@@ -0,0 +1 @@ 
+.so man3/elf32_getchdr.3