/* The hash algorithm used in the UNIX ELF format for object files.
The input is a pointer to a string to be hashed */
#define HASHSIZE 997
unsigned long ElfHash( const unsigned char *name)
{
unsigned long h = 0, g;
static int M = HASHSIZE;
while (*name)
{
h = ( h << 4 ) + *name++;
if (g = h & 0xF0000000L)
h ^= g >> 24;
h &= ~g;
}
return h % M;
}