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

s
shl_load_ia(3X)
Integrity Systems Only
shl_load_ia(3X)
NAME
shl_load_ia: shl_load(), shl_definesym(), shl_findsym(), shl_get(), shl_get_r(), shl_gethandle(),
shl_gethandle_r(), shl_getsymbols(), shl_unload() - explicit load of shared libraries for Integrity systems
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);
Remarks
This manpage describes shl*() routines for Integrity systems. For shl*() routines on PA-RISC sys-
tems, see shl_load_pa(3X).
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). The routines themselves are
accessed by specifying the -ldld option on the command line with the ld command (see ld(1)). 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.
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 constructed by using
the path part of path plus the shared library basename followed by the suffix .0 (e.g.
/usr/lib/hpux64/libname.0) to the process, along with all its dependent libraries. A
.0 ver-
sion 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 and was built with static TLS model, you cannot load it
with this routine. See "Thread Local Storage" in dld.so(5) for more information. The flags argument
is made up of several fields. One of the following must be specified:
410 Hewlett-Packard Company − 1 − HP-UX 11i Version 2: December 2007 Update