ld Manual

ld Manual529650.001
1-1
1 Introduction to ld
ld (ld) is used in either TNS/R development environment, Guardian or the HP
NonStop Open System Services (OSS), to link TNS/R Position Independent Code
(PIC) object files together into a loadfile.
In the Guardian environment you can use either upper (ld) or lower-case (ld)
commands to invoke the linker. To comply with UNIX conventions you can only use
lowercase in the OSS environment. This manual generally uses lower-case versions
of the linker name. .
PIC and non-PIC native object files are generated by the native C, native C++, native
COBOL, and pTAL compilers. For information about these compilers, see:
C/C++ Programmer’s Guide
COBOL Manual for TNS and TNS/R Systems
pTAL Reference Manual
For detailed information about PIC programs and developing Dynamic Linked Libraries
(DLL)s, see the DLL Programmer’s Guide for TNS/R Systems.
Native Object Files (TNS/R)
ld operates on native object files for TNS/R systems. These native object files are in
Executable and Linking Format (ELF), a standard format used for object files, with HP
extensions. For details on the structure of native object files, see the nld Manual.
TNS/R native object files are either linkfiles or loadfiles, but not both.
The native compilers create native object files called linkfiles from source code. ld
produces native object files called loadfiles from linkfiles, and rld links and loads
loadfiles at run time.
TNS/R native object files in the Guardian environment have a file code of 700.
ld Overview
The TNS/R PIC object file linker is named ld. The linker combines one or more PIC
linkfiles to create a PIC loadfile. In doing so ld manipulates both code and data, and
Name Product Description
ld
T0429 Links one or more PIC object files to produce a
single PIC loadfile.
(To produce a non-PIC object file, use the nld
utility, which is explained in the nld Manual.
Can Be Linked to Produce a Loadfile Can Be Executed
Linkfiles Yes No
Loadfiles No Yes