Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115988641
D39517.id120193.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
942 B
Referenced Files
None
Subscribers
None
D39517.id120193.diff
View Options
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) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 2, 6:46 AM (20 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17900570
Default Alt Text
D39517.id120193.diff (942 B)
Attached To
Mode
D39517: rtld: fix SysV hash function overflow
Attached
Detach File
Event Timeline
Log In to Comment