ld Manual

Introduction to ld
ld Manual529650.001
1-11
COBOL Programs
To create an executable C++ program using ld:
1. Link together the object code files that you compiled.
2. Link to the C++ run-time library initialization object code file:
3. Link to the run-time libraries that your program uses. To link the standard set of
C++ run-time libraries, use these options:
C++ programs require additional libraries. See the C/C++ Programmer’s Guide.
4. If your program uses active backup programming functions, such as
__ns_start_backup(), link to the active backup programming support object
code file:
For information about active backup programming in C++, see the Guardian
Programmer’s Guide.
COBOL Programs
In the OSS environment, the nmcobol compiler automatically calls ld to link the
compiled program. In the Guardian environment, the NMCOBOL compiler
automatically calls ld to link the compiled program only if the compiler is run with the
RUNNABLE directive.
When the NMCOBOL compiler automatically calls ld to link the compiled program, it
provides ld with:
The compiled program’s object file name (either the object file name that you
specified or the default name a.out) as the input file name
The name of the COBOL run-time library, ZCOBSRL
The name of the common run-time environment library, ZCRESRL
Any files located by the SEARCH directive
If you use ld directly to link a COBOL program, you must supply the libraries
ZCOBSRL and ZCRESRL.
Environment Run-Time Library Initialization Object Code File
Guardian $SYSTEM.SYSTEM.CCPPMAIN
OSS /usr/lib/ccppmain.o
Environment Option for Linking Standard C++ Run-Time Libs
Guardian -OBEY $SYSTEM.SYSTEM.LIBCOBEY
OSS
-obey /usr/lib/libc.obey
Environment Active Backup Programming Support Object Code File
Guardian $SYSTEM.SYSTEM.CRTLNS2
OSS /usr/lib/crtlns2.o