diff options
Diffstat (limited to 'elf/elf_utils.c')
-rw-r--r-- | elf/elf_utils.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/elf/elf_utils.c b/elf/elf_utils.c index b96d1ec6..157dc2a8 100644 --- a/elf/elf_utils.c +++ b/elf/elf_utils.c @@ -14,3 +14,14 @@ unsigned long elf_hash(const unsigned char *name) { return h; } + +unsigned long elf_gnu_hash(const unsigned char *name) { + unsigned long h = 5381; + unsigned char c; + + for (c = *name; c != '\0'; c = *++name) { + h = h * 33 + c; + } + + return h & 0xFFFFFFFF; +} |