Specifications
Linking a Device Driver
9.1 Linker Options File for OpenVMS AXP Device Drivers
Example 9–1 (Cont.) Linker Options File (xxDRIVER_LNK.OPT) for an OpenVMS AXP Device
Driver
$PLIT$,-
$INITIAL$,-
$GLOBAL$,-
$OWN$,-
!
! Psects generated by DRIVER_TABLES
!
$$$105_PROLOGUE,-
$$$110_DATA,-
$$$115_LINKAGE,-
!
! Standard Psects generated by all languages,
! including the high level language driver module
!
$BSS$,-
$DATA$,-
$LINK$,-
$LITERAL$,-
$READONLY$
!
! Coerce the program section attributes for initialization code so
! that code and data will be combined into a single image section.
!
PSECT_ATTR=EXEC$INIT_CODE,NOSHR
!
! Use a COLLECT statement to implicitly declare the INITIALIZATION_PSECTS
! cluster. Mark the cluster with the INITIALIZATION_CODE attribute so that the image
! section produced is identified as INITIALCOD.
!
! These program sections have special names so that when the linker sorts them
! alphabetically they will fall in the order: initialization vector table, code,
! linkage, build table vector. The order in which they are collected does not affect
! their order in the image section.
!
! This is the only place where code and data should reside in the
! same section.
!
! NOTE: The linker will attach the fixup vectors to this cluster. This is expected.
! (The OpenVMS executive loader will deallocate both the fixup section
! and the initialization section once the driver has been initialized.)
!
!
COLLECT=INITIALIZATION_PSECTS/ATTRIBUTES=INITIALIZATION_CODE,-
EXEC$INIT_000,-
EXEC$INIT_001,-
EXEC$INIT_002,-
EXEC$INIT_CODE,-
EXEC$INIT_LINKAGE,-
EXEC$INIT_SSTBL_000,-
EXEC$INIT_SSTBL_001,-
EXEC$INIT_SSTBL_002
9.2 Resolving CRTL References at Link-Time
When an image containing C code is being linked, the user must choose where
to resolve CRTL references. Usually, a C application program resolves such
references through IMAGELIB.OLB in DECC$SHR.EXE by linking /SYSSHR.
9–4










