If I change that ELF_RTYPE_CLASS_COPY to ELF_RTYPE_CLASS_PLT to tell
_dl_find_hash to ignore stubs when resolving undefined functions without
stubs, the dlopen tests all pass. dlopen gets a pointer to the libc.so
malloc instead of a pointer to the libpthread malloc stub. Yay! :-)
*got_entry = sym->st_value + (unsigned long) tpnt->loadaddr;
else {
*got_entry = (unsigned long) _dl_find_hash(strtab +
- sym->st_name, tpnt->symbol_scope, ELF_RTYPE_CLASS_COPY);
+ sym->st_name, tpnt->symbol_scope, ELF_RTYPE_CLASS_PLT);
}
}
else if (sym->st_shndx == SHN_COMMON) {