dld.sl.5 (2012 03)

d
dld.sl(5)
PA-RISC Systems Only
dld.sl(5)
/usr/lib/dld.sl: Can’t shl_load() a library containing Thread Local
Storage: /usr/lib/libcps.1
The load order and symbol resolution order may be different in a PA-RISC 32-bit program than in the
same PA-RISC 64-bit program because the dynamic loader uses depth-first search order in PA-Risc 32-bit
mode and breadth-first search order in PA-RISC 64-bit mode.
See Symbol Searching and Dependent Libraries in the
+help option to ld(1) or the HP-UX Linker and
Libraries User’s Guide for more information.
The dynamic loader uses the
LD_PRELOAD environment variable even if you use the
+noenvvar in the
link line. This insures that
LD_PRELOAD is enabled even in a
+compat link. The LD_PRELOAD vari-
able is always enabled except for
setuid and
setgid programs.
NOTE: If an archive library is already linked-in with the application and we try to load the shared ver-
sion of that library using
LD_PRELOAD we will have problems.
The potential problems are :
If the library has initializers/terminators, they will be called twice
you may end up using two different copies of the same data symbol which may cause incorrect
behavior
You can specify multiple libraries as part of the
LD_PRELOAD environment variable. Separate the
libraries by spaces or colons as in LD_LIBRARY_PATH
. (Multi-byte support is not provided as part of
parsing the
LD_PRELOAD library list). You can specify LD_PRELOAD libraries with absolute paths or
relative paths. The LD_PRELOAD libraries can also consist of just the library names, in which case the
dynamic loader uses the directory path list in the environment variables LD_LIBRARY_PATH
and/or
SHLIB_PATH or the embedded path list (if enabled) to search for the libraries.
The dynamic loader does not issue an error or warning message if it cannot find a library specified by
LD_PRELOAD. However, if it does not find a dependent of the LD_PRELOAD libraries, the dynamic
loader issues the same error message as if the LD_PRELOAD library is specified in the link line.
The LD_PRELOAD_ONCE Environment Variable
The
LD_PRELOAD_ONCE
feature is similar to LD_PRELOAD except that the dynamic loader, dld.sl,
unsets
LD_PRELOAD_ONCE after reading it, so that any applications invoked by the current application
do not have
LD_PRELOAD_ONCE
set. This is useful in situations where the current application needs
certain libraries preloaded while the child application is adversely affected if these are preloaded (for
example,
ksh terminates abnormally if LD_PRELOAD contains /usr/lib/libpthread.1
).
The libraries specified by
LD_PRELOAD_ONCE
are loaded before the ones specified by LD_PRELOAD.
The effect on symbol resolution is that the symbols from libraries specified by
LD_PRELOAD_ONCE take
precedence over symbols from libraries specified by
LD_PRELOAD.
Running setuid Programs
For looking up shared libraries for
setuid applications, the dynamic loader uses only the paths listed in
/etc/dld.sl.conf.
If
LD_LIBRARY_PATH and SHLIB_PATH are set, they are validated against the list of paths in
/etc/dld.sl.conf. (This allows the individual applications to appropriately order the list from the
conf file).
You can turn this feature off by setting the option _
HP_DLDOPTS to -no_setuidpath. Using this
option disables setuid programs from all dynamic path lookup.
The configuration file
/etc/dld.sl.conf is expected to contain a list of shared library search paths
(delimited by either colon or newline characters). To avoid redundant searches, you should see that one
path appears only once in the file (and also in the options SHLIB_PATH and LD_LIBRARY_PATH).
The
conf file should be writeable only by root. Otherwise, the loader does not use its contents. If
/etc/dld/sl.conf does not exist or has the wrong permissions, all dynamic path lookup is disabled.
Any relative paths (paths not starting with slash (/) in the path list are ignored by the loader.
NOTE: Spaces are not allowed in the paths listed. Everything on a line that follows a space or pound (
#)
character is ignored. You can use the pound sign (#) to comment out paths in the file.
6 Hewlett-Packard Company 6 HP-UX 11i Version 3: March 2012