This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gold not finding symbols in ld-linux.so.2


Eric Frias <efrias@syncad.com> writes:

>> My guess
>> is that this reference is coming from a static archive portion of
>> libpthread (/usr/lib/libpthread_nonshared.a) -- is your
>> /usr/lib/libpthread.so just a text file that contains something like
>> the following?
>>
>>     GROUP ( /lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a )
>>   
> As far as I can tell, libpthread is just a plain shared library.  "ld
> -verbose" reports finding /usr/lib/libpthread.so, which is a symlink
> to /lib/libpthread.so.0 which itself is a symlink to
> /lib/libpthread-0.9.so, which is a ELF 32-bit LSB shared object.  If I
> trace the DT_NEEDED attributes, they are exactly as you said:
>
> $ readelf -d /lib/libpthread-0.9.so | grep NEEDED
> 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
> $ readelf -d /lib/libc.so.6 | grep NEEDED
> 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]

You looked at /lib/libpthread-0.9.so, but the linker will never see
that under that name.  Look for libpthread.so, without the 0-9.  It
may be in /usr/lib.

> Good to hear I'm not the only one.  Is there a recommended workaround?
> I haven't worked with linker scripts before... Is this as simple as
> creating a text file containing "GROUP ( /lib/libpthread-0.9.so
> /lib/ld-linux.so.2 )" and placing it somewhere before all of the real
> pthread libraries in my link path?

You probably already have such a file.  The fix may be as simple as
adding /lib/ld-linux.so.2 to the GROUP in the existing file.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]