]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
doc: Add elf_gnu_hash.3
authorAaron Merey <amerey@redhat.com>
Fri, 5 Sep 2025 15:16:57 +0000 (11:16 -0400)
committerAaron Merey <amerey@redhat.com>
Fri, 5 Sep 2025 16:41:48 +0000 (12:41 -0400)
Signed-off-by: Aaron Merey <amerey@redhat.com>
doc/Makefile.am
doc/elf_gnu_hash.3 [new file with mode: 0644]
doc/elf_hash.3

index 41bf6c707f36969ddf217936f5e47bd13ce820f8..43576db427d1b4be7254f4c2515fa30d1b76f97e 100644 (file)
@@ -70,6 +70,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \
                        elf_getshnum.3 \
                        elf_getshstrndx.3 \
                        elf_hash.3 \
+                       elf_gnu_hash.3 \
                        elf_kind.3 \
                        elf_ndxscn.3 \
                        elf_nextscn.3 \
diff --git a/doc/elf_gnu_hash.3 b/doc/elf_gnu_hash.3
new file mode 100644 (file)
index 0000000..d87463f
--- /dev/null
@@ -0,0 +1 @@
+.so man3/elf_hash.3
index 1e06d88895e5f1c45e683abe79d962c32c69e655..275a701f27d7155c8509e5860cb3213eed8f0940 100644 (file)
@@ -1,13 +1,14 @@
 .TH ELF_HASH 3 2025-03-31 "Libelf" "Libelf Programmer's Manual"
 
 .SH NAME
-elf_hash \- Compute the standard ELF hash of a string.
+elf_hash, elf_gnu_hash \- Compute the standard ELF hash or GNU hash of a string.
 
 .SH SYNOPSIS
 .nf
 #include <libelf.h>
 
 .BI "unsigned long int elf_hash(const char *" string ");"
+.BI "unsigned long int elf_gnu_hash(const char *" string ");"
 
 .SH DESCRIPTION
 The
@@ -18,13 +19,20 @@ 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.
 
+The
+.BR elf_gnu_hash
+function computes the GNU-style hash value of a null-terminated string,
+used in the
+.B SHT_GNU_HASH
+section.
+
 .SH PARAMETERS
 .TP
 .I string
 NULL-terminated string to be hashed.
 
 .SH RETURN VALUE
-This function returns the standard ELF hash value for
+These functions return a hash value for
 .IR string .
 Only the lower 32 bits of the return value are used.
 
@@ -43,9 +51,14 @@ Interface    Attribute       Value
 T{
 .na
 .nh
-.BR elf_hash ()
+.BR elf_hash (),\~elf_gnu_hash ()
 T}     Thread safety   MT-Safe
 .TE
 
 .SH REPORTING BUGS
 Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.
+
+.SH HISTORY
+.B elf_gnu_hash
+first appeared in elfutils 0.122.  This function is a elfutils libelf extension and
+may not be available in other libelf implementations.