HP OpenVMS DCL Dictionary


Previous Contents Index


CHECKSUM

The CHECKSUM command invokes a utility to calculate one or more checksums for OpenVMS files. The result, or checksum, is available in the DCL symbol CHECKSUM$CHECKSUM.

Format

CHECKSUM filespec


Parameter

filespec

Specifies the name of an existing file to be checksummed. The asterisk (*) and percent sign (%) wildcard characters are allowed in the file specification.

Description

The CHECKSUM utility calculates file, image, or object checksums for an OpenVMS file. For a file checksum the algorithm used determines if the internal record structure of the file is followed or not. For an image or object checksum, the utility always follows the image or object structure.

The /FILE, /IMAGE, and /OBJECT qualifiers determine which kind of checksum is calculated. They imply a default file type (.DAT, .EXE or .OBJ) and determine the amount of information displayed. The default, /FILE, results in an XOR file checksum, according to the file's record structure. It implies a default file type .DAT and determines that no information is output to SYS$OUTPUT.

For file checksums, you can specify which algorithm CHECKSUM will use to perform calculations. By default, the Alpha and VAX XOR record-based algorithm is used. Optionally, you can select either the CRC algorithm or the MD5 algorithm, each using the whole content of the file to calculate the checksum. The CRC algorithm is the same as the algorithm used for ELF-64 files and is used by popular compression tools like PKZIP. (That is, a file checksum in a ZIP file can be compared with the file checksum obtained by the CHECKSUM utility.) The MD5 algorithm is the MD5 digest, which can be obtained using public domain tools such as MD5.EXE and md5sum.

Image checksums differ between the Alpha/VAX platforms and the I64 platform. Object checksums are only available for the I64 platform. With the platform qualifiers, /ALPHA, /I64 or /VAX non-native images or objects can be checksummed.

For all ELF-64 image and object checksums, CHECKSUM uses a CRC-32 algorithm. The CRC, known as AUTODIN II, Ethernet, or FDDI CRC, is documented as part of the VAX CRC instructions. The image or object checksum follows the ELF-64 data structures that are used for OpenVMS I64 object and image files. For these checksums, only the invariant data is used for the calculation. Variant data, such as timestamps and versions, are excluded from the checksum calculation in order to compare results from different compile and link operations.

For Alpha and VAX images, CHECKSUM uses an XOR algorithm. The image checksum follows the Alpha and VAX image structure and only uses invariant data for the calculation. Variant data, such as timestamps are excluded in order to compare results from different link operations. Note that on Alpha and VAX systems, object files cannot be checksummed based on object invariant data.


Qualifiers

/ALGORITHM=option

/ALGORITHM=XOR (default)

Selects the algorithm used for file checksums. The default is the XOR algorithm for data within records, as used by the previous Checksum utilities on OpenVMS Alpha and VAX systems. Options include:

/ALPHA

Calculates an Alpha-type checksum and is only useful with the /IMAGE qualifier on I64 systems (that is, it checksums Alpha images on I64 systems). It is set by default on Alpha platforms and invalid on VAX platforms.

/FILE (default)

Calculates a file checksum.

By default, the XOR algorithm (/ALGORITHM=XOR) is used for the checksum. The /FILE qualifier also implies a default file type of .DAT. By default, unsigned decimal checksum value is saved in the DCL symbol CHECKSUM$CHECKSUM and not output to the screen. By specifying /SHOW=DATA, the full filename of the specified input file is output in addition to the file checksum, an unsigned decimal value.

The /ALPHA, /I64, or /VAX platform qualifiers do not influence the file checksum result. However, /ALPHA and /VAX prohibit the /SHOW qualifier because these qualifiers were not available on the original Checksum utility for Alpha and VAX systems.

/I64

Calculates an I64-type checksum and is only useful on Alpha systems with /IMAGE or /OBJECT (that is, it checksums I64 images or objects on Alpha systems). The /I64 qualifier is set by default on I64 platforms and invalid on VAX platforms.

/IMAGE

Calculates a checksum of all image bytes. The image structure is followed to include only the image bytes into the checksum. Invariant data, such as the linker version and the link date, are omitted.

For I64 images (that is, I64 formatted files), a CRC checksum is calculated and additional information is output to SYS$OUTPUT, including the following:

The output values are shown in hexadecimal notation. The DCL symbol, CHECKSUM$CHECKSUM, shows the result in hexadecimal notation.

For Alpha and VAX images, an XOR checksum is calculated and additional information is output to SYS$OUTPUT:

The output checksum values are in hexadecimal notation. However, the result in the DCL symbol CHECKSUM$CHECKSUM is in unsigned decimal notation.

Note

For Alpha and VAX images, the unsigned decimal notation of the checksum value in the DCL symbol CHECKSUM$CHECKSUM retains compatiblity with the previous checksum tool.

The /IMAGE qualifier implies the default file type of .EXE. For I64 images, this qualifier also implies the default keyword values HEADERS and SEGMENTS for the /SHOW qualifier.

/OBJECT

Calculates a CRC checksum of all I64 object bytes.

The /OBJECT qualifier follows the ELF-64 object structure to include only the object bytes into the checksum. Invariant data, as the language processor version and the generation date, are omitted.

Additional information is output to SYS$OUTPUT, including the following:

The output checksum values are in hexadecimal notation. The result provided in the DCL symbol, CHECKSUM$CHECKSUM, is in hexadecimal notation.

The /OBJECT qualifier implies the default file type of .OBJ. This qualifier also implies the default keyword values HEADERS and SECTIONS for the /SHOW qualifier.

This qualifier is invalid on the VAX platform. On Alpha platforms, it it is only applicable with the /I64 qualifier.

/OUTPUT[=filespec]

/NOOUTPUT

The /OUTPUT qualifier controls where the output of the command is sent. The /NOOUTPUT qualifier supresses output.

If you specify /OUTPUT and a file specification (/OUTPUT=filespec), the output is sent to the specified file, rather than to the current output device, SYS$OUTPUT. If you do not enter the qualifier, or if you enter the /OUTPUT qualifier without a file specification, the output is sent to SYS$OUTPUT.

Using the /OUTPUT qualifier does not affect the result (that is, the DCL symbol CHECKSUM$CHECKSUM).

/SHOW=(option[,...])

Controls which checksum and additional information is output to the device.

Options for this qualifier are as follows:

The /SHOW qualifier is invalid on the VAX platform.

/VAX

Calculates a VAX-type checksum and is only useful on I64 or Alpha systmes with /IMAGE to checksum VAX images on non-VAX systems. This qualifier is invalid on VAX platforms.

Examples


 
      

The CHECKSUM/IMAGE command results in different output for I64 and Alpha platforms. Because there are different image structures, the names for the checksums differ:

On Alpha systems:


$ CHECKSUM/IMAGE HELLO.EXE
 
file DISK$USER:[JOE]HELLO.EXE;10 
image section %D'1' checksum is %X'6C5404CB' 
image section %D'2' checksum is %X'E29D6A3A' 
image section %D'3' checksum is %X'114B0786' 
image header checksum is %X'00000204' 
checksum of all image sections is %X'9F826977' 
 
$ SHOW SYMBOL CHECKSUM$CHECKSUM
 
CHECKSUM$CHECKSUM = "2676124023"
      

On I64 systems:


$ CHECKSUM/IMAGE FOOBAR.EXE
 
File DISK$USER:[JOE]FOOBAR.EXE;3 
Checksum program segment 0: %X18E293D7 
Checksum program segment 1: %XEFBCE000 
Checksum program segment 2: %XA6D02DD5 
Checksum program segment 3: %X30130E3E 
Checksum dynamic segment %X0F704080 
Elf header checksum: %X7A6AC80F 
Elf program header checksum: %XBF6B41D8 
Elf section header checksum: %X6C770CF6 
Elf (object/image) checksum: %X2EEE7726 
 
$ SHOW SYMBOL CHECKSUM$CHECKSUM
 
CHECKSUM$CHECKSUM = "2EEE7726"
 
      


Previous Next Contents Index