Prelinking of shared libraries
Bruno Haible
haible@ilog.fr
Fri May 11 07:33:00 GMT 2001
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).
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/.
Bruno
More information about the Libc-alpha
mailing list