From owner-freebsd-emulation@FreeBSD.ORG Mon Sep 11 07:36:37 2006 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 76B9516A415; Mon, 11 Sep 2006 07:36:37 +0000 (UTC) (envelope-from Alexander@Leidinger.net) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id A78BA43D45; Mon, 11 Sep 2006 07:36:36 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from Andro-Beta.Leidinger.net (p54A5E294.dip.t-dialin.net [84.165.226.148]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.6/8.13.6) with ESMTP id k8B7EtEA085761; Mon, 11 Sep 2006 09:14:56 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from localhost (webmail.Leidinger.net [192.168.1.102]) by Andro-Beta.Leidinger.net (8.13.4/8.13.3) with ESMTP id k8B7aRsG003973; Mon, 11 Sep 2006 09:36:27 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from psbru.cec.eu.int (psbru.cec.eu.int [158.169.131.14]) by webmail.leidinger.net (Horde MIME library) with HTTP; Mon, 11 Sep 2006 09:36:16 +0200 Message-ID: <20060911093616.wnfgseoyogocgksw@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Mon, 11 Sep 2006 09:36:16 +0200 From: Alexander Leidinger To: Intron is my alias on the Internet References: <45041321.6030003@SYSTEM.PL> <20060910181928.342eefaf@Magellan.Leidinger.net> <45045617.9010508@SYSTEM.PL> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.3) / FreeBSD-7.0 X-Virus-Scanned: by amavisd-new Cc: Marcin Cieslak , freebsd-emulation@freebsd.org, bsam@freebsd.org Subject: Re: /lib/ld-linux.so.2: cannot execute binary file: fix propsal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 07:36:37 -0000 Quoting Intron is my alias on the Internet (from Mon, =20 11 Sep 2006 14:39:32 +0800): > Marcin Cieslak wrote: > >> Alexander Leidinger wrote: >> >>>> >>>> In general, I guess ELF shared libraries should be Linux branded as wel= l? >>> >>> No, this will not work. You can't start apps which are linked to shared >>> libs anymore after this. The linux linker expects the to be branded >>> differently than what you propose here (been there done that months or >>> years ago). >> >> This probably leads to commit/revert wars like http://42.pl/u/lAF :) This was not a war. I did brand libs myself and had to revert it too. =20 It's a pitfall. >> I have branded /compat/linux/lib/ld-2.3.6.so and it seems >> to work for me(tm). >> >> It would be anyway interesting to know more about branding and its quirks= . >> >> --=20 >> << Marcin Cieslak // saper@system.pl >> > > Please note that ld-2.3.3.so and ld-linux.so.2 point to a unique file: > > -rwxr-xr-x 1 root wheel 98176 4 1 00:52 ld-2.3.3.so > lrwxrwxrwx 1 root wheel 11 4 1 00:53 ld-linux.so.2 -> ld-2.3.3.s= o > > ld-linux.so.2 is loaded by FreeBSD kernel when a Linux ABI is executed. > At the same time, FreeBSD kernel can recognize various brand numbers: > > #brandelf -l > known ELF types are: FreeBSD(9) Linux(3) Solaris(6) SVR4(0) > > But this doesn't mean ld-linux.so.2 can recogize various brand numeric > indications of shared libraries other than ld-linux.so.2. If you mark > libc.so.6 with brand "3", you will get: > > #/compat/linux/bin/ls /compat/linux/bin/ls: error while loading shared > libraries: /lib/libc.so.6: ELF file OS ABI invalid > > When you re-mark libc.so.6 with brand "0", it will work again: > > #brandelf -f 0 libc.so.6 #/compat/linux/bin/ls > ... ... > > This problem should be owed to ld-linux.so.2, the Linux dynamical linker, > not to FreeBSD kernel. Maybe we should only brand ld-linux.so.2 but no other libs. Maybe this =20 will work. Boris, we should play around with this and see if something =20 breaks. If not, we should commit this and close the corresponding PR =20 (linux ldd doesn't work). I don't know if I get time for this before =20 the WE. Bye, Alexander. --=20 HOLY MACRO! http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137