Binary compatibility loss regarding errno
Jakub Jelinek
jakub@redhat.com
Mon Dec 23 12:29:00 GMT 2002
On Mon, Dec 23, 2002 at 01:38:30PM -0500, Daniel Jacobowitz wrote:
> On Mon, Dec 23, 2002 at 10:15:44AM -0800, Ulrich Drepper wrote:
> > Daniel Jacobowitz wrote:
> >
> > > No, it IS silent. Feel free to try it yourself,
> >
> > I did:
> >
> >
> > $ ~/u
> > /home/drepper/u: relocation error: /home/drepper/u: symbol errno,
> > version GLIBC_2.0 not defined in file libc.so.6 with link time reference
> >
> >
> > I don't know what setup you are using but it works for me.
>
> csu/Versions:
>
> GLIBC_2.0 {
> %if !(USE_TLS && HAVE___THREAD)
> # global variables
> _errno;
>
> # variables in normal name space
> errno;
> %endif
> }
>
> GLIBC_PRIVATE {
> %if USE_TLS && HAVE___THREAD
> # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol.
> errno;
> %endif
>
> So if you don't turn on TLS you get an errno that silently breaks. If
> we don't have TLS why can't we maintain compatibility?
Well, it is supposed to work if --without-__thread or --without-tls.
Unfortunately it does not; it is unclear whether this is linker bug
(where if there is just errno@GLIBC_2.0 in the library, it makes the .got
entry for it R_386_RELATIVE and not R_386_32 errno@GLIBC_2.0) or whether
glibc is just asking too much.
Anyway, I still think glibc .so static link only wrappers and keeping
errno@@GLIBC_2.0 etc. would be best (and most tolerant to linkers).
E.g. on SPARC it was not possible to build current glibc (with the
patch I posted yesterday) with binutils 2.13.90.0.2, one has to use
2.13.90.0.16 or above. Otherwise ld completely messed up symbol versions
in libpthread.so, apparently because in libc.so there is
pthread_attr_init@GLIBC_2.0 and pthread_attr_init@GLIBC_2.1 while in
libpthread.so should be pthread_attr_init@GLIBC_2.0 and
pthread_attr_init@@GLIBC_2.1.
Jakub
More information about the Libc-alpha
mailing list