---
name: "gelf_update_sym"
section: "3"
platform: "linux"
package: "libelf"
version: "0.197-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/gelf_update_sym"
---

# gelf\_update\_sym(3)

update a class-independent symbol table entry

## 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)](/gelf_fsize/3.md).

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)](/gelf_update_symshndx/3.md) 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_getsym/3.md), [**gelf\_update\_symshndx**(3)](/gelf_update_symshndx/3.md), [**libelf**(3)](/libelf/3.md), [**elf**(5)](/elf/5.md)

## ATTRIBUTES

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

## REPORTING BUGS

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