nld and noft Manual
nld Utility
nld and noft Manual—520384-003
2-9
Linking Programs
Linking Programs
•
C Programs on page 2-9
•
C++ Programs on page 2-10
•
COBOL Programs on page 2-12
•
pTAL Programs on page 2-13
•
Mixed-Language Programs on page 2-13
•
Programs With Embedded NonStop SQL/MP on page 2-13
C Programs
C programs require access to their run-time environments. To create an executable C
program, you must link to the run-time environment initialization code and the shared
run-time libraries (SRLs) your program uses. The NMC and c89 compilers
automatically link to the required items. If you use nld directly to link a C program, you
must specify these items in nld options.
Follow these step to create an executable C program using nld:
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 SRLs that your program uses. To link the standard set of C SRLs, use
the following options:
4. If your program uses active backup programming functions, such as
__ns_start_backup(), link to the active backup programming support object
code file:
Note. You can only link linkfiles into a program. You cannot link loadfiles, or a combination of
loadfiles and linkfiles, into a program.
Environment Run-Time Library Initialization Object Code File
Guardian $SYSTEM.SYSTEM.CRTLMAIN
OSS /usr/lib/crtlmain.o
Environment Option for Linking the Standard Set of C SRLs
Guardian -OBEY $SYSTEM.SYSTEM.LIBCOBEY
OSS
-obey /usr/lib/libc.obey
Environment Active Backup Programming Support Object Code File
Guardian $SYSTEM.SYSTEM.CRTLNS
OSS /usr/lib/crtlns.o