[uClibc] Re: uclibc mips ld.so and undefined symbols with nonzerosymbol table entry st_value
Joakim Tjernlund
Joakim.Tjernlund at lumentis.se
Tue May 11 05:48:27 UTC 2004
>
> uClibc/ldso/ldso/mips/elfinterp.c around line 288 looks like this:
>
>
> /* Relocate the global GOT entries for the object */
> while(i--) {
> if (sym->st_shndx == SHN_UNDEF) {
> if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && sym->st_value)
> *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);
> }
> }
>
>
> 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! :-)
>
> Does that look like the correct fix?
Hopefully, when I added ELF_RTYPE_CLASS_COPY/ELF_RTYPE_CLASS_PLT stuff I had to
guess what to do with MIPS. After that several minor error has been fixed by
changing these bits.
Jocke
More information about the uClibc
mailing list