+static Sym *gnu_lookup(const char *s, uint32_t h1, struct dso *dso)
+{
+ Sym *sym;
+ char *strings;
+ uint32_t *hashtab = dso->ghashtab;
+ uint32_t nbuckets = hashtab[0];
+ uint32_t *buckets = hashtab + 4 + hashtab[2]*(sizeof(size_t)/4);
+ uint32_t h2;
+ uint32_t *hashval;
+ uint32_t n = buckets[h1 % nbuckets];
+
+ if (!n) return 0;
+
+ strings = dso->strings;
+ sym = dso->syms + n;
+ hashval = buckets + nbuckets + (n - hashtab[1]);
+
+ for (h1 |= 1; ; sym++) {
+ h2 = *hashval++;
+ if ((h1 == (h2|1)) && !strcmp(s, strings + sym->st_name))
+ return sym;
+ if (h2 & 1) break;
+ }
+
+ return 0;
+}
+