This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

ld-linux.so.2 cannot process libpthread.so.0


Hi,
I'm working to get a multithreaded program to run on an AMD Elan SC520
(i586) single board computer.  For some reason the dynamic linker
doesn't successfully process libpthread.so.0.  When I try to execute
my program (a simple hello-world using a thread), it gives the error:
"hellothread: error while loading shared libraries: libpthread.so.0:
cannot open shared object file: No such file or directory".

I ran strace on my program (output listed below).  It shows that
ld-linux.so.2 actually does find, open, and read libpthread.so.0. 
However after reading it closes it immediately (no mmap calls) and
continues searching for another libpthread.so.0, which it doesn't
find.  This tells me that there is something about the library that
ld-linux.so.2 doesn't like.

The version of libpthread.so.0 I'm using was copied from my Mandriva
development machine (Pentium M laptop).  Before copying to the AMD
Elan board, I tested my target root filesystem on the laptop using
chroot.  When I run the program from the chroot environment everything
works fine.  So the linker seems to be setup correctly (directories,
env variables, etc)

Is there a reason that the libpthread.so.0 from my Mandriva
distribution wouldn't work when copied onto the AMD Elan board?  For
what reasons will ld-linux.so.2 reject the contents of
libpthread.so.0?  I've been stuck on this for a couple of days so any
suggestions are appreciated!

Thanks,
Mark

--- begin strace output ---
execve("/usr/bin/hellothread", ["hellothread"], [/* 8 vars */]) = 0
uname({sys="Linux", node="mbds1", ...}) = 0
brk(0)                                  = 0x804a000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("/lib/tls/i486/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/lib/tls/i486", 0xbffff4fc)     = -1 ENOENT (No such file or directory)
open("/lib/tls/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@H\0\000"..., 512) = 512
close(3)                                = 0
stat64("/lib/tls", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
open("/lib/i486/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat64("/lib/i486", 0xbffff4fc)         = -1 ENOENT (No such file or directory)
open("/lib/libpthread.so.0", O_RDONLY)  = -1 ENOENT (No such file or directory)
stat64("/lib", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
open("/usr/lib/tls/i486/libpthread.so.0", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/usr/lib/tls/i486", 0xbffff4fc) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/usr/lib/tls", 0xbffff4fc)      = -1 ENOENT (No such file or directory)
open("/usr/lib/i486/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/usr/lib/i486", 0xbffff4fc)     = -1 ENOENT (No such file or directory)
open("/usr/lib/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat64("/usr/lib", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
writev(2, [{"hellothread", 11}, {": ", 2}, {"error while loading
shared libra"..., 36}, {": ", 2}, {"libpthread.so.0", 15}, {": ", 2},
{"cannot open shared object file", 30}, {": ", 2}, {"No such file or
directory", 25}, {"\n", 1}], 10hellothread: error while loading shared
libraries: libpthread.so.0: cannot open shared object file: No such
file or directory
) = 126
exit_group(127)                         = ?
-- end strace output ---


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