Monday, February 23, 2009

Dynamic library configuration

how does the dynamic loader know where to look for executables ?

there are 2 configuration files , /etc/ld.so.conf and /etc/ld/so.cache

cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf

ldconfig - configure dynamic linker run-time bindings

Loading of programs needs to be fast, so the ld.so.conf file is processed to the ldconfig command to process all the libraries from ld.so.conf as well as from those trusted directories ,
/lib and /usr/lib. the dynamic loader uses the ld.conf.cache file to locate files that are to be dynamically loaded and linked. normally we use ldconfig command without parameters to rebuild ld.so.cache

ldconfig -p | more

775 libs found in cache `/etc/ld.so.cache'
libzephyr.so.3 (libc6) => /usr/lib/libzephyr.so.3
libz.so.1 (libc6) => /usr/lib/libz.so.1
libz.so (libc6) => /usr/lib/libz.so
libx264.so.57 (libc6) => /usr/lib/libx264.so.57
libx86.so.1 (libc6) => /lib/libx86.so.1
libx11globalcomm.so.1 (libc6) => /usr/lib/libx11globalcomm.so.1

No comments:

Post a Comment