HP-UX Reference (11i v2 03/08) - 3 Library Functions N-Z (vol 7)

s
shl_load(3X) shl_load(3X)
BIND_IMMEDIATE
Resolve symbol references when the library is loaded.
BIND_DEFERRED Delay code symbol resolution until actual reference.
Zero or more of the following can be specified by doing a bitwise OR operation:
BIND_FIRST Place the library at the head of the symbol search
order. In default mode, the library and its dependent
libraries are bound independently of each other (see
BIND_TOGETHER).
BIND_NONFATAL Default BIND_IMMEDIATE
behavior is to treat all
unsatisfied symbols as fatal. This flag allows binding
of unsatisfied code symbols to be deferred until use.
BIND_NOSTART Do not call the initializers for the shared library when
the library is loaded, nor on a future call to
shl_unload() or dlclose(); by default, all the
initializers registered with the specified library are
invoked upon loading.
BIND_VERBOSE Print verbose messages concerning possible unsatisfied
symbols.
BIND_RESTRICTED Restrict symbols visible to the library to those present
at the time the library is loaded.
DYNAMIC_PATH Allow the loader to dynamically search for the library
specified by the path argument. The directories to be
searched are determined by the +s and +b options of
the ld command used when the program was linked.
This is enabled by default if ld +compat was not
specified.
BIND_TOGETHER When used with BIND_FIRST, the library being
mapped and its dependent libraries will be bound
together. This is the default behavior for all
shl_load() requests not using BIND_FIRST.
BIND_BREADTH_FIRST
Causes the dependent libraries to be loaded breadth
first. By default, shl_load() loads dependent
libraries depth-first.
If successful,
shl_load() returns a handle which can be used in subsequent
calls to shl_findsym(),
shl_unload(), shl_gethandle(),or
shl_gethandle_r()
; otherwise NULL is returned. The handle can also be used
in subsequent calls to
dlclose() or dlsym().
Use caution when building shared libraries with external library dependencies.
Any library that contains Thread Local Storage (TLS) and uses static TLS model
should not be used as a dependency. See "Thread Local Storage" in dld.so(5) for
more information. If a dependent library contains TLS, was built with static TLS
model, and it is not loaded during program startup (that is, not linked against the
executable), the dynamic loader fails to perform the operation.
shl_findsym() Obtains the address of an exported symbol sym from a shared library. The handle
argument should be a pointer to the handle of a loaded shared library that was
returned from a previous call to shl_load(),orshl_get(). You can also get
handle from a call to dlopen(). If a pointer to NULL is passed for this argument,
shl_findsym() searches all user defined symbols (those defined by
shl_definesym()), all currently loaded shared libraries and the program to find
the symbol; otherwise shl_findsym() searches only the specified shared library.
The return value of handle will be NULL if the symbol found was generated via
shl_definesym(). Otherwise the handle of the library where the symbol was
found is returned. The special handle PROG_HANDLE can be used to refer to the
program itself, so that symbols exported from the program can also be accessed
dynamically. The type argument specifies the expected type for the symbol, and
should be one of the defined constants TYPE_PROCEDURE, TYPE_DATA,or
HP-UX 11i Version 2: August 2003 2 Hewlett-Packard Company Section 3951