7.3 Shareable Images
Shareable images should have transfer vectors in order to
remove the need to relink executable images which use a
shareable image when the shareable image is rebuilt.
The presence of a GSMATCH statement in the linker options file
indicates to SysWorks that a shareable image is to be created
rather than an executable image.
With OpenVMS VAX these transfer vectors are normally
maintained in a Macro-32 source which uses the .TRANSFER
directive or the SysWorks VECTOR macro. With OpenVMS
Alpha, the transfer vectors are built using a syntax in the
linker options file.
Example 7-1 is a Macro-32 source which is used to build a
shareable image. The logical name swrk_macro_lib is defined
by the SysWorks startup command procedures.
Example 7-2 is a Linker options file which is used to build
a shareable image for OpenVMS VAX. Note that only the
first three (non-comment) lines are important for all share-
able images - the remaining lines are specific to the linking
requirements of this specific image.
Example 7-3 is a Linker options file which is used to build
the same shareable image for OpenVMS Alpha. Note the use
of the %APPEND directive which causes SysWorks to gener-
ate an options file in SWRK_AIL_DIR:SWRKSHR.OPT_INC based on
the source SWRK_WRK_DIR:SWRKSHR.MAR and rules which include
both the original options file SWRK_WRK_DIR:SWRKSHR-ALPHA.OPT
and generated options file ( SWRK_AIL_DIR:SWRKSHR.OPT_INC ) as
part of the LINK command.
Example 7-4 is the linker options generated from the
Macro-32 source for use with the OpenVMS Alpha shareable
image.
Example 7-5 is a Macro-32 source which is used to build a
protected shareable image.
Example 7-6 is a Linker options file which is used to build a
protected shareable image for OpenVMS VAX.
7.3.1 Transfer Vectors
For convenience, SysWorks provides a VECTOR macro which
simplifies the task of defining transfer vectors and assists in
enforcing the ordered nature of transfer vectors. This macro
also works under OpenVMS Alpha, although it simply gen-
erates global references in an image root module rather than
defining full transfer vectors.
SysWorks also provides a Macro-32 to linker options con-
verter which uses the VECTOR statements in the Macro-32
source to generate a linker options file with the appropri-
ate symbol_vector statements. This generated linker options
file can be included with the shareable image linker options
file by using the %INCLUDE directive in the header comments.
This causes SysWorks to add the included (i.e the generated)
options file to the link command at build time.