GELF_GETVERSYM(3)

✨ GELF_GETVERSYM(3) ✨

ok so bestie, welcome to the Libelf Programmer's Manual πŸ’– you're literally about to read the page for gelf_getversym, gelf_getverdef, gelf_getverdaux, gelf_getverneed and gelf_getvernaux β€” the whole girl group πŸŽ€ they're all about grabbing GNU symbol versioning entries, and yes they're class-independent, no cap.


🌸 NAME 🌸

gelf_getversym, gelf_getverdef, gelf_getverdaux, gelf_getverneed, gelf_getvernaux β€” retrieve GNU symbol versioning entries πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gelf.h>

GElf_Versym  *gelf_getversym (Elf_Data *data, int ndx, GElf_Versym  *dst);
GElf_Verdef  *gelf_getverdef (Elf_Data *data, int offset, GElf_Verdef  *dst);
GElf_Verdaux *gelf_getverdaux(Elf_Data *data, int offset, GElf_Verdaux *dst);
GElf_Verneed *gelf_getverneed(Elf_Data *data, int offset, GElf_Verneed *dst);
GElf_Vernaux *gelf_getvernaux(Elf_Data *data, int offset, GElf_Vernaux *dst);

πŸ’œ DESCRIPTION πŸ’œ

so these five functions are giving class-independent access to GNU ELF symbol version information. like, you ask for an entry, they pull it out of data and tuck it into the dst you handed them. main character behavior fr fr ✨

  • gelf_getversym() β€” grabs the symbol version index at index ndx from the SHT_GNU_versym section that goes with data.
  • gelf_getverdef() β€” grabs the version definition entry at section offset offset from the SHT_GNU_verdef section that goes with data.
  • gelf_getverdaux() β€” grabs the version definition auxiliary entry at section offset offset from the SHT_GNU_verdef section that goes with data.
  • gelf_getverneed() β€” grabs the version needed entry at section offset offset from the SHT_GNU_verneed section that goes with data.
  • gelf_getvernaux() β€” grabs the version needed auxiliary entry at section offset offset from the SHT_GNU_verneed section that goes with data.

πŸŽ€ PARAMETERS πŸŽ€

  • data β€” pointer to an Elf_Data that corresponds to the appropriate GNU versioning section πŸ‘‘
  • ndx β€” (only for gelf_getversym(), bestie, it's exclusive πŸ’…) zero-based index of the entry inside data.
  • offset β€” (for gelf_getverdef(), gelf_getverdaux(), gelf_getverneed(), and gelf_getvernaux()) the section-relative byte offset of the entry inside data.
  • dst β€” pointer to a caller-provided entry of the appropriate type: GElf_Versym, GElf_Verdef, GElf_Verdaux, GElf_Verneed, or GElf_Vernaux. > this argument must not be NULL. like seriously, don't πŸ™ˆ

🌈 RETURN VALUE 🌈

on success, these functions store the requested entry in dst and return dst β€” slay πŸ’–

on failure, they return NULL and set elf_errno 😭

and if data is NULL, then NULL is returned without setting elf_errno. noted, bestie.


⭐ SEE ALSO ⭐

gelf_update_verdaux(3), gelf_update_verdef(3), gelf_update_vernaux(3), gelf_update_verneed(3), gelf_update_versym(3), libelf(3), elf(5)

(the update girlies are the mirror twins of the get girlies, iykyk πŸͺž)


πŸ‘‘ ATTRIBUTES πŸ‘‘

here's the vibe check on the interface attributes:

  • Interface: gelf_getversym(), gelf_getverdef(), gelf_getverdaux(), gelf_getverneed(), gelf_getvernaux()
  • Attribute: Thread safety
  • Value: MT-Safe

so yeah, all five of them are MT-Safe β€” thread-safe icons, we love to see it 🧚


🫢 REPORTING BUGS 🫢

found a bug? spill it to <elfutils-devel@sourceware.org> or drop it at https://sourceware.org/bugzilla/. they wanna hear it fr fr πŸ’€


and that's the whole page, bestie πŸŽ€ this was Libelf, dated 2025-09-27, page GELF_GETVERSYM(3) β€” go forth and read your symbol versions, you absolute icon πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from