summaryrefslogtreecommitdiffstats
path: root/doc/elf64_checksum.3
diff options
context:
space:
mode:
Diffstat (limited to 'doc/elf64_checksum.3')
-rw-r--r--doc/elf64_checksum.362
1 files changed, 62 insertions, 0 deletions
diff --git a/doc/elf64_checksum.3 b/doc/elf64_checksum.3
new file mode 100644
index 00000000..f1aeefd9
--- /dev/null
+++ b/doc/elf64_checksum.3
@@ -0,0 +1,62 @@
+.TH ELF64_CHECKSUM 3 "June 2024" "Elfutils" "Library Functions Manual"
+
+.SH NAME
+elf64_checksum \- compute the checksum for an ELF64 object
+
+.SH SYNOPSIS
+.B #include <libelf.h>
+
+.BI "uint32_t elf64_checksum(Elf *" elf ");"
+
+.SH DESCRIPTION
+The .B elf64_checksum function computes a checksum for the ELF64 object referred to by .I elf. This checksum can be used to verify the integrity of the ELF64 object.
+
+.SH PARAMETERS
+.TP
+.I elf
+An .I Elf pointer to the ELF64 object for which the checksum is to be computed. The ELF object must be valid and of type ELFCLASS64.
+
+.SH RETURN VALUE
+The .B elf64_checksum function returns a .I uint32_t value representing the computed checksum. If an error occurs, it returns 0 and sets an appropriate error code.
+
+.SH ERRORS
+If .B elf64_checksum fails, it sets the following error codes:
+
+.TP
+.B ELFARG
+The .I elf parameter is NULL or invalid.
+
+.TP
+.B ELFERR
+An unspecified internal error occurred.
+
+.SH EXAMPLES
+.B "Example 1: Compute the checksum for an ELF64 object"
+.nf
+.in +4
+#include <libelf.h>
+#include <stdio.h>
+
+Elf *elf = ...; // Assume elf is a valid Elf pointer for an ELF64 object
+
+uint32_t checksum = elf64_checksum(elf);
+if (checksum == 0) {
+ // Handle error
+} else {
+ printf("Checksum for the ELF64 object: %u\n", checksum);
+}
+.in -4
+.fi
+
+.SH SEE ALSO
+.BR elf (3),
+.BR elf32_checksum (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.
+