aboutsummaryrefslogtreecommitdiffstats
path: root/elf/elf_utils.c
blob: b96d1ec6fc378ea707215e7260dbcda20633b242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "elf_utils.h"

unsigned long elf_hash(const unsigned char *name) {
	unsigned long h = 0;
	unsigned long g;
	
	while (*name) {
		h = (h << 4) + *name++;
		if ((g = h & 0xF0000000))
			h ^= g >> 24;
		
		h &= ~g;
	}
	
	return h;
}