GELF_UPDATE_DYN(3)
π GELF_UPDATE_DYN(3) π
okay bestie, welcome to the libelf programmer's manual, this one's a 3-section page so grab a lil snack π
β¨ NAME β¨
gelf_update_dyn β update class-independent information in the dynamic table at the given index
so like. you're poking a new entry into the dynamic table. that's the whole vibe. π
πΈ SYNOPSIS πΈ
#include <gelf.h>
int gelf_update_dyn (Elf_Data *data, int ndx, GElf_Dyn *src);
one include, one function call, three args. slay.
π¦ DESCRIPTION π¦
okay so here's the tea: this function copies a class-independent dynamic table entry from src into the SHT_DYNAMIC section associated with data at index ndx. that's it. that's the whole job. it takes the entry you hand it and it puts it there. π
π PARAMETERS π
dataβ a pointer to anElf_Datathat's associated with a section of typeSHT_DYNAMIC. also,data->d_typeshould beELF_T_DYN. like, that's the expectation, bestie.ndxβ the zero-based index of the dynamic table entry you want to update withindata. zero-based!! not one-based!! don't do that to yourself πsrcβ a pointer to a caller-provided dynamic table entry. forELFCLASS32binaries,d_tagshould be able to fit within a signed 32-bit value, whiled_valandd_ptrshould be able to fit within unsigned 32-bit values. andsrcmust not beNULLβ that's non-negotiable, fr fr.
π«Ά heads up: src must not be NULL. that's a hard requirement, not a suggestion.
β RETURN VALUE β
on success, this function returns a non-zero value and updates the dynamic table entry at index ndx in data. and the dynamic table associated with data gets flagged with ELF_F_DIRTY β yes, it marks your stuff as dirty, it's supposed to, it's a good thing, it means "hey this changed". π₯
on failure, zero is returned and elf_errno is set.
BUT. and this is the little plot twist β if data is NULL, then zero is returned and elf_errno is not set. so if you're out here checking elf_errno after passing a NULL data, that's on you bestie, the manpage literally told you π
π SEE ALSO π
go read those too, iykyk. β¨
π ATTRIBUTES π
- Interface:
gelf_update_dyn() - Attribute: Thread safety
- Value:
MT-Safe
that's it. MT-Safe. it's thread-safe. go wild (responsibly). π
π REPORTING BUGS π
found a bug? not me personally but okay β report it to <elfutils-devel@sourceware.org> or hit up https://sourceware.org/bugzilla/. they wanna hear about it fr fr.
and that's the whole page bestie!! this was the Libelf programmer's manual, dated 2025-12-30, page GELF_UPDATE_DYN(3). go update some dynamic table entries, you absolute icon πβ¨ππ¦
π¦ where this page comes from
- alpine 3.24: elfutils-doc 0.195-r0 Β· GPL-3.0-or-later AND ( GPL-2.0-or-later OR LGPL-3.0-or-later )
- arch rolling: libelf 0.196-1
- arch rolling: libelf 0.197-1 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- centos-stream 10: elfutils-libelf-devel 0.197-1.el10 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- centos-stream 9: elfutils-libelf-devel 0.197-1.el9 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- centos-stream 9: elfutils-libelf-devel 0.197-1.el9 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 43: elfutils-libelf-devel 0.196-1.fc43
- fedora 43: elfutils-libelf-devel 0.196-1.fc43
- fedora 43: elfutils-libelf-devel 0.197-1.fc43 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 43: elfutils-libelf-devel 0.197-1.fc43 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 44: elfutils-libelf-devel 0.196-1.fc44
- fedora 44: elfutils-libelf-devel 0.196-1.fc44
- fedora 44: elfutils-libelf-devel 0.197-1.fc44 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- fedora 44: elfutils-libelf-devel 0.197-1.fc44 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- nixpkgs unstable: elfutils 0.195
- ubuntu stonking: libelf-dev 0.196-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms