Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Aug 2006 17:10:26 -0600
From:      John E Hein <jhein@timing.com>
To:        Boris Samorodov <bsam@ipt.ru>
Cc:        Alexander Leidinger <Alexander@Leidinger.net>, freebsd-emulation@freebsd.org, Markus Hoenicka <markus.hoenicka@mhoenicka.de>
Subject:   Re: ports/102474: linux_base-fc-4_8 appears broken, does not allow to run Linux binaries
Message-ID:  <17646.12770.712906.640034@gromit.timing.com>
In-Reply-To: <48492411@bsam.ru>
References:  <E1GGL6p-0000Bd-2Z@bsam.ru> <17646.3029.176290.711490@yeti.mininet> <80657181@bsam.ru> <17646.6613.28038.72832@yeti.mininet> <14575472@bsam.ru> <17646.7832.330245.660064@yeti.mininet> <48492411@bsam.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Boris Samorodov wrote at 02:28 +0400 on Aug 25, 2006:
 > Aha, /compat/linux/usr/bin/ldd is a script. Can't say for sure should
 > it work or not but something strange does exist:
 > -----
 >  24546 ktrace   RET   ktrace 0
 >  24546 ktrace   CALL  execve(0xbfbfe85e,0xbfbfe75c,0xbfbfe768)
 >  24546 ktrace   NAMI  "/compat/linux/usr/bin/ldd"
 >  24546 ktrace   NAMI  "/bin/sh"
 >  24546 ktrace   NAMI  "/libexec/ld-elf.so.1"
 >  24546 sh       RET   execve 0

                         ^^^^ you probably get something different if
                         you use linux_kdump?

As far as ldd goes, it calls ld-linux.so.2 (yes, the lib is
executable) which is a sym link to ld-2.3.6.so

file /compat/linux/lib/ld-2.3.6.so
/compat/linux/lib/ld-2.3.6.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped

Note the improper brandelf if it were to be run as an executable
(should be GNU/Linux, not SYSV).

You could copy ld-2.3.6.so to somewhere else, brandelf -t Linux it (I
wouldn't do that to the real /compat/linux/lib/ld-2.3.6.so), and tell
the ldd script to use that version.

It would probably be best to run the script with bash rather than
FreeBSD's sh.  I suspect there are bash-specific idioms in that
script.

I tried that and ld-2.3.6.so returns funky results (not surprising)...

/tmp/ld-2.3.6.so --verify /compat/linux/bin/bash ; echo $?
1


On a real linux box:

/lib/ld-2.3.6.so --verify /bin/bash ; echo status: $?
6
status: 0


To get /compat/linux/lib/ld-linux.so.2 (and thus
/compat/linux/usr/bin/ldd) working in the emulated environment would
probably take some hacking.  I vaguely recall this being discussed
before?


To the OP, why not just use native FreeBSD ldd?

ldd /compat/linux/bin/bash
/compat/linux/bin/bash:
        libtermcap.so.2 => /lib/libtermcap.so.2 (0x28109000)
        libdl.so.2 => /lib/libdl.so.2 (0x2810e000)
        libc.so.6 => /lib/obsolete/linuxthreads/libc.so.6 (0x28112000)
        /lib/ld-linux.so.2 (0x280e9000)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?17646.12770.712906.640034>