Strip Utility

The Watcom Strip utility may be used to manipulate information that is appended to the end of an executable file. The information can be one of two things:

This information can be added or removed from the executable file. Symbolic debugging information is placed at the end of an executable file by the Watcom Linker or the Watcom Strip utility. Resource information is placed at the end of an executable by a resource compiler or the Watcom Strip utility.

Once a program has been debugged, the Watcom Strip utility allows you to remove the debugging information from the executable file, so that you don't have to remove the debugging directives from the linker directive file and link your program again. Removal of the debugging information reduces the size of the executable image.

All executable files generated by the Watcom Linker can be specified as input to the Watcom Strip utility.

Strip utility command-line format

The Watcom Strip utility command-line syntax is:

wstrip [options] input_file [output_file] [info_file]

The square brackets [ ] denote items that are optional.

options
are as follows:
-n
(noerrors) Don't issue any diagnostic message.
-q
(quiet) Don't print any informational messages.
-r
(resources) Process resource information rather than debugging information.
-a
(add) Add rather than remove information.
input_file
is a file specification for the name of an executable file. If no file extension is specified, the Watcom Strip utility will assume one of the following extensions:
  • .exe
  • .dll
  • .exp
  • .rex
  • .nlm
  • .dsk
  • .lan
  • .nam
  • .qnx
  • or no file extension

Note that the order specified in the list of file extensions is the order in which the Watcom Strip utility will select file extensions.

output_file
is an optional file specification for the output file. If no file extension is specified, the file extension specified in the input file name is used for the output file name. If ``.'' is specified, the input file name is used.
info_file
is an optional file specification for the file:
  • in which the debugging or resource information is to be stored (when removing information) or
  • from which it is read (when adding information).

If no file extension is specified, a file extension of .sym is assumed for debugging information, and .res for resource information. To specify the name of the information file but not the name of an output file, use ``.'' as the output_file.

Note the following:

  1. If the r (resource) option isn't specified, then the default action is to add/remove symbolic debugging information.
  2. If the a (add) option isn't specified, then the default action is to remove information.
  3. If output_file isn't specified, the debugging or resource information is added to or removed from input_file.
  4. If output_file is specified, input_file is copied to output_file, and the debugging or resource information is added to or removed from output_file. The input_file remains unchanged.
  5. If info_file is specified, then the debugging or resource information that is added to or removed from the executable file is read from or written to this file.

    The debugging or resource information may be appended to the executable by specifying the a (add) option. Also, the debugging information may be appended to the executable by concatenating the debugging information file to the end of the executable file (the files must be treated as binary files).

  6. During processing, the Watcom Strip utility will create a temporary file, ensuring that a file by the chosen name doesn't already exist.

Strip utility messages

If you type wstrip with no arguments, the usage message is displayed:


Usage: WSTRIP [options] input_file [output_file] [info_file]
        -q   don't print informational messages
        -n   don't print warning messages
        -r   process resource information rather than 
             debugging information
        -a   add information rather than delete information

        input_file:  executable file
        output_file: optional output executable or '.'
        info_file:   optional output debugging 
                     or resource information file
                     or input debugging 
                     or resource informational file

The following messages may be issued by the Watcom Strip utility:

Too low on memory
There isn't enough free memory to allocate file buffers.
Unable to find '%s'
The specified file couldn't be located.
Cannot create temporary file
All the temporary file names are in use.
Unable to open '%s' to read
The input executable file can't be opened for reading.
'%s' isn't a valid executable file
The input file has invalid executable file header information.
'%s' doesn't contain debugging information
There's nothing to strip from the specified executable file.
Seek error on '%s'
An error occurred during a seek operation on the specified file.
Unable to create output file '%s'
The output file couldn't be created. Check that the output disk isn't write-protected or that the specified output file isn't marked read-only.
Unable to create symbol file '%s'
The symbol file couldn't be created.
Error reading '%s'
An error occurred while reading the input executable file.
Error writing to '%s'
An error occurred while writing the output executable file or the symbol file. Check the amount of free space on the output disk. If the input and output files reside on the same disk, there might not be enough room for a second copy of the executable file during processing.
Cannot erase file '%s'
The input executable file is probably marked read-only, and therefore couldn't be erased (the input file is erased whenever the output file has the same name).
Cannot rename file '%s'
The output executable file couldn't be renamed. Ordinarily, this should never occur.