From: Aaron Merey Date: Thu, 1 Jan 2026 02:50:30 +0000 (-0500) Subject: doc: Add gelf_getsym.3 X-Git-Tag: elfutils-0.195~40 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=12c3c2ecf037b3c548fef3f2dc9a57c5ba466124;p=thirdparty%2Felfutils.git doc: Add gelf_getsym.3 Signed-off-by: Aaron Merey --- diff --git a/doc/Makefile.am b/doc/Makefile.am index bf98382e..25567984 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -98,6 +98,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ gelf_getphdr.3 \ gelf_getrel.3 \ gelf_getrela.3 \ + gelf_getsym.3 \ gelf_getversym.3 \ gelf_getverdef.3 \ gelf_getverdaux.3 \ diff --git a/doc/gelf_getsym.3 b/doc/gelf_getsym.3 new file mode 100644 index 00000000..1aee2231 --- /dev/null +++ b/doc/gelf_getsym.3 @@ -0,0 +1,94 @@ +.TH GELF_GETSYM 3 2025-12-29 "Libelf" "Libelf Programmer's Manual" + +.SH NAME +gelf_getsym \- Retrieve class\-independent symbol information from the symbol +table at the given index + +.SH SYNOPSIS +.nf +.B #include + +.BI "GElf_Sym *gelf_getsym (Elf_Data *" data ", int " ndx ", GElf_Sym *" dst ");" + +.SH DESCRIPTION +Translate the symbol table entry at index +.I ndx +from +.I data +into a class\-independent representation stored in +.IR *dst . + +.PP +.I data +must be the +.B Elf_Data +of a section with type +.B SHT_SYMTAB +or +.BR SHT_DYNSYM . + +The number of symbols in the symbol table can be calculated by dividing the +size of the corresponding section (\fBsh_size\fP or \fBd_size\fP) +by the size of a symbol table entry. The size of a symbol table entry can be +obtained from +.B sh_entsize +or +.BR gelf_fsize (3). + +If the corresponding elf contains more than 64K sections then +.BR gelf_getsymshndx +should be used to retrieve a symbol's section index. See +.BR gelf_getsymshndx (3) +for more information. + +.SH PARAMETERS +.TP +.I data +Pointer to an +.B Elf_Data +of a +.B SHT_SYMTAB +or +.B SHT_DYNSYM +section. + +.TP +.I ndx +Zero\-based index of the symbol table entry within +.IR data . + +.TP +.I dst +Pointer to a caller\-provided structure for storing the symbol table entry. +.I dst +must not be NULL. + +.SH RETURN VALUE +On success, this function 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_getdyn (3), +.BR gelf_getsymshndx (3), +.BR gelf_update_sym (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_getsym () +T} Thread safety MT-Safe +.TE + +.SH REPORTING BUGS +Report bugs to or https://sourceware.org/bugzilla/.