HP-UX Reference (11i v3 07/02) - 3 Library Functions N-Z (vol 7)

s
shl_load_pa(3X)
PA-RISC Systems Only
shl_load_pa(3X)
shared library contains thread local storage, you cannot load it with this routine. The flags argument
is made up of several fields. One of the following must be specified:
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. On PA-RISC 64-bit systems, 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
(64-bitmodeonly:) Causes the dependent libraries to be loaded breadth first. By default,
the 64-bit mode 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. On PA-RISC 64-bit systems, the handle can also be used in subsequent calls to
dlclose() or dlsym().
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(). On PA-RISC 64-bit systems, 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. These are the only
accepted type arguments on PA-RISC 64-bit systems. On PA-RISC 32i-bit systems, you can also
specify TYPE_STORAGE ,orTYPE_TSTORAGE. The address of the symbol is returned in the vari-
able 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 settings.
HP-UX 11i Version 3: February 2007 2 Hewlett-Packard Company 409