CLINK(1) — USER COMMANDS
NAME
clink − SAS/C 370 object file pre-linker
SYNOPSIS
clink [ −p ] [ −d ] [ −w ] [ −c ] [ −r ] [ −e ] [ −f ] [ −m ] [ −n ] [ −v ] [ −. ] [ −lx ] [ −Ldir ] [ −s filename ] [ −g prefix ] [ −i symbol ] [ −xxs ] [ −xxx ] [ −xxe ] [ −o outfile ] file ...
DESCRIPTION
Clink takes one or more input object files or libraries and combines them into a single output object file. In doing so it can optionally merge the initialization data for reentrant external variables and transform object files containing extended external names so that they are linkable by the 370 linkage editor. Clink can also perform various housekeeping tasks, including deleting some data-only CSECTs, and removing pseudo registers. Clink will optionally produce an object file that is suitable for use with SMP.
Clink recognizes two kinds of input files: object files created by the compiler or assembler (also known as .o files) and archives of 370-format object files (called archive libraries). An archive library contains an index of all the externally-visible symbols from its component object files. (The archiver command ar370(1) creates and maintains the library.) Clink uses this table to resolve references to external symbols.
Clink processes files in the same order as they appear on the command line. It includes code and data from an archive library element if and only if that object module provides a definition for a currently unresolved reference within the user’s program. Options should appear ahead of the list of files to process.
Clink will not produce an output file if any errors are discovered during processing unless the -m option is used.
Options
−p Remove pseudo registers. The compiler uses an object file construct called a pseudo register to implement an reentrant external variable. Some mainframe linkers, notably the CMS LOAD command, do not handle object files containing large numbers of pseudo registers. This option causes clink to process the pseudo registers itself and remove them from the output object file.
−d Delete the line-number/offset table CSECTs. If the -W1,-l compiler option is used (it is the default), the compiler inserts a CSECT containing line-number/offset information into the object file. This information is used by omd(1) and the debugger to associate a source line number with an offset in the object file or executable. The −d option causes clink to remove any such CSECTs from the output object file. Doing so can significantly reduce the size of the executable.
−w Suppress warning messages.
−c Suppress the generation of the merged @EXTCOG# CSECT.
−r Delete the run-time constants CSECTs. By default, the compiler generates a special CSECT known as the "run-time constants" CSECT. This CSECT contains information usable by the debugger. If the executable will not be debugged, this information is not needed. Removing it reduces the size of the executable by a small amount.
−e Keep the extended external symbol CSECTs. When the -W1,-n! compiler option is used, the compiler generates two additional CSECTs to contain the extended name information. The "extended function name CSECT" contains the extended name information for all functions defined in the compilation. The "extended external symbol CSECT" contains the information for all other extended names in the compilation. The information in the extended function name CSECT is used by the debugger and library ABEND handler. The information in the extended external symbol CSECTs is not needed after clink has finished processing, so these CSECTs are deleted from the output file by default. The −e option causes clink to retain these CSECTs in the output object file. Keeping these CSECTs may significantly increase the size of the executable.
−f Delete the extended function name CSECTs. Deleting these CSECTs may significantly decrease the size of the resulting executable, but the debugger will not be able to accept extended names in commands and extended names will not be used in library tracebacks.
−m Create an object file even if warning messages were produced. By default clink will not produce an output object file if it produces a warning message during processing.
−n Don’t process extended name information.
−v Create the @EXTVEC# CSECT for object files that will be maintained by SMP.
−. Don’t issue any messages except for error messages.
−lx Search a library libx.a where x is one or more characters.
-Ldir Search for libx.a in dir . More than one directory can be specified, but each must be preceded by −L .
-s filename Generate the JCLIN file used with SMP.
-g prefix Collect all ESD items whose names begin with prefix where prefix is a 1-to-6 character name. The collected items are used to create a table in a CSECT named prefix$T which is appended to the output object file.
-i symbol Add symbol to the list of external references. clink will resolve the symbol if necessary by searching the archive libraries.
−xxs Generate a cross-reference of extended names sorted by the sname of the object file. Within each sname the extended names are sorted in alphabetical order.
−xxx Generate a cross-reference of extended names sorted by the extended names themselves.
−xxe Generate a cross-reference of extended names sorted by the external symbol associated with each extended name.
−o outfile Specify the name of the output object file. This option is required.
DIAGNOSTICS
Clink returns zero if no warning or error conditions are detected while processing the object files, or a non-zero return code otherwise.
EXAMPLES
Pre-link a single input object file, using the work/libproj.a archive library to resolve external references. The output object file is proj1.o
clink -o proj1.o file1.o -Lwork -lproj
Pre-link two input object files, using work/libproj.a and work/libcms.a to resolve external references. Remove any pseudo registers found in the input object files and produce all three extended names cross-references. The output object file is proj2.o.
clink -p -xxexs -o proj2.o file1.o -lproj -lcms
SEE ALSO
SAS/C Cross-Platform Compiler, Usage and Reference, SAS/C Compiler and Library User’s Guide
5.50 — Last change: SAS/C