Re: Dynamic library loader search path
- From: Paul Pluzhnikov <ppluzhnikov-nsp@xxxxxxxxxxx>
- Date: Fri, 29 Dec 2006 15:42:27 -0800
"Gregory" <g_greg@xxxxxxxxxxxxxxx> writes:
Loader searches for dynamic libraries in directories specified in
$LD_LIBRARY_PATH environment variables. However it's not all, loader
also searches in directories in $LD_LIBRARY_PATH augmented with many
sub-paths like lib/i686/mmx, tls, mmx, i686 and so on. Where do these
sub-paths come from ?
These are compiled into ld-linux.so.2 -- it goes over all the search
directories, and for each appends each "capability string". Look
in elf/dl-load.c open_path().
The capability strings are filled by _dl_important_hwcaps() in
sysdeps/generic/dl-sysdep.c and (AFAICT) you can't modify any of
this without rebuilding glibc.
Is it possible to configure them or even cancel them ?
No (AFAICT).
The problem I encountered is that loader first searches within
directories suffixed with all these sub-passes and only then in the
directory itself. This highly increases dynamic library search time.
How many directories *are* you searching?
Unless your LD_LIBRARY_PATH contains 1000s of directories (or you
are searching directories on a slow NFS server), I don't see how
searcing 4 times as many would "highly increase search time".
If you are searching many directories, a better solution might be
to either dlopen() with absolute path, or collect all your libraries
into a single directory (with symlinks).
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
.
- Follow-Ups:
- Re: Dynamic library loader search path
- From: Gregory
- Re: Dynamic library loader search path
- References:
- Dynamic library loader search path
- From: Gregory
- Dynamic library loader search path
- Prev by Date: Re: Dynamic library loader search path
- Next by Date: Re: Dynamic library loader search path
- Previous by thread: Re: Dynamic library loader search path
- Next by thread: Re: Dynamic library loader search path
- Index(es):