LPIC Learning Memo [ldconfig]
A command for updating an existing library or placing a new library under a new folder for updating.
Benefits of creating a library of program sources When there is a description that executes the same operation (function) multiple times in the source. The following merits can be obtained by issuing the duplicated functions as a single function. -By putting the same part in the program outside, the redundancy in the source can be removed. (Improves visibility) -By making it a single program, the man-hours for testing the caller can be reduced. -Repair mistakes can be reduced by fixing only one part at the time of repair and not having to modify all the programs that call the function.
Library type -Static library is included in the executable file -Dynamic library The library is taken into memory and used when it is executed.
When executing the program, the link / loader that reads where the shared library is located searches the cache for the location, but when using the ldconfig command, it refers to the /etc/id.so.conf file and creates an appropriate symbolic file. And it will be listed in the cache. Therefore, speedup can be expected when using the shared library. (Advantages of using ldconfig)
However, if you add to a location other than the default or move the path, the symbolic file will not be changed automatically by recognizing the change, so update the /etc/id.so.conf file. Then you need to run ldconfig again.
Since ldconfig determines which version to update the link from the file name and header part, it is necessary to control by option.
option -v Detailed display mode. Show current version number. Check each directory and display the contents each time you generate a link
-p View a list of directories stored in the current cache and library suggestions.
-n Process only directories specified on the command line. Even if it is specified in /etc/ld.so.conf, the directory where the common library is placed by default, it is ignored.
-N Do not reconfigure the cache. Link updated.
-X Do not update the link. Reconfigure only the cache.
-f conf Use the string conf instead of /etc/ld.so.conf.
-C cache Use the string cache instead of /etc/ld.so.cache.
-r root Execute the string root as the current directory.
-l Manually link each library. (Because mistakes are likely to occur before you get used to it, you should not use it until you get used to it.)