Index: sys/kern/link_elf.c =================================================================== --- sys/kern/link_elf.c +++ sys/kern/link_elf.c @@ -1470,23 +1470,19 @@ } /* - * Hash function for symbol table lookup. Don't even think about changing - * this. It is specified by the System V ABI. + * SysV hash function for symbol table lookup. */ -static unsigned long +static uint32_t elf_hash(const char *name) { const unsigned char *p = (const unsigned char *) name; unsigned long h = 0; - unsigned long g; while (*p != '\0') { h = (h << 4) + *p++; - if ((g = h & 0xf0000000) != 0) - h ^= g >> 24; - h &= ~g; + h ^= (h >> 24) & 0xf0; } - return (h); + return (h & 0x0fffffff); } static int @@ -1497,7 +1493,7 @@ unsigned long symnum; const Elf_Sym* symp; const char *strp; - unsigned long hash; + uint32_t hash; /* If we don't have a hash, bail. */ if (ef->buckets == NULL || ef->nbuckets == 0) {