DLL Programmer's Guide for TNS/R Systems

Essential DLL Facility Controls
DLL Programmer’s Guide for TNS/R Systems522203-002
2-9
Files the Linker Opens Normally
If a partially or fully qualified file name is used in a -lib option, the linker does not
search; it applies the host-system defualts to a partially-qualified file name , and
attempts to open the file.
The linker can look for the file among the public libraries.
Files the Linker Opens Normally
The linker accesses files inserted directly in the command stream by making a single
attempt to open it, as described above. The linker recognizes and distinguishes among
a linkfile, an archive, and a DLL that it opens, and it handles each appropriately.
The following causes the linker to attempt to open linkfile1, linkile2, and
archfile1 normally in order to access their contents.
ld linkfile1 linkfile2 archfile1 -dll -o mainout
Libraries the Linker Searches For and Opens
To cause the linker to search for a file to bring into a link, insert the -lib filename
option. The file can be either an archive, which supplies linkfiles to incorporate into the
link, or a loadable library, which will be listed in the output loadfile’s libList. Only one
filename can follow a -lib option, so to declare multiple file names, use multiple -
lib-option declarations. -lib is a repeatable option. -l filename is a synonym for
-lib filename, where the -l must be lower case and may, but need not
beseparated from its filename parameter by white space..
The linker recognizes file names in a -lib (or -l) option as either qualified or
unqualified, as discussed in File-Name Qualification on page 2-4. It accepts a qualified
name in a -lib option and does not search for it, but instead, attempts to open the file
as a library or archive; thus -lib qf is equivalent to a qf input as a separate file name,
when qf is qualified. If the linker cannot open a file with a qualified name it declares an
error and terminates the link. If the linker cannot open a file specified in a -lib option
with an unqualified name it declares an error, unless you have told it to allow missing
libraries, as described in Allowing Missing Libraries on page 2-11. It is an error if a file
opened as a result of -lib is not a library or an archive.
On the other hand, when the linker recognizes an unqualified name in a -lib option, it
searches the file system for a file with that name and opens it. Also, if the name in a
-lib option is unqualified, the linker might augment the given name with the defaults
appropriate to the linker platform and then attempt to open the resulting file. This is
described in Augmenting Library Names Automatically in Searches on page 5-2.
A -lib option cannot specify any of the primary linkfiles in a link; these must be
inserted separately in the command stream as qualified file names or unqualified
names if the files are in the current directory.