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

s
shl_load(3X) shl_load(3X)
errno settings.
shl_definesym()
Adds a symbol to the user hash table for the current process. If value falls in the range of a currently
loaded library, an association will be made and the symbol is undefined once the associated library is
unloaded. The defined symbol can be overridden by a subsequent call to this routine or by loading a
more visible library that provides a definition. Symbols overridden in this manner may become visible
again if the overriding definition is removed.
Possible symbol types include:
TYPE_PROCEDURE
Symbol is a function.
TYPE_DATA
Symbol is data.
Possible flag values include: None defined at the present time. Zero should be passed in to prevent
conflicts with future uses of this flag. You cannot use this routine to define a thread local storage sym-
bol. dlsym() will not search for any user defined symbol.
shl_getsymbols()
Provides an array of symbol records, allocated using the supplied memory allocator, that are associ-
ated with the library specified by handle. If the handle argument is a pointer to NULL, symbols
defined using shl_definesym()
are returned. If multiple versions of the same symbol have been
defined with
shl_definesym()
, only the version from the specified symbol information source
that would be considered for symbol binding is returned. The type argument is used to restrict the
return information to a specific type. Values of
TYPE_PROCEDURE
and TYPE_DATA can be used to
limit the returned symbols to be either code or data respectively. On PA-RISC 32i-bit systems, you
can also specify a type of
TYPE_STORAGE or TYPE_TSTORAGE
. The TYPE_DATA value cause
both data, storage, and tstorage symbols to be returned. The constant
TYPE_UNDEFINED
can be
used to return all symbols, regardless of type. The flags argument must have one of the following
values:
IMPORT_SYMBOLS
Return symbols found on the import list.
EXPORT_SYMBOLS
Return symbols found on the export list. All symbols defined by shl_definesym()
are
export symbols.
INITIALIZERS
Return symbols that are specified as the initializers of the library.
Zero or more of the following can be specified by doing a bitwise OR operation:
NO_VALUES
Only makes sense when combined with EXPORT_SYMBOLS
or INITIALIZERS . Do not
calculate the value field in the return structure to avoid symbol binding by the loader to
resolve symbol dependencies. If only a few symbol values are needed,
shl_findsym()
can be used to find the values of interesting symbols. This is not to be used with
GLOBAL_VALUES .
GLOBAL_VALUES
Only makes sense when combined with EXPORT_SYMBOLS or INITIALIZERS . Use the
name and type information of each return symbol and find the most visible occurrence
using all symbol information sources. The value and handle fields in the symbol return
structure reflect where the most visible occurrence was found. Not to be used with
NO_VALUES.
The memory argument should point to a function with the same interface as malloc() (see
malloc(3C)).
The return information consists of an array of the following records (defined in <dl.h>):
struct shl_symbol {
char *name,
short type,
void *value,
shl_t handle,
Section 3886 Hewlett-Packard Company 3 HP-UX 11i Version 1: September 2005