GELF_UPDATE_SYM(3)

NAME
gelf_update_sym - update a class-independent symbol table entry

SYNOPSIS
#include <gelf.h>

int gelf_update_sym (Elf_Data *data, int ndx, GElf_Sym *src);

DESCRIPTION
Copy a class-independent symbol table entry from src into the SHT_SYMTAB or SHT_DYNSYM section associated with data at entry index ndx.

The number of symbols in the symbol table can be calculated by dividing the size of the corresponding section (sh_size or d_size) by the size of a symbol table entry. The size of a symbol table entry can be obtained from sh_entsize or gelf_fsize(3).

If the corresponding ELF file contains more than 64K sections then gelf_update_symshndx should be used to update a symbol's section index in an extended section index table. See gelf_update_symshndx(3) for more information.

PARAMETERS

data
    Elf_Data for a symbol table section with type SHT_SYMTAB or SHT_DYNSYM.

ndx Zero-based index of the symbol table entry to be updated within data.

src Pointer to the caller-provided symbol table entry. For ELFCLASS32 binaries, st_value and st_size should be able to fit within unsigned 32-bit values. src must not be NULL.

RETURN VALUE
On success, this function returns a non-zero value and updates the symbol table entry at index ndx in data. The symbol table section associated with data will be flagged with ELF_F_DIRTY. On failure, zero is returned and elf_errno is set. If data is NULL, then zero is returned and elf_errno is not set.

SEE ALSO
gelf_getsym(3), gelf_update_symshndx(3), libelf(3), elf(5)

ATTRIBUTES
Interface | Attribute | Value
 | Thread safety | MT-Safe

REPORTING BUGS
Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.