ld Manual

Introduction to ld
ld Manual529650.001
1-13
Linking Shared Run-Time Libraries (SRLs)
A program file can have at most one TNS/R native user library associated with it. This
table shows how to associate a TNS/R native user library with a program file:
When using programs or user libraries that contain C++ code, it is recommended that
you use the noft option LISTATTRIBUTE or LA (see the noft Manual) to verify that the
program and the user library have compatible C++ dialects. (For information about C++
dialects, see C++ Programs.)
User libraries specified at run time override those specified at link time.
Linking Shared Run-Time Libraries (SRLs)
ld supports hybrid SRLs, which HP supplies. For information about hybrid SRLs, see
the DLL Programmers Guide for TNS/R Systems.
You cannot create your own SRLs. You can create your own user library. See Linking
User Libraries for details.
ld does not support the TNS SRLs available to TNS and accelerated programs in the
OSS environment.
Linking Archive Files
ld supports archive files for selecting input object files when building a new object file.
An archive file is created by the ar utility and contains a collection of object files. Any
type of file can be put into an archive, but ld uses only the relinkable TNS/R native
object files in an archive file.
To create an archive file, you can use the ar utility in either the Guardian environment,
the OSS environment, or on platforms running Windows. ld supports archive files
existing in the Guardian and OSS environments, regardless of where the archives
were created. The ar utility is described in the noft Manual.
In the OSS environment, archive files often have file names that start with lib and end
with the file name suffix .a, such as libc.a.
When How
Link time*
ld -libname library option
ld -set libname library option
ld -change libname library options
Native c89 utility -Wld= "
ld-options" option
Native nmcobol utility -Wld= "
ld-options" option
Run time TACL command interpreter RUN command LIB option
OSS run command -lib option
OSS runv command -lib option
OSS run gtacl command -lib option
* library must be a Guardian file name. For details, see -libname.