From: Aaron Merey Date: Fri, 5 Sep 2025 15:16:57 +0000 (-0400) Subject: doc: Add elf_gnu_hash.3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3676da22da806a3c8c5948311b0c8ce17c8d5fd8;p=thirdparty%2Felfutils.git doc: Add elf_gnu_hash.3 Signed-off-by: Aaron Merey --- diff --git a/doc/Makefile.am b/doc/Makefile.am index 41bf6c70..43576db4 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -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 index 00000000..d87463f1 --- /dev/null +++ b/doc/elf_gnu_hash.3 @@ -0,0 +1 @@ +.so man3/elf_hash.3 diff --git a/doc/elf_hash.3 b/doc/elf_hash.3 index 1e06d888..275a701f 100644 --- a/doc/elf_hash.3 +++ b/doc/elf_hash.3 @@ -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 .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 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.