----- Original Message ----- From: "Richard Sandiford" <rsandifo@xxxxxxxxxx> To: "Bradley D. LaRonde" <brad@xxxxxxxxxxx> Cc: <uclibc@xxxxxxxxxx>; <linux-mips@xxxxxxxxxxxxxx> Sent: Monday, May 10, 2004 2:21 PM Subject: Re: uclibc mips ld.so and undefined symbols with nonzero symbol table entry st_value > "Bradley D. LaRonde" <brad@xxxxxxxxxxx> writes: > > Even though it is pointing libdl to the libpthread stub for malloc, should > > it crash? > > Yeah. When you call a stub, $gp must already be set to the owning > object's _gp. That's how the dynamic loader knows which GOT to change. > > In your case, libdl will be calling libpthread's stub with $gp set to > libdl's _gp. The dynamic loader will therefore end up trying to change > libdl's GOT, not libpthread's. I read this in the spec: All externally visible symbols, both defined and undefined, must be hashed into the hash table. Should libpthread's malloc stub be added to the hash table? I guess not, but I think that might be happening (haven't verified), and libdl finding it in there and thinking it is the real deal, not realizing it is just a stub. Regards, Brad