DLL Programmer's Guide for TNS/E Systems
Advanced DLL Facility Controls
DLL Programmer’s Guide for TNS/E Systems—527252-006
5-4
Linker Output Controls
loadfile being linked is globalized or semi-globalized, the linker searches for libraries
and their symbols following a searchList that is identical to this loadfile’s loadList.
Until the linker finds a library that offers a symbol that the output loadfile needs, it
considers that symbol unresolved. After searching the libraries described above and
looking in the millicode libraries, if the linker cannot find an exported symbol to match
an imported one in the output loadfile, it will respond as specified by <parameter>. If
error is specified, the linker terminates and reports an error; if warn is specified, the
linker issues a warning message and continues; if ignore is specified, the linker does
not attempt to find matching symbols. If you do not specify -unres_symbols, the
default on TNS/E is to ignore unresolved symbols.
Also, when linking on a system other than the execution target, such as an auxiliary
system, be aware that certain libraries may be unavailable. This may cause an
inevitable error or warning if either is specified.
Also note that if you insert the option, -unres_symbols and also allow missing
libraries, then -unres_symbols automatically defaults to ignore.
Linker Output Controls
Designating the Main Entry Point of Your Program
When a program loadfile is linked, it must have a main entry point designated in one of
the following ways:
The input to the link must include a linkfile that contains a procedure that has the
main attribute. If you do not insert the -e <entrypoint> option, as described
in the next bullet, the linker will designate the procedure with the main attribute as
the entry point.
You explicitly designate the main entry point using the -e <entrypoint>
option, where <entrypoint> is the name of a global symbol definition. (It need
not be offered for export.)
PIC programs written in C or C++ are usually linked including a linkfile named
CCPLMAIN (Guardian) or ccplmain.o (OSS, Windows), which provides a function
named _MAIN() that has the main attribute. COBOL programs include a compiler-
supplied main program. Therefore, the -e command is rarely needed.
In a program, the procedure having the main attribute is the default entry point for
starting the program, and it is usually a mistake for you to force a program to start at
some other point. The linker will not accept a program in which there are more than
one procedure having a main attribute, unless you insert the
-allow_multiple_mains option. In this case, if there are two main procedures,
you must resolve the choice by inserting the -e <entrypoint> option.
The linker will not accept a DLL with a procedure having the main attribute; you can
force a DLL to have an entry point by inserting the -e <entrypoint> option when
linking that DLL, but the loader ignores it.










