GELF\_UPDATE\_SYM(3) Libelf Programmer's Manual GELF\_UPDATE\_SYM(3)

# [NAME](#NAME)

gelf\_update\_sym - update a class-independent symbol table entry

# [SYNOPSIS](#SYNOPSIS)

```
#include <gelf.h>
int gelf_update_sym (Elf_Data *data, int ndx, GElf_Sym *src);
```

# [DESCRIPTION](#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)](/man/os/elfutils/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)](/man/os/elfutils/gelf_update_symshndx.3) for more information.

# [PARAMETERS](#PARAMETERS)

[*data*](#data)

**Elf\_Data for a symbol table section with type** **SHT\_SYMTAB** or **SHT\_DYNSYM**.

[*ndx*](#ndx)

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

[*src*](#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](#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](#SEE_ALSO)

[**gelf\_getsym**(3)](/man/os/elfutils/gelf_getsym.3), [**gelf\_update\_symshndx**(3)](/man/os/elfutils/gelf_update_symshndx.3), [**libelf**(3)](/man/os/elfutils/libelf.3), [**elf**(5)](/man/os/elfutils/elf.5)

# [ATTRIBUTES](#ATTRIBUTES)

**Interface** **Attribute** **Value** gelf\_update\_sym () Thread safety MT-Safe

# [REPORTING BUGS](#REPORTING_BUGS)

Report bugs to &lt;elfutils-devel@sourceware.org&gt; or https://sourceware.org/bugzilla/.

2025-09-07 Libelf

---

Document: gelf_update_sym(3) from elfutils 0.196-r1 (Chainguard OS)
Source: https://sourceware.org/git/elfutils.git
