[comp.sys.ibm.pc] Format of EXE files

dhesi@bsu-cs.UUCP (Rahul Dhesi) (08/10/87)

Every EXE file I have ever looked at had a bunch of null bytes between
the relocation table and the rest of the program.  Typically it's over
500 zero bytes.  What are they used for?

Why can't the program begin immediately after the relocation table?
-- 
Rahul Dhesi         UUCP:  {ihnp4,seismo}!{iuvax,pur-ee}!bsu-cs!dhesi

everett@hpcvlo.HP.COM (Everett Kaser) (08/12/87)

> from: dhesi@bsu-cs.UUCP (Rahul Dhesi) / 12:27 pm  Aug 10, 1987 /
> Every EXE file I have ever looked at had a bunch of null bytes between
> the relocation table and the rest of the program.  Typically it's over
> 500 zero bytes.  What are they used for?

From the IBM DOS 2.0 manual, appendix H. EXE File Structure and Loading:

   "The .EXE files produced by the Linker program consist of two parts:
         -   Control and relocation information
         -   The load module itself
    The control and relocation information, which is described below, is
    at the beginning of the file in an area known as the header.  the load
    module immediately follows the header.  the load module BEGINS ON A
    SECTOR BOUNDARY and is the memory image of the module constructed by
    the linker."

Caps are mine.  In the IBM world of PC's, a sector is always 512 bytes,
hence, in an .EXE file with only one or two relocatables, there will always
be about 500 bytes of zeroes.

Everett Kaser
Hewlett-Packard Co.
Corvallis, OR