]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
doc: Add gelf_update_lib.3
authorAaron Merey <amerey@redhat.com>
Thu, 1 Jan 2026 02:50:41 +0000 (21:50 -0500)
committerAaron Merey <amerey@redhat.com>
Fri, 13 Mar 2026 18:46:52 +0000 (14:46 -0400)
Signed-off-by: Aaron Merey <amerey@redhat.com>
doc/Makefile.am
doc/gelf_update_lib.3 [new file with mode: 0644]

index 9917d399f0cc0937aebfaee5bf8a0c4d24e8c197..fc29c2fffbee14ff5b575adb09f05e55b08d4f1d 100644 (file)
@@ -115,6 +115,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \
                        gelf_offscn.3 \
                        gelf_update_ehdr.3 \
                        gelf_update_dyn.3 \
+                       gelf_update_lib.3 \
                        gelf_update_move.3 \
                        gelf_update_phdr.3 \
                        gelf_update_shdr.3 \
diff --git a/doc/gelf_update_lib.3 b/doc/gelf_update_lib.3
new file mode 100644 (file)
index 0000000..f1facd9
--- /dev/null
@@ -0,0 +1,95 @@
+.TH GELF_UPDATE_LIB 3 2025-12-31 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+gelf_update_lib \- Update prelink library in table at the given index
+
+.SH SYNOPSIS
+.nf
+.B #include <gelf.h>
+
+.BI "int gelf_update_lib (Elf_Data *" data ", int " ndx ", GElf_Lib *" src ");"
+
+.SH DESCRIPTION
+Copy a class\-independent prelink library table entry from
+.I src
+into the
+.BR SHT_GNU_LIBLIST .
+section associated with
+.I data
+at index
+.IR ndx .
+
+.PP
+.I data
+must be an
+.B Elf_Data*
+associated with a section of type
+.BR SHT_GNU_LIBLIST .
+.I data->d_type
+should be
+.BR ELF_T_LIB .
+.B SHT_GNU_LIBLIST
+sections are used by the prelink utility.  See
+https://sourceware.org/gnu-gabi/prelink.txt for more information.
+
+.SH PARAMETERS
+.TP
+.I data
+Pointer to an
+.B Elf_Data
+associated with a section with type
+.BR SHT_GNU_LIBLIST .
+.I data->d_type
+should be
+.BR ELF_T_LIB .
+
+.TP
+.I ndx
+Zero\-based index of the prelink library table entry to be updated within
+.IR data .
+
+.TP
+.I src
+Pointer to a caller\-provided prelink library table entry.
+.I src
+must not be NULL.
+
+.SH RETURN VALUE
+On success, this function returns a non-zero value and updates
+the prelink library table entry at index
+.I ndx
+in
+.IR data .
+The section associated with
+.I data
+is flagged with
+.BR ELF_F_DIRTY .
+On failure, zero is returned and elf_errno is set.  If
+.I data
+is NULL, then zero is returned and elf_errno is not set.
+
+.SH SEE ALSO
+.BR gelf_getlib (3),
+.BR libelf (3),
+.BR elf (5)
+
+.SH ATTRIBUTES
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface      Attribute       Value
+T{
+.na
+.nh
+.BR gelf_update_lib ()
+T}     Thread safety   MT-Safe
+.TE
+
+.SH REPORTING BUGS
+Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.
+
+.SH HISTORY
+.B gelf_update_lib
+first appeared in elfutils 0.95. This function is an elfutils libelf extension and
+may not be available in other libelf implementations.