GELF_UPDATE_DYN(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_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 an Elf_Data that's associated with a section of type SHT_DYNAMIC. also, data->d_type should be ELF_T_DYN. like, that's the expectation, bestie.
  • ndx β€” the zero-based index of the dynamic table entry you want to update within data. zero-based!! not one-based!! don't do that to yourself 😭
  • src β€” a pointer to a caller-provided dynamic table entry. for ELFCLASS32 binaries, d_tag should be able to fit within a signed 32-bit value, while d_val and d_ptr should be able to fit within unsigned 32-bit values. and src must not be NULL β€” 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