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

# gelf\_update\_lib(3)

Update prelink library in table at the given index

## NAME

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

## SYNOPSIS

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

## 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-\>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

- *data*

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

- *ndx*

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

- *src*

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

## 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

[**gelf\_getlib**(3)](/gelf_getlib/3.md), [**libelf**(3)](/libelf/3.md), [**elf**(5)](/elf/5.md)

## ATTRIBUTES

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

## REPORTING BUGS

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

## 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.
