Question about how the loader finds libraries at runtime

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.

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?

+3
source share
1

, ...

( ld.so) , .o, , , . - , , ( -l), , . .

, -l . , , -l .

. gcc gcc a.o b.o c.o -lm -o myprogram. . ld. ld , ld.so ( ). , , , , .

- , . , , .

, ld.so( ) . (, ), . , .

, , . , , . (ld.so) , , . " ", . , .

+4

All Articles