Prelinking of shared libraries

Waldo Bastian bastian@kde.org
Wed May 9 14:45:00 GMT 2001


> Exactly.  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 the mmap fails, the lib will be loaded as
> if it was not prelinked and relocated normally.
>
> Andreas

Yes, that seems the easiest way to do it. Some people pointed out a scheme 
where you have a central "link/relocation service" (either in user or kernel 
space) which maps the linked library into the address-space of the process. 
Geoff Keating told me that AIX uses such an approach. That basically moves 
the linking/relocation from installation time to "first used" time. I am not 
exactly sure what the benefits of one of these schemes above the other has in 
terms of use. Doing the linking/relocation at ldconfig time seems less 
complex to me.

Cheers,
Waldo
-- 
bastian@kde.org | SuSE Labs KDE Developer | bastian@suse.com



More information about the Libc-alpha mailing list