Kenwood HP 9000 Personal Computer User Manual


 
Chapter 5 143
Creating and Using Libraries
Creating Shared Libraries
3. mark A, load A
4. mark D, load D
5. mark Q, load Q
6. traverse D
7. D is already marked, so skip D
8. traverse Q
9. Q is already marked, so skip Q
10.traverse Q
11.Q is already marked, so skip Q
12.traverse B
13.mark B, load B
14.traverse B
15.B is already marked, so skip B
The resulting load graph is:
libP libA libD libQ libB
Placing Loaded Libraries in the Search List
Once a load graph is formed, the libraries must be added to the shared
library search list, thus binding their symbols to the program. If the
initial library is an implicitly loaded library (that is, a library that is
automatically loaded when the program begins execution), the libraries
in the load graph are appended to the library search list. For example, if
libP is implicitly loaded, the library search list is:
<current search list> libP libA libD libQ libB
The same behavior occurs for libraries that are explicitly loaded with
shl_load, but without the BIND_FIRST modifier (see “BIND_FIRST
Modifier” on page 220 for details). If BIND_FIRST is specified in the
shl_load call, then the libraries in the load graph are inserted before
the existing search list. For example, suppose libP is loaded with this
call:
lib_handle = shl_load("libP.sl", BIND_IMMEDIATE | BIND_FIRST, 0);
Then the resulting library search list is: