Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Jan 1996 09:36:46 EST
From:      "Kaleb S. KEITHLEY" <kaleb@x.org>
To:        joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
Cc:        hackers@freefall.FreeBSD.org
Subject:   Re: Demand loading (Re: FreeBSD, Zappa & PCI) 
Message-ID:  <9601061436.AA06441@cambridge.x.org>
In-Reply-To: Your message of Sat, 06 Jan 1996 14:35:17 %2B0100. <199601061335.OAA13639@uriah.heep.sax.de> 

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

> As Kaleb S. KEITHLEY wrote:
> > 
> > 
> >  I'd also be keen to get rid of ldconfig 
> > and ld.so.cache.
> 
> Why?
> 
> I've been missing them on SysV.  (For configuration purposes, let the
> possible performance gain from a shorter lookup time alone.)
> 

In SVR4 (or Digital Unix nee OSF/1) you set the RPATH in the executable
to dictate where to look for shared libs if the shared libs aren't in the
"usual" place; completely obviating the need for ldconfig and ld.so.cache. 
Packages put the libraries where ever they want, the program knows where 
to find them. You don't need hints like ldconfig and ld.so.cache.

This is good for at least two reasons. 1) The run-time loader doesn't
have to search for libraries in every directory in the ld.so.cache, only
in the directories the application thinks it should look in. I don't
know how much of a performance impact this is in reality, but in theory
it could be a sizable performance hit if the system has lots of different
packages with libraries in lots of different places. 2) suid root programs
know exactly where to get the shared libs they want, closing a sizable
security hole.

And if the application doesn't have the RPATH recorded in the executable,
then you use the LD_LIBRARY_PATH to tell it where to look.

I don't remember what SYSV did, but who's really running SYSV anymore. 
Most current SYSV, e.g. SCO and HPUX, have moved a lot closer to SVR4 
than they advertise. Even IBM/AIX's ECOFF format has RPATH.

--

Kaleb KEITHLEY



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