This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Prelinking of shared libraries


On Fri, May 11, 2001 at 04:30:53PM +0200, Bruno Haible wrote:
> Andreas Jaeger wrote:
> > The idea is that the one configuration program (let's say
> > ldconfig) loads all libraries into its address space, prelinks them
> > and saves the prelinked files together with information where they
> > should be mmapped.  The dynamic linker then reads this information and
> > tries to mmap the prelinked libs into the same address as the
> > configuration program.
> 
> If you constrain yourself to a fixed list of directories (e.g. those
> listed in /etc/ld.so.conf), you can probably avoid address space
> clashes entirely, since 1.5 GB of address space (on Linux/x86) should be
> sufficient for hundreds of libraries.
> 
> In a second step, you could partially prelink each library at least
> against all libraries that it depends on (via DT_NEEDED).

Sure, otherwise you'd just be merely relocating libraries to specific VMAs,
not prelinking.

> Note the prelinked information cannot be stored in /usr/lib/, because
> that directory needs not be writable according to FHS; you'd need to
> store the info in /etc/.

I don't understand this. If you're prelinking, you have to modify the
libraries (= you have to write into /usr/lib). Storing some reloc info
separately from the libraries would give very small gains if not looses.
If anyone has read-only /usr/lib, then either he does the prelinking before
making up /usr/lib content, or simply prelinking will not be done.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]