Only minimal work is done during compiler compilation; it only records which libraries handle software needs and index names or the number of routines in the library. ( source )
So, this means that ld.soit will not check all the libraries in its database, only those that are written by the application program itself, that is, only those that are specified gcc -lxxx.
ld.so
gcc -lxxx
This contradicts my previous knowledge that it ld.sowill check all the libraries in its database one by one until it is found.
Which case?
, ...
( ld.so) , .o, , , . - , , ( -l), , . .
-l
, -l . , , -l .
. gcc gcc a.o b.o c.o -lm -o myprogram. . ld. ld , ld.so ( ). , , , , .
gcc a.o b.o c.o -lm -o myprogram
ld
- , . , , .
, ld.so( ) . (, ), . , .
, , . , , . (ld.so) , , . " ", . , .