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

s
shl_load(3X) shl_load(3X)
TYPE_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 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 over-
ridden 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 rou-
tine to define a thread local storage symbol.
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 associated 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 con-
sidered 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. The TYPE_DATA value cause both data, storage, and tstorage symbols
to be returned. The constant TYPE_UNDEFINED
can be used to return all sym-
bols, 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.
Section 3952 Hewlett-Packard Company 3 HP-UX 11i Version 2: August 2003