GELF_UPDATE_MOVE(3)
π 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 anElf_Datathat's associated with aSHT_SUNW_movesection. anddata->d_typeshould beELF_T_MOVE, don't forget her πndxβ the zero-based index of the move structure entry you want to update insidedata. zero-based! so the first one is0, not1, iykyk πsrcβ pointer to a caller-provided move structure. now forELFCLASS32binaries,m_infoandm_poffsetshould be able to fit within unsigned 32-bit values. theGELF_M_SIZEcomponent ofm_infoshould fit in unsigned 8 bits, and theGELF_M_SYMcomponent should fit in unsigned 24 bits. and listen βsrcmust not beNULL. fr fr, don't do it π«
β¨ RETURN VALUE β¨
- on success? she returns a non-zero value and updates the move entry at index
ndxindata. and the section associated withdatagets flagged withELF_F_DIRTYβ that's the little "hey I changed, notice me" marker, obsessed β¨ - on failure? zero is returned and
elf_errnogets set. slay, at least she tells you what went wrong πΈ - but if
dataisNULL? zero is returned without settingelf_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
- 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