how does it work inside?
, GLIBC struct link_map, , , DT_HASH DT_GNU_HASH , dlsym - .
, dlsym()?
. , . , () : , , - .dynsym .dynstr , ( , "foo")
const char *strtab = ...
const ElfW(Sym) *sym = ...
for (; sym < end_of_dynsym; ++sym) {
if (strcmp(strtab + sym->st_name, "foo") == 0) {
return load_address + sym->st_value;
}
}
return NULL;
(dlsym ), .hash .gnu_hash, . .