GELF\_GETSYM(3) Libelf Programmer's Manual GELF\_GETSYM(3)

# [NAME](#NAME)

gelf\_getsym - Retrieve class-independent symbol information from the symbol table at the given index

# [SYNOPSIS](#SYNOPSIS)

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

# [DESCRIPTION](#DESCRIPTION)

Translate the symbol table entry at index *ndx* from *data* into a class-independent representation stored in *\*dst*.

*data* must be the **Elf\_Data** of a section with type **SHT\_SYMTAB** or **SHT\_DYNSYM**.

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 contains more than 64K sections then **gelf\_getsymshndx** should be used to retrieve a symbol's section index. See [**gelf\_getsymshndx**(3)](/man/os/elfutils/gelf_getsymshndx.3) for more information.

# [PARAMETERS](#PARAMETERS)

[*data*](#data)

Pointer to an **Elf\_Data** of a **SHT\_SYMTAB** or **SHT\_DYNSYM** section.

[*ndx*](#ndx)

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

[*dst*](#dst)

Pointer to a caller-provided structure for storing the symbol table entry. *dst* must not be NULL.

# [RETURN VALUE](#RETURN_VALUE)

On success, this function returns *dst*. On failure, it returns NULL and sets elf\_errno. If *data* is NULL, then NULL is returned without setting elf\_errno.

# [SEE ALSO](#SEE_ALSO)

[**gelf\_getdyn**(3)](/man/os/elfutils/gelf_getdyn.3), [**gelf\_getsymshndx**(3)](/man/os/elfutils/gelf_getsymshndx.3), [**gelf\_update\_sym**(3)](/man/os/elfutils/gelf_update_sym.3), [**libelf**(3)](/man/os/elfutils/libelf.3), [**elf**(5)](/man/os/elfutils/elf.5)

# [ATTRIBUTES](#ATTRIBUTES)

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

# [REPORTING BUGS](#REPORTING_BUGS)

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

2025-12-29 Libelf

---

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