GELF_UPDATE_VERSYM(3)
π GELF_UPDATE_VERSYM β the libelf programmer's manual, section 3, bestie edition π
okay so. you know how ELF files have symbol versioning sections and those sections are class-dependent and annoying? yeah. these five functions are the class-independent glow-up that lets you modify them. no cap.
β¨ NAME β¨
gelf_update_versym, gelf_update_verdef, gelf_update_verdaux, gelf_update_verneed, gelf_update_vernaux β modify class-independent symbol versioning records π¦
β¨ SYNOPSIS β¨
#include <gelf.h>
int gelf_update_versym (Elf_Data *data, int ndx, GElf_Versym *src);
int gelf_update_verdef (Elf_Data *data, int offset, GElf_Verdef *src);
int gelf_update_verdaux(Elf_Data *data, int offset, GElf_Verdaux *src);
int gelf_update_verneed(Elf_Data *data, int offset, GElf_Verneed *src);
int gelf_update_vernaux(Elf_Data *data, int offset, GElf_Vernaux *src);
β¨ DESCRIPTION β¨
so these five besties are the ones doing the class-independent modification of GNU ELF symbol versioning sections. like, every single one of them takes whatever you handed them in src and copies that content straight into the symbol versioning entry sitting at the index or offset you named inside data. periodt.
gelf_update_versym() β writes a symbol version index into the SHT_GNU_versym section that's associated with data, at index ndx. π
gelf_update_verdef() β writes a version definition entry into the SHT_GNU_verdef section that's associated with data, at section offset offset.
gelf_update_verdaux() β writes a version definition auxiliary entry into the SHT_GNU_verdef section that's associated with data, at section offset offset. (yes, auxiliary. the lil sidekick entry. iconic.)
gelf_update_verneed() β writes a version needed entry into the SHT_GNU_verneed section that's associated with data, at section offset offset.
gelf_update_vernaux() β writes a version needed auxiliary entry into the SHT_GNU_verneed section that's associated with data, at section offset offset.
β¨ PARAMETERS β¨
dataβ anElf_Datapointer that corresponds to the appropriate GNU symbol versioning section. the vibe check starts here.ndxβ (this one is forgelf_update_versym()only, bestie, don't get it twisted.) the zero-based index of the entry insidedata.offsetβ (this one's forgelf_update_verdef(),gelf_update_verdaux(),gelf_update_verneed(), andgelf_update_vernaux().) the section-relative byte offset of the entry insidedata.srcβ pointer to the caller-supplied symbol:GElf_Versym,GElf_Verdef,GElf_Verdaux,GElf_Verneed, orGElf_Vernaux, whichever is appropriate. π«Ά
π¨ okay this part matters: this argument must not beNULL. do not passNULL. i'm literally begging.
β¨ RETURN VALUE β¨
when it goes well: these functions store the requested entry in src, mark the section corresponding to data with ELF_F_DIRTY, and hand you back a non-zero value. slay. β
when it goes badly: 0 is returned and elf_errno gets set. π
and one lil edge case β if data is NULL, you get 0 back without elf_errno being set. no drama, no error code, just vibes. π
β¨ SEE ALSO β¨
gelf_getverdaux(3), gelf_getverdef(3), gelf_getvernaux(3), gelf_getverneed(3), gelf_getversym(3), libelf(3), elf(5)
(yeah the getters are the mirror images of these. iykyk. π)
β¨ ATTRIBUTES β¨
- Interface:
gelf_update_versym(),gelf_update_verdef(),gelf_update_verdaux(),gelf_update_verneed(),gelf_update_vernaux()- Attribute: Thread safety
- Value:
MT-Safeπ
β¨ REPORTING BUGS β¨
found a bug? don't suffer in silence, tell the maintainers π
Report bugs to <elfutils-devel@sourceware.org> or at https://sourceware.org/bugzilla/.
and that's the whole page, bestie. this was the libelf programmer's manual, GELF_UPDATE_VERSYM(3), dated 2025-09-27, brought to you by Libelf. go forth and update your versyms responsibly. mwah π
β¨π¦
π¦ 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