Signed-off-by: Aaron Merey <[email protected]> --- v2: Mention that data->d_type must be ELF_T_DYN and dst must not be NULL.
On Thu, Feb 26, 2026 at 4:39 PM Mark Wielaard <[email protected]> wrote: > > +.SH SEE ALSO > > +.BR gelf_update_dyn (3), > > +.BR libelf (3), > > +.BR elf (5) > > OK. > > Where is GElf_Dyn described? I will post a patch to update libelf.3 with gelf.h information. This will also address review comments for other patches in this series asking about where we have descriptions of other gelf.h types. doc/Makefile.am | 1 + doc/gelf_getdyn.3 | 77 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 doc/gelf_getdyn.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 38357429..fbbd254f 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -94,6 +94,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ gelf_fsize.3 \ gelf_getchdr.3 \ gelf_getclass.3 \ + gelf_getdyn.3 \ gelf_getehdr.3 \ gelf_getphdr.3 \ gelf_getrel.3 \ diff --git a/doc/gelf_getdyn.3 b/doc/gelf_getdyn.3 new file mode 100644 index 00000000..04f58287 --- /dev/null +++ b/doc/gelf_getdyn.3 @@ -0,0 +1,77 @@ +.TH GELF_GETDYN 3 2025-12-30 "Libelf" "Libelf Programmer's Manual" + +.SH NAME +gelf_getdyn \- Get class\-independent information from dynamic table at the given index + +.SH SYNOPSIS +.nf +.B #include <gelf.h> + +.BI "GElf_Dyn *gelf_getdyn (Elf_Data *" data ", int " ndx ", GElf_Dyn *" dst ");" + +.SH DESCRIPTION +Retrieve a dynamic table entry from +.I data +at index +.I ndx +and store it in a class\-independent representation pointed to by +.IR dst . + +.PP +.I data +must be an +.B Elf_Data* +associated with a section of type +.B SHT_DYNAMIC + +.SH PARAMETERS +.TP +.I data +Pointer to an +.B Elf_Data +of a section with type +.BR SHT_DYNAMIC . +.I data->d_type +should be +.BR ELF_T_DYN . + +.TP +.I ndx +Zero\-based index of the requested dynamic table entry within +.IR data . + +.TP +.I dst +Pointer to a caller\-provided +.B GElf_Dyn +structure for storing the requested dynamic table entry. Must not be NULL. + +.SH RETURN VALUE +On success, this function updates +.I dst +with the requested dynamic table 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. + +.SH SEE ALSO +.BR gelf_update_dyn (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_getdyn () +T} Thread safety MT-Safe +.TE + +.SH REPORTING BUGS +Report bugs to <[email protected]> or https://sourceware.org/bugzilla/. -- 2.53.0
