From owner-freebsd-hackers Tue Oct 27 06:01:41 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA20000 for freebsd-hackers-outgoing; Tue, 27 Oct 1998 06:01:41 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ics.com (ics.com [140.186.40.192]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA19995 for ; Tue, 27 Oct 1998 06:01:39 -0800 (PST) (envelope-from kaleb@ics.com) Received: from ics.com (sunoco.ics.com [140.186.40.142]) by ics.com (8.9.0.Beta5/8.9.0.Beta5) with ESMTP id JAA19539 Tue, 27 Oct 1998 09:00:59 -0500 (EST) Message-ID: <3635D21B.961D038@ics.com> Date: Tue, 27 Oct 1998 09:00:59 -0500 From: "Kaleb S. KEITHLEY" Organization: Integrated Computer Solutions X-Mailer: Mozilla 4.5 [en] (X11; I; SunOS 5.5.1 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: hackers@FreeBSD.ORG Subject: Re: ld for loading dynamic library changed in 3.0-RELEASE? References: <98Oct26.192829edt.37768-3361@qew.cs.toronto.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG David Holland wrote: > > > On that note one thing I've noticed is that the ELF ld refuses to > > recognize shared libs unless they end in .so. What would the chances be > > of having it check for libfoo.so.x where x is the greatest value (assuming > > libfoo.so doesn't exist)? This is rather annoying, as the a.out ld > > doesn't do this, and the Linux ld apparently doesn't do this, and that > > covers quite a lot of software one might want to compile. mico is a prime > > example. By definition, with ELF, ld always links with the .so. ld uses the SO_NAME in the .so if it's available, otherwise it uses the real name of the library, i.e. libmumble.so.mumble, and stores that as a NEEDED in the program file. At runtime ld.so loads all the NEEDED libraries using the libmumble.so.mumble name. (Note that libmumble.so need not be a symlink to libmumble.so.mumble, in which case ld.so just loads libmumble.so.) > The Linux ld (has has been noted already) is the same as the freebsd > one. It also requires that you have a *.so filename present. The > reason is that ELF does not enforce any semantics on the SONAME of a > library, so it's perfectly legitimate to have a libfoo.so.5-pizza-6. > > Now, if you have libfoo.so.5-pizza-6 and libfoo.so.5-sushi-3, how is > ld supposed to guess which one is the "greatest" value? It doesn't. With ELF, ld.so loads the precise library that was recorded as NEEDED by ld. There is no automatic runtime linking with newer versions as there is with SunOS and *BSD-style shared libraries. If you don't want N copies of a particular library sitting in your /usr/lib then you use (sym)links using the older names to the newest library. -- Kaleb S. KEITHLEY To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message