Technical data
Cray Standard C/C++ Reference Manual
Because of the special code needed to handle templates, constructors, destructors,
and other C++ language features, object files generated by using the CC(1)
command should be linked using the CC(1) command. To link C++ object
files using one of the loader commands (ld(1) or cld(1)), the -h keep=
files
option (see Section 2.7.1, page 14) must be specified on the command line when
compiling source files.
The loaders, ld(1) and cld(1), can be accessed by using one of the following
methods:
• You can access the loader directly by using the ld(1) or cld(1) command. You
can also use the segldr(1) command to access ld(1).
• You can let the cc(1), CC(1), or c89(1) command choose the loader. This
method may cause slower loading and use more memory, but it also has
the following advantages:
– You do not need to know the loader command line interface.
– You do need to know which loader to call for the targeted machine.
– You do not need to worry about the details of which libraries to load, or
the order in which to load them.
– When using CC(1), you need not worry about template instantiation
requirements or about loading the compiler-generated static constructors
and destructors.
A.2.1 Loader for UNICOS Systems (SEGLDR)
The default loader on all UNICOS systems is SEGLDR. The CC(1), cc(1),
and c89(1) commands call SEGLDR by using the ld(1) command. Because
SEGLDR was designed specifically for use with UNICOS systems, it offers
several advantages. Despite its name, SEGLDR produces both segmented and
nonsegmented executable programs and is an efficient and full-featured loader
for all types of programs. You can control SEGLDR operations with options
on the segldr(1) command line or directives in a directives file. For more
information, see the segldr(1) man page and the Segment Loader (SEGLDR) and
ld Reference Manual.
A.2.2 Loader for UNICOS/mk Systems (cld(1))
The default loader on UNICOS/mk systems is cld(1). The CC(1), cc(1), and
c89(1) commands call cld(1) by using the cld(1) command. Because cld(1)
154 S–2179–36










