bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need som help on ld with internal versioning on Solaris/Sparc


From: Ivan Skytte Jørgensen
Subject: Need som help on ld with internal versioning on Solaris/Sparc
Date: Thu, 03 Oct 2002 13:02:48 +0200

Hi, I have a slight problem with ld in combination with shared libraries
and symbols with internal versioning. I am not even sure if this is a
bug because I don't know the details on ELF format and what a
linker/loader is supposed to do. (I am in way over my head...)

OS: Solaris 8
Platform: Sparc 32
Format: ELF
binutils version: 2.11 and 2.13


I have a shared library that calls pthread_atfork()
The library is correctly linked with libpthread.so:
$ ldd libims.so
        libpthread.so.1 =>       /usr/lib/libpthread.so.1
...
        libc.so.1 =>     /usr/lib/libc.so.1
...
        libthread.so.1 =>        /usr/lib/libthread.so.1
        /usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1

And pthread_atfork() is in /usr/lib/libpthread.so:
$  nm /usr/lib/libpthread.so|fgrep pthread_atfork
00003d18 T _pthread_atfork
00003d18 W pthread_atfork

And the library refers to a specific version of pthread_atfork():
$ nm libims.so |fgrep pthread_atfork
         U pthread_atfork@@SUNW_0.9

And everything works just fine.

Well... until one of our partners tried linking with the library on a
machine which has some of the latest Solaris patches installed. It seems
that pthread_atfork() has been moved from /usr/lib/libpthread.so to
/usr/lib/libc.so:
$ nm /usr/lib/libpthread.so|fgrep pthread_atfork
$

And when our partner tries linking their program:
g++ .... -L. -lims ... 
...libims.so: undefined reference to address@hidden'
collect2: ld returned 1 exit status


Now, this is obviously a problem. But I don't know where the problem is.
Questions:
 1: Why does ld insert a reference to a specific version of
pthread_atfork() ?
 2: Is it a bug that ld cannot find pthread_atfork() in libc.so ? (I
don't know what ld is supposed to do)
 3: Is it Sun that has made an incompatible change in their patches?

If I only knew the ELF format better I could probably solve this problem
myself.
I can provide output from readelf from both systems, if this is needed.


Regards,
  Ivan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]