Signed-off-by: Aaron Merey <[email protected]>
---
doc/Makefile.am | 1 +
doc/gelf_update_symshndx.3 | 125 +++++++++++++++++++++++++++++++++++++
2 files changed, 126 insertions(+)
create mode 100644 doc/gelf_update_symshndx.3
diff --git a/doc/Makefile.am b/doc/Makefile.am
index d6e7b11a..62c835a8 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -115,6 +115,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \
gelf_update_rel.3 \
gelf_update_rela.3 \
gelf_update_sym.3 \
+ gelf_update_symshndx.3 \
gelf_update_versym.3 \
gelf_update_verdef.3 \
gelf_update_verdaux.3 \
diff --git a/doc/gelf_update_symshndx.3 b/doc/gelf_update_symshndx.3
new file mode 100644
index 00000000..32bc4fde
--- /dev/null
+++ b/doc/gelf_update_symshndx.3
@@ -0,0 +1,125 @@
+.TH GELF_UPDATE_SYMSHNDX 3 2025-12-30 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+gelf_update_symshndx \- Update class\-independent symbol information and
+extended section index in symbol table
+
+.SH SYNOPSIS
+.nf
+.B #include <gelf.h>
+
+.BI "int gelf_update_symshndx (Elf_Data *" symdata ", Elf_Data *" shndxdata ",
int " ndx ", GElf_Sym *" sym ", Elf32_Word " xshndx ");"
+
+.SH DESCRIPTION
+This function updates
+.I symdata
+and
+.IR shndxdata ,
+at index
+.I ndx
+with the class\-independent symbol information from
+.I sym
+and the section index
+.IR xshndx .
+.I symdata
+should be an
+.B Elf_Data
+pointer for an
+.B SHT_SYMTAB
+section and
+.I shndxdata
+should be an
+.B Elf_Data
+pointer for an
+.B SHT_SYMTAB_SHNDX
+section.
+
+See
+.BR gelf_getsymshndx (3)
+for more information about retrieving symbols with extended section indices.
+
+.SH PARAMETERS
+.TP
+.I symdata
+Pointer to
+.B Elf_Data
+for a section with type
+.BR SHT_SYMTAB .
+
+.TP
+.I shndxdata
+Pointer to
+.B Elf_Data
+for a section with type
+.BR SHT_SYMTAB_SHNDX .
+.I shndxdata
+may be NULL. If
+.I shndxdata
+is NULL, then
+.I xshndx
+must be zero.
+
+.TP
+.I ndx
+Zero\-based index of the symbol table entry and extended section index entry
+to be updated.
+
+.TP
+.I sym
+Pointer to a caller\-provided symbol table entry. For
+.B ELFCLASS32
+binaries,
+.B st_value
+and
+.B st_size
+should be able to fit within unsigned 32-bit values.
+.I sym
+must not be NULL.
+
+.TP
+.I xshndx
+Updated extended section index entry to be associated with
+.IR sym .
+
+.SH RETURN VALUE
+On success, a non-zero value is returned and the entries at index
+.I ndx
+in
+.I symdata
+and
+.I shndxdata
+(if not NULL)
+are updated with
+.I sym
+and
+.IR xshndx ,
+respectively. The sections associated with
+.I symdata
+and
+.I shndxdata
+are flagged with
+.BR ELF_F_DIRTY .
+On failure, zero is returned, elf_errno is set. If
+.I sym
+is NULL, then NULL is returned without setting elf_errno.
+
+.SH SEE ALSO
+.BR gelf_getsymshndx (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_update_symshndx ()
+T} Thread safety MT-Safe
+.TE
+
+.SH REPORTING BUGS
+Report bugs to <[email protected]> or
https://sourceware.org/bugzilla/.
--
2.52.0