HP-UX Reference (11i v2 07/12) - 1 User Commands A-M (vol 1)
l
ld_pa(1)
PA-RISC Systems Only
ld_pa(1)
Secure 64-bit programs should be linked with the option
+noenvvar to disable the use of SHLIB_PATH
and LD_LIBRARY_PATH
for locating shared library dependencies. Secure 64-bit programs should also
link with
+nodefaultrpath
to prevent the automatic construction of an embedded search path based
on search directories specified with
-L
options. Most directories searched at link time don’t need to be
searched at run time, and if these directories are specified as relative paths, they expose the program to the
same security risks as the use of
SHLIB_PATH
and LD_LIBRARY_PATH.
Normal programs that depend on libraries that only exist in a directory specified in
SHLIB_PATH or
LD_LIBRARY_PATH
(64-bit mode only) must be linked with +s to enable searching
SHLIB_PATH and
LD_LIBRARY_PATH
. Programs that depend on
SHLIB_PATH or LD_LIBRARY_PATH
cannot be pro-
tected as setuid or setgid programs.
dld uses the dynamic path lookup (with SHLIB_PATH
and LD_LIBRARY_PATH
) only if the following
conditions are satisfied:
getuid() == geteuid() && getgid() == getegid()
That is, if the uid or gid does not match its effective counterpart,
dld does not check the directories
specified in
SHLIB_PATH and LD_LIBRARY_PATH
, which causes the runtime error "
library not
found
".
EXTERNAL INFLUENCES
Environment Variables
The following environment variables affect the execution of ld:
BROWSER Specifies the path name of the HTML browser to display the HP-UX Linker and Libraries
Online User’s Guide when you use the +help option.
ENABLE_PBO_FORK
By default, when an instrumented executable (see the -I option) writes the profile data, it
creates a separate process which runs in the background; and the main process exits. If
this environment variable is set to "OFF", then a separate process is not created but the
same process writes out the profile data. This is useful if you get [ETXTBSY] errors when
removing or modifying the executable after it has been executed.
This environment variable is valid for 32-bit executables only. For instrumented shared
libraries, profile data is always written by the same process.
FDP_FORK Serves the same purpose as ENABLE_PBO_FORK
but for 64-bit executables.
FLOW_DATA An instrumented executable (see the -I option) writes out the profile data to a database
file named
flow.data in the current directory. The name and location of this file can
be specified by setting FLOW_DATA to the desired path name. The profile data is stored
in the database file under a look-up name that is the same as the basename of the execut-
able file specified at run-time. A single flow.data file can hold profile data
LDOPTS Arguments can be passed to the linker through the LDOPTS environment variable as well
as on the command line. The linker gets the value of LDOPTS and places its contents
before any arguments on the command line.
LPATH Specifies default directories to search for library files. See the -l option.
LD_LIBRARY_PATH, SHLIB_PATH , and LD_PRELOAD
Specifies, at runtime, directories to search for library files. See the +s option, dld.sl(5),
and the +help option for the Online HP-UX Linker and Libraries User’s Guide manual
for more information.
LD_PROFILE Specifies, at runtime, the path of the shared library to be profiled (See HP-UX Linker and
Libraries Online User’s Guide for details.)
LD_GPROF_LIB_NAME
Specifies at runtime, the path of the profiler used to profile shared libraries. The default
value is /usr/lib/libgprof32.sl for 32bit applications and
/usr/lib/pa20_64/libgprof.sl for 64bit applications.
TMPDIR Specifies a directory for temporary files.
The following internationalization variables affect the execution of ld:
LANG Determines the locale category for native language, local customs and coded character set
in the absence of LC_ALL and other LC_* environment variables. If LANG is not
HP-UX 11i Version 2: December 2007 Update − 19 − Hewlett-Packard Company 537