I. Two types of function libraries
(1) Static function library
Extension LIBXXX.A
Integrated into the execution program at compile time. So the file will be relatively large.
can be executed independently.
If the function library is upgraded, the entire program is recompiled.
(2) Dynamic function library
Extension libxxx.so
Executable files are read only when they are used in libraries, and the files are relatively small.
cannot be executed independently. The directory of the library cannot be changed.
After the library upgrade, the executable does not have to be recompiled. So it's easy to upgrade.
At present, Linux distribution generally use the dynamic function library, because the upgrade is convenient. Most libraries are placed in/usr/lib,/lib below, and many functions are provided by kernel, which is put in/lib/ Modules. The libraries of different versions of the kernel are quite dissimilar, so the kernel 2.4 system does not want to upgrade the kernel to 2.6. So, it's easy because the libraries are different and many software cannot be used.
Two. How to load libraries into memory to increase performance
Using Ldconfig and/etc/ld.so.conf, you can load commonly used libraries into memory to improve performance.
Three. How to determine what dynamic function library an executable program contains
You can use the LDD command, as we want to know what dynamic function library/usr/bin/passwod This program uses, so
You can see the PAM (authentication) module in it. Let's find out/lib/libc.so.6 this function-related library (note the path to it)
Four. Verify the correctness of the software
Only explains how the validation is done.
or using NTP as an example. The MD5 of the official website is
Verify after download as
Both are the same and therefore safe.
CHAPTER22: Source Code and Tarball (3)-Management of function library