Specifications
Linking a Device Driver
9.1 Linker Options File for OpenVMS AXP Device Drivers
Example 9–1 Linker Options File (xxDRIVER_LNK.OPT) for an OpenVMS AXP Device Driver
!
! Define symbol table for SDA using all global symbols, not just
! universal ones
!
SYMBOL_TABLE=GLOBALS
!
! This cluster is used to control the order of symbol resolution. All
! psects must be collected off of this cluster so that it generates
! no image sections.
!
CLUSTER=VMSDRIVER,,,-
!
! Start with the driver module
!
XXDRIVER.OBJ,-
!
! Next process the private interfaces. (Only include BUGCHECK_CODES if
! used by the driver module). The /LIB qualifier causes the linker to
! resolve references in the driver module to DRIVER$INI_xxx routines
! (which are defined in the module DRIVER_TABLE_INIT).
!
SYS$LIBRARY:VMS$VOLATILE_PRIVATE_INTERFACES/INCLUDE=(BUGCHECK_CODES)/LIB,-
!
! Explicitly include routines for the initialization section - there
! will be no outstanding references to cause this to happen when STARLET
! is searched automatically.
!
SYS$LIBRARY:STARLET/INCLUDE:(SYS$DRIVER_INIT,SYS$DOINIT)
!
! Use the COLLECT statement to implicitly declare the NONPAGED_EXECUTE_PSECTS
! cluster. Mark the cluster with the RESIDENT attribute so that the image
! section produced is nonpaged. Collect only the code psect into the cluster.
! On OpenVMS AXP systems, the execute section cannot contain data.
! You must collect all data, whether read-only or writeable, into one
! of the read/write sections.
!
COLLECT=NONPAGED_EXECUTE_PSECTS/ATTRIBUTES=RESIDENT,-
$CODE$
!
! Coerce the psect attributes on the different data psects so that they
! all match. This will force NONPAGED_READWRITE_PSECTS cluster to yield only
! one image section.
!
PSECT_ATTR=$LINK$,WRT
PSECT_ATTR=$INITIAL$,WRT
PSECT_ATTR=$LITERAL$,NOPIC,NOSHR,WRT
PSECT_ATTR=$READONLY$,NOPIC,NOSHR,WRT
PSECT_ATTR=$$$105_PROLOGUE,NOPIC
PSECT_ATTR=$$$110_DATA,NOPIC
PSECT_ATTR=$$$115_LINKAGE,WRT
!
! Use a COLLECT statement to implicitly declare the NONPAGED_DATA_PSECTS
! cluster. Mark the cluster with the RESIDENT attribute so that the image
! section produced is nonpaged. Collect all the data psects into the cluster.
!
COLLECT=NONPAGED_READWRITE_PSECTS/ATTRIBUTES=RESIDENT,-
!
! Psects generated by BLISS modules
!
(continued on next page)
9–3










