142 Chapter 5
Creating and Using Libraries
Creating Shared Libraries
if the library has not been visited then
mark the library as visited.
if the library has a dependency list then
traverse the list in reverse order.
Place the library at the head of the load list.
Shown below are the steps taken to form the load graph when libP is
loaded:
1. mark P, traverse Q
2. mark Q, traverse B
3. mark B, load B
4. load Q
5. traverse D
6. mark D, traverse B
7. B is already marked, so skip B, traverse Q
8. Q is already marked, so skip Q
9. load D
10.mark A, load A
11.load P
The resulting load graph is:
libP →libA →libD → libQ → libB
For 64-bit mode. The dynamic loader uses the following algorithm in
64-bit mode:
if the library has not been visited then
mark the library as visited;
append the library at the end of the list.
if the library has a dependency list then
traverse the list in reverse order.
Shown below are the steps taken to form the load graph when libP is
loaded:
1. mark P, load P
2. traverse P