Hi Aaron,
On Wed, 2025-12-31 at 21:50 -0500, Aaron Merey wrote:
> Signed-off-by: Aaron Merey <[email protected]>
> ---
> doc/Makefile.am | 1 +
> doc/gelf_getauxv.3 | 101 +++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 102 insertions(+)
> create mode 100644 doc/gelf_getauxv.3
>
> diff --git a/doc/Makefile.am b/doc/Makefile.am
> index 4292dcba..fbcc6a8b 100644
> --- a/doc/Makefile.am
> +++ b/doc/Makefile.am
> @@ -92,6 +92,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \
> elf_update.3 \
> elf_version.3 \
> gelf_fsize.3 \
> + gelf_getauxv.3 \
> gelf_getchdr.3 \
> gelf_getclass.3 \
> gelf_getdyn.3 \
OK.
> diff --git a/doc/gelf_getauxv.3 b/doc/gelf_getauxv.3
> new file mode 100644
> index 00000000..0b733e28
> --- /dev/null
> +++ b/doc/gelf_getauxv.3
> @@ -0,0 +1,101 @@
> +.TH GELF_GETAUXV 3 2025-12-31 "Libelf" "Libelf Programmer's Manual"
> +
> +.SH NAME
> +gelf_getauxv \- Get class\-independent information from auxiliary vector at
> the given index
> +
> +.SH SYNOPSIS
> +.nf
> +.B #include <gelf.h>
> +
> +.BI "GElf_auxv_t *gelf_getauxv (Elf_Data *" data ", int " ndx ", GElf_auxv_t
> *" dst ");"
OK.
> +.SH DESCRIPTION
> +Retrieve an auxiliary vector entry from
> +.I data
> +at index
> +.I ndx
> +and store it in the class\-independent representation pointed to by
> +.IR dst .
> +
> +.PP
> +.I data
> +must be an
> +.B Elf_Data*
> +associated with an ELF note of type
> +.BR NT_AUXV
> +and must have its
> +.B d_type
> +set to
> +.BR ELF_T_AUXV .
> +.BR elf_getdata_rawchunk (3)
> +can be used to acquire an
> +.B Elf_Data*
> +with a
> +.B d_type
> +of
> +.BR ELF_T_AUXV .
Yeah, this is slightly "funny" in that it doesn't really come from any
Elf section. You have to extract it from a segment of memory, a core
file note or grab it from /proc/pid/auxv.
> +See
> +.BR getauxval (3)
> +for more information regarding the auxiliary vector.
> +
> +.SH PARAMETERS
> +.TP
> +.I data
> +Pointer to an
> +.B Elf_Data
> +of a note with type
> +.B NT_AUXV
> +and must have its
> +.B d_type
> +set to
> +.BR ELF_T_AUXV .
> +See
> +.BR elf_getdata_rawchunk (3)
> +for more information.
> +
> +.TP
> +.I ndx
> +Index of the requested auxiliary vector entry within
> +.IR data .
> +
> +.TP
> +.I dst
> +Pointer to a caller\-provided
> +.B GElf_auxv_t
> +structure for storing the requested auxiliary vector entry.
Should not be NULL.
> +.SH RETURN VALUE
> +On success, this function updates
> +.I dst
> +with the requested auxiliary vector entry and returns
> +.IR dst .
> +On failure, it returns NULL and sets elf_errno. If
> +.I data
> +is NULL, then NULL is returned without setting elf_errno.
OK.
> +.SH SEE ALSO
> +.BR elf_getdata_rawchunk (3),
> +.BR getauxval (3)
> +.BR libelf (3),
> +.BR elf (5)
Where is GElf_auxv_t described? It seems a elfutils libelf specific
data structure.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +Interface Attribute Value
> +T{
> +.na
> +.nh
> +.BR gelf_getauxv ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to <[email protected]> or
> https://sourceware.org/bugzilla/.
> +
> +.SH HISTORY
> +.B gelf_getauxv
> +first appeared in elfutils 0.130.
This is an elfutils libelf extension and will most likely not be found
in any other libelf implementation.
Thanks,
Mark