summaryrefslogtreecommitdiffstats
path: root/doc/elf64_getchdr.3
diff options
context:
space:
mode:
Diffstat (limited to 'doc/elf64_getchdr.3')
-rw-r--r--doc/elf64_getchdr.365
1 files changed, 65 insertions, 0 deletions
diff --git a/doc/elf64_getchdr.3 b/doc/elf64_getchdr.3
new file mode 100644
index 00000000..037426d2
--- /dev/null
+++ b/doc/elf64_getchdr.3
@@ -0,0 +1,65 @@
+.TH ELF64_GETCHDR 3 "June 2024" "Elfutils" "Library Functions Manual"
+
+.SH NAME
+elf64_getchdr \- retrieve the chunk header for a chunk descriptor in an ELF64 file
+
+.SH SYNOPSIS
+.B #include <libelf.h>
+
+.BI "Elf64_Chdr *elf64_getchdr(Elf_Scn *" scn ");"
+
+.SH DESCRIPTION
+The .B elf64_getchdr function retrieves the chunk header for the chunk descriptor referred to by .I scn in an ELF64 object. The chunk header contains metadata about the chunk, such as its type, size, and memory offset.
+
+.SH PARAMETERS
+.TP
+.I scn
+An .I Elf_Scn pointer to the chunk descriptor whose chunk header is to be retrieved. The chunk descriptor must be valid.
+
+.SH RETURN VALUE
+The .B elf64_getchdr function returns a pointer to the .I Elf64_Chdr structure representing the chunk header. If an error occurs, it returns NULL and sets an appropriate error code.
+
+.SH ERRORS
+If .B elf64_getchdr fails, it sets the following error codes:
+
+.TP
+.B ELFARG
+The .I scn parameter is NULL or invalid.
+
+.TP
+.B ELFERR
+An unspecified internal error occurred.
+
+.SH EXAMPLES
+.B "Example 1: Retrieve the chunk header for a chunk descriptor"
+.nf
+.in +4
+#include <libelf.h>
+
+Elf *elf = ...; // Assume elf is a valid Elf pointer
+Elf_Scn *scn = ...; // Assume scn is a valid chunk descriptor
+
+Elf64_Chdr *chdr = elf64_getchdr(scn);
+if (chdr == NULL) {
+ // Handle error
+} else {
+ // Use chdr
+}
+.in -4
+.fi
+
+.SH SEE ALSO
+.BR elf_getscn (3),
+.BR elf_nextscn (3),
+.BR elf_ndxscn (3),
+.BR elf64_getshdr (3),
+.BR elf (3),
+.BR libelf (3)
+
+.SH AUTHORS
+Elfutils was written by the Elfutils development team.
+
+.SH COPYRIGHT
+Copyright © 2024 Elfutils Development Team.
+This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+