Subject: Re: how to use crosscompiler?
To: None <tech-toolchain@netbsd.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: tech-toolchain
Date: 02/04/2004 16:00:05
On Wed, Feb 04, 2004 at 12:49:58 +0000, Nick Hudson wrote:

> > How about we do this:
> >     *	use absolute symlinks for the runtime libraries
> >     	libfoo.so.M and libfoo.so.M.N.
> >     *	use relative symlinks for the link-time library libfoo.so.
> > ?
> >
> > This would result in:
> > 	usr/lib/libz.so		-> ../../lib/libz.so
> > 	usr/lib/libz.so.0	-> /lib/libz.so.0
> > 	usr/lib/libz.so.0.3	-> /lib/libz.so.0.3
> 
> I think
> 
> 	usr/lib/libz.so	-> ../../lib/libz.so
> 	usr/lib/libz.so.0	-> /lib/libz.so.0.3
> 
> is all that is needed.
> 
> ld.elf_so uses the soname to find the library and I can't think of anything 
> that directly references the real library object.

On a somewhat tangetial note, but I actually meant to ask this for a
long time.   Why we have:


$ ldd /bin/ls /usr/bin/find 
/bin/ls:
         -lc.12 => /lib/libc.so.12
/usr/bin/find:
         -lc.12 => /usr/lib/libc.so.12

Why incur a symlink traversal lookup on all /usr/* binaries?

Oh, and also:

$ readelf -a /bin/ls /usr/bin/find | grep interpreter
      [Requesting program interpreter: /libexec/ld.elf_so]
      [Requesting program interpreter: /usr/libexec/ld.elf_so]

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen