dld.sl.5 (2010 09)
d
dld.sl(5)
PA-RISC Systems Only
dld.sl(5)
If you do not specify +gst at link time, you can use the
+gst flag option of the chatr (1) command to
enable the global symbol table mechanism, which causes the loader to build the table and compute the
hash values at run time.
Use the GST options (with the
ld and
chatr commands), +gst, +gstbuckets (PA-RISC 32-bit only),
+gstsize, +nodynhash (PA-RISC 64-bit systems only), and
+plabel_cache
, (PA-RISC 32-bit sys-
tems only) to control the behavior of the global symbol table hash mechanism. You can use the
+gstsize and +nodynhash linker/chatr options to control the behavior of the global symbol table hash
mechanism.
With the GST options, you can tune the size of the hash table and number of buckets per entry to reach a
balance of performance and memory use. To maximize for performance, tune the table size for an aver-
age chain length of one. For maximum memory use, at the expense of performance, tune the size of the
table to minimize the number of empty entries. In general, use prime numbers for the table size. The
mechanism provide default values of table size, 1103, and number of buckets, 3.
To get statistical information about hash table performance, set the environment variable
_HP_DLDOPTS
to contain the -symtab_stat option. This option provides a message for each library that contains the
following information:
• Operation (load/unload)
• Name of library
• Number of export symbols
• Number of entries in table with no stored symbols
• Average length of non-zero chains
• Calculated performance of the hash table
• Amount of memory used by the hash table
See the ld(1) and chatr (1) commands for information on the
+gst, +gstbuckets,
+gstsize,
+nodynhash, and +plabel_cache options.
The LD_PRELOAD Environment Variable
NOTE: The
LD_PRELOAD feature is disabled for seteuid/setegid programs, such as
passwd. See ld(1)
for more details. This feature is not available to fully-bound static executables.
The
LD_PRELOAD environment variable allows you to load additional shared libraries at program
startup. LD_PRELOAD provides a colon-separated or space-separated list of shared libraries that the
dynamic loader can interpret. The dynamic loader, dld.sl, loads the specified shared libraries as if the
program had been linked explicitly with the shared libraries in LD_PRELOAD before any other depen-
dents of the program.
At startup time, the dynamic loader implicitly loads one or more libraries, if found, specified in the
LD_PRELOAD environment. It uses the same load order and symbol resolution order as if the library had
been explicitly linked as the first library in the link line when building the executable. For example,
given an executable built with the following link line:
$ ld ... lib2.sl lib3.sl lib4.sl
If LD_PRELOAD="/var/tmp/lib1.sl", the dynamic loader uses the same load order and symbol
resolution order as if
lib1.sl had been specified as the first library in the link line:
$ ld ... /var/tmp/lib1.sl lib2.sl lib3.sl lib4.sl
In a typical command line use (with /bin/sh), where LD_PRELOAD is defined as follows:
$ LD_PRELOAD=mysl.sl application
The dynamic loader searches application according to
$PATH, but searches mysl.sl according to
SHLIB_PATH and/or LD_LIBRARY_PATH, and/or the embedded path (if enabled).
NOTE: Because the dynamic loader checks the
LD_PRELOAD environment variable when running any
executable (except seteuid/setegid programs), if you export LD_PRELOAD, you should unset it after run-
ning your executable, or run the executable as in the command listed above or in a script.
You can use the
LD_PRELOAD environment variable to load a shared library that contains thread-local
storage to avoid the following error when loading the library dynamically:
/usr/lib/dld.sl: Can’t shl_load() a library containing Thread Local
Storage: /usr/lib/libcps.1
HP-UX 11i Version 3: September 2010 − 5 − Hewlett-Packard Company 5