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

s
shl_load_ia(3X) shl_load_ia(3X)
(For Itanium(R)-based System)
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 com-
mand 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()
,orshl_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,orTYPE_UNDEFINED. The latter
value suppresses type checking. The address of the symbol is returned in the variable pointed to by
value. If the symbol is a thread local storage symbol, the address of the symbol is the value of the
thread pointer + the starting address of the shared library + the offset of the symbol in the library.
This routine returns 0 if successful; otherwise 1 is returned. See DIAGNOSTICS for errno set-
tings.
shl_definesym()
Adds a symbol to the user hash table for the current process. If value falls in the range of a
HP-UX 11i Version 2: September 2004 2 Hewlett-Packard Company Section 3971