Add man pages for gelf_getversym, gelf_getverdef, gelf_getverdaux gelf_getverneed and gelf_getvernaux.
Signed-off-by: Aaron Merey <[email protected]> --- v2 changes: Replace off_t with int in SYNOPSIS. On Fri, Oct 31, 2025 at 11:42 AM Mark Wielaard <[email protected]> wrote: > > +.SH SEE ALSO > > +.BR gelf_update_verdaux (3), > > +.BR gelf_update_verdef (3), > > +.BR gelf_update_vernaux (3), > > +.BR gelf_update_verneed (3), > > +.BR gelf_update_versym (3), > > +.BR libelf (3), > > +.BR elf (5) > > Where are GElf_Versym, GElf_Verdef, GElf_Verdaux and GElf_Verneed > described? I've added patch "doc: Update libelf.3 with gelf.h information" to this series. doc/Makefile.am | 5 ++ doc/gelf_getverdaux.3 | 1 + doc/gelf_getverdef.3 | 1 + doc/gelf_getvernaux.3 | 1 + doc/gelf_getverneed.3 | 1 + doc/gelf_getversym.3 | 146 ++++++++++++++++++++++++++++++++++++++++++ doc/libelf.3 | 5 +- 7 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 doc/gelf_getverdaux.3 create mode 100644 doc/gelf_getverdef.3 create mode 100644 doc/gelf_getvernaux.3 create mode 100644 doc/gelf_getverneed.3 create mode 100644 doc/gelf_getversym.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 8c44e20e..5e83d112 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -95,6 +95,11 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ gelf_getehdr.3 \ gelf_getrel.3 \ gelf_getrela.3 \ + gelf_getversym.3 \ + gelf_getverdef.3 \ + gelf_getverdaux.3 \ + gelf_getverneed.3 \ + gelf_getvernaux.3 \ gelf_getshdr.3 \ gelf_newehdr.3 \ gelf_newphdr.3 \ diff --git a/doc/gelf_getverdaux.3 b/doc/gelf_getverdaux.3 new file mode 100644 index 00000000..5b20eee5 --- /dev/null +++ b/doc/gelf_getverdaux.3 @@ -0,0 +1 @@ +.so man3/gelf_getversym.3 diff --git a/doc/gelf_getverdef.3 b/doc/gelf_getverdef.3 new file mode 100644 index 00000000..5b20eee5 --- /dev/null +++ b/doc/gelf_getverdef.3 @@ -0,0 +1 @@ +.so man3/gelf_getversym.3 diff --git a/doc/gelf_getvernaux.3 b/doc/gelf_getvernaux.3 new file mode 100644 index 00000000..5b20eee5 --- /dev/null +++ b/doc/gelf_getvernaux.3 @@ -0,0 +1 @@ +.so man3/gelf_getversym.3 diff --git a/doc/gelf_getverneed.3 b/doc/gelf_getverneed.3 new file mode 100644 index 00000000..5b20eee5 --- /dev/null +++ b/doc/gelf_getverneed.3 @@ -0,0 +1 @@ +.so man3/gelf_getversym.3 diff --git a/doc/gelf_getversym.3 b/doc/gelf_getversym.3 new file mode 100644 index 00000000..f3a14112 --- /dev/null +++ b/doc/gelf_getversym.3 @@ -0,0 +1,146 @@ +.TH GELF_GETVERSYM 3 2025-09-27 "Libelf" "Libelf Programmer's Manual" + +.SH NAME +gelf_getversym, gelf_getverdef, gelf_getverdaux, gelf_getverneed, gelf_getvernaux \- retrieve GNU symbol versioning entries + +.SH SYNOPSIS +.nf +.B #include <gelf.h> + +.BI "GElf_Versym *gelf_getversym (Elf_Data *" data ", int " ndx ", GElf_Versym *" dst ");" +.BI "GElf_Verdef *gelf_getverdef (Elf_Data *" data ", int " offset ", GElf_Verdef *" dst ");" +.BI "GElf_Verdaux *gelf_getverdaux(Elf_Data *" data ", int " offset ", GElf_Verdaux *" dst ");" +.BI "GElf_Verneed *gelf_getverneed(Elf_Data *" data ", int " offset ", GElf_Verneed *" dst ");" +.BI "GElf_Vernaux *gelf_getvernaux(Elf_Data *" data ", int " offset ", GElf_Vernaux *" dst ");" +.fi + +.SH DESCRIPTION +These functions provide class\-independent access to GNU ELF symbol +version information. The requested entry is retrieved from +.I data +and stored in the caller\-supplied +.IR dst . + +.TP +.BR gelf_getversym () +Retrieves the symbol version index at index +.I ndx +from the +.B SHT_GNU_versym +section associated with +.IR data . + +.TP +.BR gelf_getverdef () +Retrieves the version definition entry at section offset +.I offset +from the +.B SHT_GNU_verdef +section associated with +.IR data . + +.TP +.BR gelf_getverdaux () +Retrieves the version definition auxiliary entry at section offset +.I offset +from the +.B SHT_GNU_verdef +section associated with +.IR data . + +.TP +.BR gelf_getverneed () +Retrieves the version needed entry at section offset +.I offset +from the +.B SHT_GNU_verneed +section associated with +.IR data . + +.TP +.BR gelf_getvernaux () +Retrieves the version needed auxiliary entry at section offset +.I offset +from the +.B SHT_GNU_verneed +section associated with +.IR data . + +.SH PARAMETERS +.TP +.I data +Pointer to an +.B Elf_Data +corresponding to the appropriate GNU versioning section. + +.TP +.I ndx +(For +.BR gelf_getversym () +only.) +Zero\-based index of the entry within +.IR data . +.TP +.I offset +(For +.BR gelf_getverdef (), +.BR gelf_getverdaux (), +.BR gelf_getverneed (), +and +.BR gelf_getvernaux ().) +Section\-relative byte offset of the entry within +.IR data . + +.TP +.I dst +Pointer to a caller\-provided entry of the appropriate type: +.BR GElf_Versym , +.BR GElf_Verdef , +.BR GElf_Verdaux , +.BR GElf_Verneed , +or +.BR GElf_Vernaux . +This argument must not be NULL. + +.SH RETURN VALUE +On success, these functions store the requested entry in +.I dst +and return +.IR dst . +On failure, these functions return NULL and set elf_errno. If +.I data +is NULL, then NULL is returned without setting elf_errno. + +.SH SEE ALSO +.BR gelf_update_verdaux (3), +.BR gelf_update_verdef (3), +.BR gelf_update_vernaux (3), +.BR gelf_update_verneed (3), +.BR gelf_update_versym (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_getversym (), +.br +.BR gelf_getverdef (), +.br +.BR gelf_getverdaux(), +.br +.BR gelf_getverneed (), +.br +.BR gelf_getvernaux () +T} Thread safety MT-Safe +.TE + +.SH REPORTING BUGS +Report bugs to <[email protected]> or https://sourceware.org/bugzilla/. diff --git a/doc/libelf.3 b/doc/libelf.3 index b64e285b..9e29870d 100644 --- a/doc/libelf.3 +++ b/doc/libelf.3 @@ -379,7 +379,7 @@ the class of an ELF binary. Note that if an ELF binary has class .BR ELFCLASS32 , -then any +then any .B GElf_* values and struct fields should be able to fit into the corresponding ELFCLASS32 values and struct fields. For example, a @@ -405,8 +405,7 @@ Types that represent class-independent data for ELF files. .TP .B GELF_ -Class independent macros for manipulating particular GElf struct fields -(see below). +Class-independent macros for manipulating particular GElf struct fields. .fi .PD -- 2.51.1
