Linking

ZLINKing

After the compiler produces object code, the object code must be combined with other object modules and mapped into memory. GT.M provides two ways to accomplish this: the GT.M command ZLINK and/or the VMS LINK utility. Most programmers in a development environment prefer to use ZLINK, as it provides them with the "touch and feel" of an interpreter for greater programming productivity. Depending on various factors, including the size of the application and the frequency of use of its component routines, using LINK to supplement production images may be advantageous.

The following table compares ZLINK and LINK.

Comparison of ZLINK and LINK

ZLINK

LINK

Works on a running image

Produces a new image

Lasts until image terminates or another ZLINK of the same module

Produces a reusable .EXE file

Adds object files individually

Combines all required object files

Defers resolution of references until used

Treats unresolved references as errors

May invoke the GT.M compiler

Requires a properly prepared set of object modules

Incremental approach allows changes with minimum impact

Changes require complete reconstruction and therefore longer turnaround times

Run-time cost is modest without compile, may be noticeable with compile

No run-time cost

Each image must have its own copy of the machine code

Resulting image may be shared for better performance