Signed-off-by: Aaron Merey <[email protected]>
---
doc/Makefile.am | 1 +
doc/gelf_getphdr.3 | 71 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 72 insertions(+)
create mode 100644 doc/gelf_getphdr.3
diff --git a/doc/Makefile.am b/doc/Makefile.am
index db699a22..b0825ca6 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -94,6 +94,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \
gelf_fsize.3 \
gelf_getclass.3 \
gelf_getehdr.3 \
+ gelf_getphdr.3 \
gelf_getrel.3 \
gelf_getrela.3 \
gelf_getversym.3 \
diff --git a/doc/gelf_getphdr.3 b/doc/gelf_getphdr.3
new file mode 100644
index 00000000..c1ea47d8
--- /dev/null
+++ b/doc/gelf_getphdr.3
@@ -0,0 +1,71 @@
+.TH GELF_GETPHDR 3 2025-12-23 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+gelf_getphdr \- Retrieve class-independent program header table entries for an
ELF object file
+
+.SH SYNOPSIS
+.nf
+.B #include <gelf.h>
+
+.BI "GElf_Phdr *gelf_getphdr (Elf *" elf ", int " ndx ", GElf_Phdr *" dst ");"
+
+.SH DESCRIPTION
+Retrieve the class-independent program header table entry at index
+.I ndx
+for ELF descriptor
+.I elf
+and store it in
+.IR dst .
+See
+.BR elf_getphdrnum (3)
+for information on how to acquire the number of entries in the program header
+table.
+
+.SH PARAMETERS
+.TP
+.I elf
+ELF descriptor of kind
+.B ELF_K_ELF
+from which to retrieve the program header table entry.
+
+.TP
+.I ndx
+The index of the program header table entry to be retrieved.
+
+.TP
+.I dst
+Pointer to a caller\-provided
+.B GElf_Phdr
+that will receive the requested program header table entry.
+
+.SH RETURN VALUE
+On success, the requested entry is copied into
+.I dst
+and
+.I dst is returned.
+On failure, NULL is returned and elf_errno is set. If
+.I elf
+is NULL, then NULL is returned and elf_errno is not set.
+
+.SH SEE ALSO
+.BR elf_getphdrnum (3),
+.BR gelf_newphdr (3),
+.BR gelf_update_phdr (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_getphdr ()
+T} Thread safety MT-Safe
+.TE
+
+.SH REPORTING BUGS
+Report bugs to <[email protected]> or
https://sourceware.org/bugzilla/.
--
2.52.0