]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
doc: Add gelf_getrel.3 and gelf_getrela.3
authorAaron Merey <amerey@redhat.com>
Tue, 28 Oct 2025 22:29:04 +0000 (18:29 -0400)
committerAaron Merey <amerey@redhat.com>
Tue, 28 Oct 2025 22:29:04 +0000 (18:29 -0400)
Signed-off-by: Aaron Merey <amerey@redhat.com>
doc/Makefile.am
doc/gelf_getrel.3 [new file with mode: 0644]
doc/gelf_getrela.3 [new file with mode: 0644]

index db566bcef3cc2fc9ddc47efdc97dd1f91f404a06..f8978d5081875e4d792bf646221d3aa9b34496fb 100644 (file)
@@ -93,6 +93,8 @@ notrans_dist_man3_MANS= elf32_checksum.3 \
                        elf_version.3 \
                        gelf_getclass.3 \
                        gelf_getehdr.3 \
+                       gelf_getrel.3 \
+                       gelf_getrela.3 \
                        gelf_getshdr.3 \
                        gelf_newphdr.3 \
                        gelf_offscn.3 \
diff --git a/doc/gelf_getrel.3 b/doc/gelf_getrel.3
new file mode 100644 (file)
index 0000000..10c37bd
--- /dev/null
@@ -0,0 +1,92 @@
+.TH GELF_GETREL 3 2025-09-24 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+gelf_getrel, gelf_getrela \- retrieve relocation entries as class\-independent structures
+
+.SH SYNOPSIS
+.nf
+.B #include <gelf.h>
+
+.BI "GElf_Rel  *gelf_getrel (Elf_Data *" data ", int " ndx ", GElf_Rel  *" dst ");"
+.BI "GElf_Rela *gelf_getrela(Elf_Data *" data ", int " ndx ", GElf_Rela *" dst ");"
+.fi
+
+.SH DESCRIPTION
+The
+.BR gelf_getrel ()
+and
+.BR gelf_getrela ()
+functions translate the REL or RELA relocation entry at index
+.I ndx
+from
+.I data
+into a class\-independent representation stored in
+.IR *dst .
+
+.PP
+.I data
+must be the
+.B Elf_Data
+of a section whose type matches the function being called:
+.BR SHT_REL
+for
+.BR gelf_getrel ()
+and
+.BR SHT_RELA
+for
+.BR gelf_getrela ().
+
+.SH PARAMETERS
+.TP
+.I data
+Pointer to an
+.B Elf_Data
+for a SHT_REL or SHT_RELA relocation section.
+
+.TP
+.I ndx
+Zero\-based index of the relocation entry within
+.IR data .
+
+.TP
+.I dst
+Pointer to a caller\-provided structure for storing the relocation:
+.B GElf_Rel
+for
+.BR gelf_getrel ()
+and
+.B GElf_Rela
+for
+.BR gelf_getrela ().
+.I dst
+must not be NULL.
+
+.SH RETURN VALUE
+On success, returns
+.IR dst .
+On failure, returns NULL and sets elf_errno.  If
+.I data
+is NULL, then NULL is returned without setting elf_errno.
+
+.SH SEE ALSO
+.BR elf_getdata (3),
+.BR gelf_update_rel (3),
+.BR gelf_update_rela (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_getrel (),\~gelf_getrela ()
+T}     Thread safety   MT-Safe
+.TE
+
+.SH REPORTING BUGS
+Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.
diff --git a/doc/gelf_getrela.3 b/doc/gelf_getrela.3
new file mode 100644 (file)
index 0000000..1794382
--- /dev/null
@@ -0,0 +1 @@
+.so man3/gelf_getrel.3