ld(1)
_________________________________________________________________
ld Command
link editor for common object files in DG/UX
_________________________________________________________________
SYNTAX
ld [ options ] filename... [indirect-file...] [ SYMNAME=VALUE ]
DESCRIPTION
The ld command combines several object files into one, resolves
external symbols, and supports symbol table information for
symbolic debugging.
When given several object files, ld combines them, producing an
executable object module. The output of ld is left in a.out by
default. This file is executable if no errors occurred during
the load. If any input file is not an object file, ld assumes it
is either an archive library or an indirect file, a text file
containing link editor directives. In an indirect file, one
option letter, filename, or symbol assignment is put on each
line. (See the "The DG/UX Linker: ld" in Programmer's Guide to
the DG/UX System for a discussion of input directives.) Symbol
assignments require that VALUE be in DG/UX format. For example,
16 would be 16 in a decimal assignment, 020 in octal, and 0x10 in
hexadecimal. Such assignments are commonly used to assign
nondefault values to the symbols that govern heap and stack setup
(.RESERVE .STKSIZE .HPSIZE .STORAGE). See the C Language
Referenceand Using the Standard C Runtime Environmentmanuals.
If any argument is a library, the library is opened once,
searched as many times as required, and then closed. Only those
routines defining an unresolved external reference are loaded.
Thus, library members can be in any order.
Ld does not search for assumed file extensions; files must be
identified explicitly. Any argument having the = character is
assumed to be a symbol assignment. Numeric command-line arguments
are normally interpreted as decimal; you can specify octal by
preceding the arguments with 0 (zero), hexadecimal by preceding
them with 0x (zero-x). Numeric values may be preceded by + or -.
Options are:
-e symbol Starting address is symbol.
-lname Search for library libname.a (in /lib and /usr/lib
by default; see -L). Note the format of the
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
ld(1)
library name that ld searches for. This option
must be specified on the command line after the
object file names that contain references to a
module in libname.a.
-L dir Search for libraries in dir before searching /lib
and /usr/lib. The -l switch must also be selected.
The -L switch must come before the -l switch on the
command line so that ld can look in dir for the
specified library name.
-m Produce a link map.
-M Warn about multiply defined symbols.
-N Compress text and data.
-o file Executable module is called file instead of a.out.
-Q Don't compress uninitialized static (bss) data.
-r Retain relocation entries in the output object
file. Relocation entries must be saved if the
output file is to become an input file in a
subsequent ld run. The link editor will not
complain about unresolved references, and the
output file will not be executable.
-Rnum Set starting relocation address (the ring) of the
program to num. Num is a word address; if it is
not specified, the default is 0x70000000 (Ring 7).
-RD num Set beginning data address to num. Num is a word
address; default is 0x100.
-RT num Set beginning text address to num. Num is word
address; default is 0x80000 minus the size of the
text.
-s Strip symbol table information.
-t Don't check that all definitions of common areas
are the same size. (Otherwise, a warning is
issued).
-u name Add name as an external.
-S Suppress all non-fatal error messages.
-V Print the revision number of ld and as.
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)
ld(1)
-VS rev Set program's revision number to rev, in the format
N.N.N.N, where N is a decimal number in the range 0
to 255.
-x Strip local symbols.
-Y[LU],dir Change the default directory used for finding
libraries. If L is specified, the first default
directory that ld searches, LIBDIR, is replaced by
dir. If U is specified, the second default
directory that ld searches, LLIBDIR, is replaced by
dir.
FILES
/lib/libx.a libraries
/usr/lib/libx.a libraries
a.out output file
LIBDIR the first default search directory for
libraries, usually /lib.
LLIBDIR the second default search directory for
libraries, usually /usr/lib.
SEE ALSO
as(1), cc(1).
exit(2), a.out(4), ar(4) in the Programmer's Reference for the
DG/UX System
"The DG/UX Linker: ld" and "The DG/UX Assembler: as" in
Programmer's Guide to the DG/UX System.
C Language Referenceand Using the Standard C Runtime Environment
"Link Command Line" in the AOS/VS Link and LFE User's Manual.
CAVEATS
There are several differences between ld(1) and the Linker in an
AOS/VS environment:
- The target environment for linking is DG/UX.
- The output file, a.out, contains all of the information
normally contained in the four output files produced by the
AOS/VS Linker.
- There is no equivalent to URT32.LB (the default system
library under AOS/VS).
- Indirect files may be nested up to 15 deep at any one time.
DG/UX 4.00 Page 3
Licensed material--property of copyright holder(s)