In article <[EMAIL PROTECTED]>,
 Gerard Beekmans <[EMAIL PROTECTED]> wrote:

> On July 23, 2005 07:32 pm, Matt Bartley wrote:
> 
> <snip>
> >       [Requesting program interpreter: /lib/ld-linux-so.2]

> That looks fine.
> 
> Let's track it down from there. /lib/ld-linux.so.2 (inside chroot,
> so make sure when you check this out you're looking in the right
> directory) is a symlink to the read dynamic linker. If you're using
> the latest LFS book that would be /lib/ld-2.3.5.so

Indeed it is.

# ls -l /lib/ld-linux-so.2 /lib/libc.so.6
lrwxrwxrwx  1 root root 11 Jul 21 21:17 /lib/ld-linux-so.2 -> ld-2.3.5.so
lrwxrwxrwx  1 root root 11 Jul 21 21:17 /lib/libc.so.6 -> libc-2.3.5.so

The output of "ldconfig -v" looks normal, too.

> When you try to run the a.out program, it will try to laod 
> /lib/ld-linux.so.2. 
>
> If this symlink isn't set correctly, it's going to fail with a "No
> such file or directory" error. It's refering to the ld-linux.so.2
> file, not a.out although the error itself doesn't hint to it. It's a
> bit confusing.
>
> Does your symlink exist and does it point to something valid (run ls
> -l /lib/ld-linux.so.2 to verify)? You should be able to run it just
> like any other program. When you execute /lib/ld-linux.so.2, what
> happens?

It gives a help screen, starting something like this:
Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
......

And if I run
# /lib/ld-linux.so.2 a.out
a.out: error while loading shared libraries: a.out: cannot open shared
 object file: No such file or directory
# echo $?
127

A couple more observations.  If I copy (simple libc-dependent-only)
binaries over from my host system, they run fine under the LFS chroot
tree.  I have also tried typing up "hello world" programs in LFS,
compiling them to a .o file using LFS's gcc-4.0.1, copying the
resulting hello.o to my host system, then linking it there to the
final executable, then copying that back to the LFS system.  Works
fine.  There sure seems to be something screwy with the compile-time
linker in LFS.

Also, this problem doesn't happen if I build LFS-6.1 or LFS-development.

OT: I read these groups through the NNTP interface, but it won't let
me post that way any more.  Following these threads is a pain.

-- 
"Life's not fair, but the root password helps." -- BOFH
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to