HP-UX Reference (11i v1 00/12) - 3 Library Functions N-Z (vol 7)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/nan.3m
________________________________________________________________
___ ___
s
shl_load(3X) shl_load(3X)
NAME
shl_load(), shl_definesym(), shl_findsym(), shl_gethandle(), shl_getsymbols(), shl_unload(), shl_get(),
shl_gethandle_r(), shl_get_r() - explicit load of shared libraries
SYNOPSIS
#include <dl.h>
shl_t shl_load(const char *path, int flags, long address);
int shl_findsym(
shl_t *handle,
const char *sym,
short type,
void *value
);
int shl_definesym(
const char *sym,
short type,
long value,
int flags
);
int shl_getsymbols(
shl_t handle,
short type,
int flags,
void *(*memory) (),
struct shl_symbol **symbols,
);
int shl_unload(shl_t handle);
int shl_get(int index, struct shl_descriptor **desc);
int shl_gethandle(shl_t handle, struct shl_descriptor **desc);
int shl_get_r(int index, struct shl_descriptor *desc);
int shl_gethandle_r(shl_t handle, struct shl_descriptor *desc);
MULTITHREAD USAGE
These routines are safe to be called from multithreaded applications.
DESCRIPTION
These routines can be used to programmatically load and unload shared libraries, and to obtain information
about the libraries (such as the addresses of symbols defined within them). On PA32, the routines them-
selves are accessed by specifying the -ldld option on the command line with the cc or ld command
(see cc(1) and ld(1)). On PA64, the routines are accessed by specifying either -ldld or -ldl on the
command line. See WARNINGS. In addition, the -E option to the ld command can be used to ensure
that all symbols defined in the program are available to the loaded libraries. This is the default behavior on
PA64.
Shared libraries are created by compiling source files and linking the resultant object files with the
-b
(create shared library) option.
shl_load() Attaches the shared library named by path or the shared library name that is con-
structed by using the path part of path plus the shared library basename followed by
the suffix .0 (e.g. /usr/lib/pa20_64/libname.0) to the process, along with
all its dependent libraries. A
.0 version is looked for first for those shared libraries
that do not have internal names. See ld(1)). The library is mapped at the specified
address.Ifaddress is 0L, the system chooses an appropriate address for the library.
This is the recommended practice because the system has the most complete
knowledge of the address space; currently, the address field is ignored, and assumed
to be 0L. If the 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:
HP-UX Release 11i: December 2000 1 Section 3851
___
___