Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Sep 2006 09:36:16 +0200
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        Intron is my alias on the Internet <mag@intron.ac>
Cc:        Marcin Cieslak <saper@SYSTEM.PL>, freebsd-emulation@freebsd.org, bsam@freebsd.org
Subject:   Re: /lib/ld-linux.so.2: cannot execute binary file: fix propsal
Message-ID:  <20060911093616.wnfgseoyogocgksw@webmail.leidinger.net>
In-Reply-To: <courier.450504A4.00010E53@intron.ac>
References:  <45041321.6030003@SYSTEM.PL> <20060910181928.342eefaf@Magellan.Leidinger.net> <45045617.9010508@SYSTEM.PL> <courier.450504A4.00010E53@intron.ac>

index | next in thread | previous in thread | raw e-mail

Quoting Intron is my alias on the Internet <mag@intron.ac> (from Mon,  
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 well?
>>>
>>> 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.  
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.
>>
>> -- 
>>              << 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.so
>
> 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  
will work. Boris, we should play around with this and see if something  
breaks. If not, we should commit this and close the corresponding PR  
(linux ldd doesn't work). I don't know if I get time for this before  
the WE.

Bye,
Alexander.

-- 
HOLY MACRO!

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137



help

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