SQL/MP Programming Manual for COBOL

Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL529758-003
6-24
The nld or ld Utility
@SELECT LIST * OFF
@BUILD progfile
@EXIT
For more information on the Binder program, see the Binder Manual. For more
information on binding HP COBOL programs, see the COBOL85 for NonStop Systems
Manual.
The nld or ld Utility
The process of linking by the nld or ld utility applies only to native TNS/R objects
created by the NMCOBOL compiler (or by the nmcobol utility in the OSS
environment).
If you specify the RUNNABLE directive when compiling a source program in the
Guardian environment, the NMCOBOL compiler uses the COBOLFE process and a
linker to validate and resolve internal and external references and produce an
executable object file. If you do not specify the RUNNABLE directive when compiling
the source program, you must invoke a linker after compilation to link the object files.
Use either the nld or ld utility to link TNS/R object files:
If you compiled the source program with the NON-SHARED directive (the default),
use the nld utility to produce a non-PIC loadfile or linkfile.
To run the nld utility in the Guardian environment, enter nld at the TACL prompt.
In this example, the nld utility links the object files to create a non-PIC loadfile,
myprog:
nld embdsqlobj obja objb -o myprog
For more information on the nld utility, see the nld and noft Manual.
If you compiled the source program with the CALL-SHARED directive, use the ld
utility to produce a PIC loadfile or linkfile.
To run the ld utility in the Guardian environment, enter ld at the TACL prompt. In
this example, the ld utility links the object files to create a PIC loadfile, myprog:
ld embdsqlobj obja objb -o myprog
For more information on the ld utility, see the ld and rld Reference Manual.
For more information on linking HP COBOL programs, see the COBOL85 for NonStop
Systems Manual.
Caution. The Binder STRIP command without the SYMBOLS or AXCEL option removes the
Binder table from an object file. Without the Binder table, the SQL compiler cannot compile the
program file, and the SQL executor cannot execute it.
Caution. The -strip option of the linker removes symbols information from an object file.
Without the symbols region, the SQL compiler cannot compile the program file, and the SQL
executor cannot execute it.