ld_ia.1 (2010 09)
l
ld_ia(1) Integrity Systems Only
ld_ia(1)
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
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 con-
tents before any arguments on the command line.
LPATH Specifies default directories to search for library files. See the
-l option.
LD_LIBRARY_PATH and SHLIB_PATH
Specifies, at runtime, directories to search for library files. See the
-s option and the
+help option for the Online HP-UX Linker and Libraries User’s Guide for more infor-
mation.
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
specified or is set to the empty string, a default of C (see lang (5)) is used instead of
LANG.
LC_ALL Determines the values for all locale categories and has precedence over LANG and other
LC_* environment variables.
LC_MESSAGES Determines the locale that should be used to affect the format and contents of diagnostic
messages written to standard error.
LC_NUMERIC Determines the locale category for numeric formatting.
LC_CTYPE Determines the locale category for character handling functions.
NLSPATH Determines the location of message catalogs for the processing of LC_MESSAGES.
If any internationalization variable contains an invalid setting,
ld behaves as if all internationalization
variables are set to
C. See environ (5).
In addition, the following environment variable affects
ld:
TMPDIR Specifies a directory for temporary files (see tmpnam (3S)).
BROWSER Specifies the pathname of the browser to display the HP-UX Linker and Libraries
Online User’s Guide when you use the +help option.
RETURN VALUES
ld returns the following values:
0 Successful completion. The link is successful.
n!=0 Failure. An error has occurred.
EXAMPLES
Link part of a C program for later processing by
ld. (Note the .o suffix for the output object file; this is
an HP-UX convention for indicating a linkable object file):
ld -r file1.o file2.o -o prog.o
Link a shared bound program in standard mode. Note that crt0.o is not specified because for shared
links, it is no longer necessary.
ld himom.o -lc
Link a simple Fortran program to use with a symbolic debugger (see wdb(1)). Because the -o option is
not specified on the command line, the output file name is a.out.
ld ftn.o -lcl -lisamstub \
-lc /opt/langtools/lib/pa20_64/end.o
18 Hewlett-Packard Company − 18 − HP-UX 11i Version 3: September 2010