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

# [NAME](#NAME)

gelf\_update\_lib - Update prelink library in table at the given index

# [SYNOPSIS](#SYNOPSIS)

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

# [DESCRIPTION](#DESCRIPTION)

Copy a class-independent prelink library table entry from *src* into the **SHT\_GNU\_LIBLIST**. section associated with *data* at index *ndx*.

*data* must be an **Elf\_Data\*** associated with a section of type **SHT\_GNU\_LIBLIST**. *data-&gt;d\_type* should be **ELF\_T\_LIB**. **SHT\_GNU\_LIBLIST** sections are used by the prelink utility. See https://sourceware.org/gnu-gabi/prelink.txt for more information.

# [PARAMETERS](#PARAMETERS)

[*data*](#data)

Pointer to an **Elf\_Data** associated with a section with type **SHT\_GNU\_LIBLIST**. *data-&gt;d\_type* should be **ELF\_T\_LIB**.

[*ndx*](#ndx)

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

[*src*](#src)

Pointer to a caller-provided prelink library table entry. *src* must not be NULL.

# [RETURN VALUE](#RETURN_VALUE)

On success, this function returns a non-zero value and updates the prelink library table entry at index *ndx* in *data*. The section associated with *data* is 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\_getlib**(3)](/man/os/elfutils/gelf_getlib.3), [**libelf**(3)](/man/os/elfutils/libelf.3), [**elf**(5)](/man/os/elfutils/elf.5)

# [ATTRIBUTES](#ATTRIBUTES)

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

# [REPORTING BUGS](#REPORTING_BUGS)

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

# [HISTORY](#HISTORY)

**gelf\_update\_lib** first appeared in elfutils 0.95. This function is an elfutils libelf extension and may not be available in other libelf implementations.

2025-12-31 Libelf

---

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