GELF_UPDATE_SYMINFO(3)

πŸ“¦
version 0.197 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixpkgs unstable, ubuntu stonking

✨ GELF_UPDATE_SYMINFO(3) ✨

okay bestie, welcome to the Libelf Programmer's Manual πŸ’– you're here for gelf_update_syminfo, and honestly? iconic function, very niche, very Sun-coded. let's get into it 🫢


🌸 NAME 🌸

gelf_update_syminfo β€” updates the additional symbol info in the symbol table at whatever index you point at, no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <gelf.h>

int gelf_update_syminfo (Elf_Data *data, int ndx, GElf_Syminfo *src);

πŸ¦‹ DESCRIPTION πŸ¦‹

So what it does is: it copies a class-independent additional symbol information entry out of src, and drops it into the SHT_SUNW_syminfo section that's associated with data, at entry index ndx. Like, moving one little entry from here to there. slay 🧚

now, data needs to be associated with an ELF section whose type is SHT_SUNW_syminfo and whose data type is ELF_T_SYMINFO. important!! ⚠️

heads up babes: these types are Sun/Solaris extensions and they are not typically used in GNU/Linux ELF files. so if you're on Linux wondering why you've never met SHT_SUNW_syminfo at a party β€” that's why πŸ’€

πŸ‘‘ PARAMETERS πŸ‘‘

  • data β€” a pointer to an Elf_Data that's associated with an ELF section of type SHT_SUNW_syminfo and data type ELF_T_SYMINFO. (yes the original really does say "section with type for a section with type", we're all just vibing through it πŸ™ˆ)
  • ndx β€” the zero-based index of the entry inside data that you want updated. zero-based, so the first one is 0, not 1, don't come at me ⭐
  • src β€” a pointer to a caller-provided additional symbol information entry. must not be NULL, fr fr 🚫

🌈 RETURN VALUE 🌈

  • on success? it returns a non-zero value πŸŽ‰ and it updates data with src at index ndx. also the section associated with data gets flagged with ELF_F_DIRTY ✨ (she's marked, she's changed, she needs writing back)
  • on failure? zero is returned, and elf_errno gets set. classic.
  • and if data is NULL? zero is returned β€” but elf_errno is not set. yeah. special case. periodt πŸ’…

πŸ’œ SEE ALSO πŸ’œ


πŸ“ ATTRIBUTES πŸ“

  • Interface: gelf_update_syminfo()
  • Attribute: Thread safety
  • Value: MT-Safe

so like, she's MT-Safe, you can bring her to the multithreaded function 🫢


😭 REPORTING BUGS 😭

found a bug? don't suffer in silence bestie. report it to <elfutils-devel@sourceware.org> or hit up https://sourceware.org/bugzilla/ and tell them everything πŸ’Œ


and that's the whole page, no notes. this one came from Libelf, dated 2025-12-30, and it's the GELF_UPDATE_SYMINFO(3) page β€” mwah, go update some Sun symbol info responsibly, i believe in you πŸ’–βœ¨

πŸ“¦ where this page comes from