This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Prelinking of shared libraries
- To: Bruno Haible <haible at ilog dot fr>
- Subject: Re: Prelinking of shared libraries
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 11 May 2001 16:48:28 +0200
- Cc: Andreas Jaeger <aj at suse dot de>, libc-alpha at sources dot redhat dot com
- References: <u8bsp8w9d4.fsf@gromit.rhein-neckar.de> <15099.63389.795634.62992@honolulu.ilog.fr>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
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