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_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 \

OK.

> 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 ");"

OK.

> +.SH DESCRIPTION
> +This function updates
> +.I symdata
> +and
> +.IR shndxdata ,
> +at index
> +.I ndx

Same comments as for gelf_getsymshndx.

Maybe mention how to find the size of the table?
And that both tables should have the same number of entries?


> +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

Or SHT_DYNSYM?

>  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 .

Or SHT_DYNSYM?

> +
> +.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 .

Must be zero if shndxdata is NULL.

> +.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.

OK.

> +.SH SEE ALSO
> +.BR gelf_getsymshndx (3),
> +.BR libelf (3),
> +.BR elf (5)

elf_getdata, elf_getscn, elf_scnshndx, gelf_updatesym maybe?

> +.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/.

OK.

Thanks,

Mark

Reply via email to