]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
doc: Add elf_hash.3
authorAaron Merey <amerey@redhat.com>
Tue, 13 May 2025 00:33:40 +0000 (20:33 -0400)
committerAaron Merey <amerey@redhat.com>
Wed, 14 May 2025 18:47:46 +0000 (14:47 -0400)
Signed-off-by: Aaron Merey <amerey@redhat.com>
doc/Makefile.am
doc/elf_hash.3 [new file with mode: 0644]

index 00cdc25385cfde9cb4a59e7391318e26f669b60e..343b5460e33a076ee23af3816751251b8e548a48 100644 (file)
@@ -58,6 +58,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \
                        elf_getbase.3 \
                        elf_getdata.3 \
                        elf_getscn.3 \
+                       elf_hash.3 \
                        elf_ndxscn.3 \
                        elf_update.3 \
                        elf_version.3 \
diff --git a/doc/elf_hash.3 b/doc/elf_hash.3
new file mode 100644 (file)
index 0000000..1e06d88
--- /dev/null
@@ -0,0 +1,51 @@
+.TH ELF_HASH 3 2025-03-31 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+elf_hash \- Compute the standard ELF hash of a string.
+
+.SH SYNOPSIS
+.nf
+#include <libelf.h>
+
+.BI "unsigned long int elf_hash(const char *" string ");"
+
+.SH DESCRIPTION
+The
+.B elf_hash
+function computes the standard ELF hash value for a null-terminated
+string.  The hash values are typically used in ELF object files for
+symbol table hashing.  The hash function is used in SHT_HASH sections as
+it avoids generating architecture-dependent values and is suitable for use
+across architectures.
+
+.SH PARAMETERS
+.TP
+.I string
+NULL-terminated string to be hashed.
+
+.SH RETURN VALUE
+This function returns the standard ELF hash value for
+.IR string .
+Only the lower 32 bits of the return value are used.
+
+.SH SEE ALSO
+.BR libelf (3),
+.BR elf (5)
+
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface      Attribute       Value
+T{
+.na
+.nh
+.BR elf_hash ()
+T}     Thread safety   MT-Safe
+.TE
+
+.SH REPORTING BUGS
+Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.