ld.so needs __errno_location PLT entry?
Roland McGrath
roland@redhat.com
Sun Sep 29 15:41:00 GMT 2002
Unless I am missing something, I think ld.so needs to have a PLT entry for
__errno_location. This bites fatally on Hurd, where the implementations of
read et al must come from libc.so and so the real errno must be found by
ld.so's calls to see any values at all. On Linux with PLT reduction it
never matters to communicate an errno value between libc and ld.so, so
always getting ld.so's private errno cell is fine most of the time. But
there is only one private cell, so ld.so's uses of it are not thread-safe.
I am not positive off hand that every possible access to errno inside ld.so
happens with _dl_load_lock held. If so, then it's ok. But that is
certainly a subtlety that requires some comments somewhere.
More information about the Libc-hacker
mailing list