GELF_UPDATE_MOVE(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_MOVE(3) β€” Libelf Programmer's Manual πŸ’…

okay bestie, so this one is gelf_update_move, from the Libelf programmer's manual, and it's lowkey iconic once you get it. sit with me, we're doing this together 🫢


✨ NAME ✨

gelf_update_move β€” update the class-independent move structure at the given index. she's giving "write the thing at slot ndx" energy and honestly? we love her πŸ’–


✨ SYNOPSIS ✨

#include <gelf.h>

int gelf_update_move (Elf_Data *data, int ndx, GElf_Move *src);

look at that signature. three little arguments. no notes. πŸ‘‘


✨ DESCRIPTION ✨

so here's the vibe: this function copies a class-independent move structure from src into the SHT_SUNW_move section that's associated with data, at entry index ndx. that's it. that's the whole job. and she does it well πŸ’…

data should be associated with an ELF section whose type is SHT_SUNW_move. and data->d_type should be ELF_T_MOVE. periodt.

🚨 okay important tea: these types are Sun/Solaris extensions and they are not typically used in GNU/Linux ELF files. so if you're on a normal Linux box wondering why nothing's coming up, that's why bestie, no cap 😭

✨ PARAMETERS ✨

  • data β€” pointer to an Elf_Data that's associated with a SHT_SUNW_move section. and data->d_type should be ELF_T_MOVE, don't forget her πŸŽ€
  • ndx β€” the zero-based index of the move structure entry you want to update inside data. zero-based! so the first one is 0, not 1, iykyk πŸ™ˆ
  • src β€” pointer to a caller-provided move structure. now for ELFCLASS32 binaries, m_info and m_poffset should be able to fit within unsigned 32-bit values. the GELF_M_SIZE component of m_info should fit in unsigned 8 bits, and the GELF_M_SYM component should fit in unsigned 24 bits. and listen β€” src must not be NULL. fr fr, don't do it 🫠

✨ RETURN VALUE ✨

  • on success? she returns a non-zero value and updates the move entry at index ndx in data. and the section associated with data gets flagged with ELF_F_DIRTY β€” that's the little "hey I changed, notice me" marker, obsessed ✨
  • on failure? zero is returned and elf_errno gets set. slay, at least she tells you what went wrong 🌸
  • but if data is NULL? zero is returned without setting elf_errno. so like... you get nothing, no explanation, just silence πŸ’€

✨ SEE ALSO ✨

go read those too, they're the friend group πŸ¦‹


✨ ATTRIBUTES ✨

  • gelf_update_move() β€” Thread safety: MT-Safe 🌈

so yes, she is thread safe. multitasking queen πŸ‘‘


✨ REPORTING BUGS ✨

found a bug? don't be shy, report it to <elfutils-devel@sourceware.org> or hit up https://sourceware.org/bugzilla/ πŸ’– they wanna know!!


and that's the whole page bestie, you ate that πŸŽ€ big sign-off energy: this is from Libelf, dated 2025-12-30, and yes she's still out here being GELF_UPDATE_MOVE(3) like the main character she is. periodt πŸ’…βœ¨

πŸ“¦ where this page comes from