From owner-freebsd-current Sat Jul 8 23:17:10 2000 Delivered-To: freebsd-current@freebsd.org Received: from netplex.com.au (adsl-63-207-30-186.dsl.snfc21.pacbell.net [63.207.30.186]) by hub.freebsd.org (Postfix) with ESMTP id 1C0CD37C153; Sat, 8 Jul 2000 23:17:02 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from netplex.com.au (peter@localhost [127.0.0.1]) by netplex.com.au (8.9.3/8.9.3) with ESMTP id XAA04560; Sat, 8 Jul 2000 23:17:00 -0700 (PDT) (envelope-from peter@netplex.com.au) Message-Id: <200007090617.XAA04560@netplex.com.au> X-Mailer: exmh version 2.1.1 10/15/1999 To: obrien@FreeBSD.ORG Cc: current@FreeBSD.ORG Subject: Re: HEADS UP: cvs commit: src/lib/libftpio Makefile (fwd) In-Reply-To: Message from "David O'Brien" of "Sat, 08 Jul 2000 18:40:28 PDT." <20000708184028.C26711@dragon.nuxi.com> Date: Sat, 08 Jul 2000 23:17:00 -0700 From: Peter Wemm Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "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 - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message