Make sur elf_hash is never invoked with a NULL value.
Unified · Split
| @@ -114,7 +114,7 @@ ST_FUNC int put_elf_sym(Section *s, uplong value, unsigned long size, · 113 unmodified lines | ||
| 114 | 114 | if (ELFW(ST_BIND)(info) != STB_LOCAL) { |
| 115 | 115 | /* add another hashing entry */ |
| 116 | 116 | nbuckets = base[0]; |
| 117 | − h = elf_hash(name) % nbuckets; | |
| 117 | + h = name ? elf_hash(name) % nbuckets : 0; | |
| 118 | 118 | *ptr = base[2 + h]; |
| 119 | 119 | base[2 + h] = sym_index; |
| 120 | 120 | base[1]++; |