"David O'Brien" wrote:
> On Thu, Jul 06, 2000 at 06:05:50PM -0700, Peter Wemm wrote:
> > This is *not* the same as the a.out behavior which searched directories to
> > find the largest number. ELF uses the symlinks and no searching, which is
> > why ld and ld-elf.so is faster when locating directories and does not need
> > ldconfig or the ld.so.cache.
>
> Correct me if I am wrong, ld-elf.so does still need ldconfig. And
> ld-elf.so does not use the symlink (if it did compat libs would not
> work).
The ELF ldconfig does nothing except set the default search path for
finding libraries:
peter@t8000[12:54am]~-183> hd /var/run/ld-elf.so.hints
00000000 45 68 6e 74 01 00 00 00 80 00 00 00 37 00 00 00 |Ehnt........7...|
00000010 00 00 00 00 36 00 00 00 00 00 00 00 00 00 00 00 |....6...........|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000080 2f 75 73 72 2f 6c 69 62 3a 2f 75 73 72 2f 6c 69 |/usr/lib:/usr/li|
00000090 62 2f 63 6f 6d 70 61 74 3a 2f 75 73 72 2f 58 31 |b/compat:/usr/X1|
000000a0 31 52 36 2f 6c 69 62 3a 2f 75 73 72 2f 6c 6f 63 |1R6/lib:/usr/loc|
000000b0 61 6c 2f 6c 69 62 00 |al/lib.|
ld(1) resolves the symlinks. ld-elf.so.1 searches for the full filename
in the directory path from ldconfig -elf.
objdump --all-headers /usr/bin/vi:
...
Dynamic Section:
NEEDED libncurses.so.5
NEEDED libc.so.4
..
All ld-elf.so.1 has to do is look for the first one of:
/usr/lib/libc.so.4
/usr/lib/compat/libc.so.4
/usr/X11R6/lib/libc.so.4
/usr/local/lib/libc.so.4
This is just done with a series of open(2) calls and is very cheap. The
first one it can open it uses.
Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
"All of this is for nothing if we don't go to the stars" - JMS/B5
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message