home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / LXDUMP.ZIP / LXEXE.DOC < prev   
Text File  |  1992-07-30  |  79KB  |  1,956 lines

  1. #: 142 S0/CompuServe Mail
  2.      30-Jul-92 05:58 PDT
  3. Sb: Linear eXecutable Module Format Documentation
  4. Fm: INTERNET:jwh@citi.umich.edu
  5. Sender: jwh@citi.umich.edu
  6. Received: from citi.umich.edu by iha.compuserve.com (5.65/5.910516)
  7.         id AA03573; Thu, 30 Jul 92 08:51:20 -0400
  8. Message-Id: <9207301251.AA03573@iha.compuserve.com>
  9. Received: from citi.umich.edu [141.211.128.175] by citi.umich.edu with SMTP;
  10. Thu, 30 Jul 92 08:50:12 -0400
  11. From: jwh@citi.umich.edu
  12. To: 72251.750@compuserve.com
  13. Date: Thu, 30 Jul 92 08:50:10 -0400
  14. Subject: Linear eXecutable Module Format Documentation
  15.  
  16.  
  17. A couple of months ago you were kind enough to send me a copy of the
  18. LX EXE header documentation that you had.  I thought I would return
  19. the favor.  I recently received a later copy of the document via e-mail
  20. from a person at IBM.  I was told that I could distribute this 
  21. document to whoever I chose.
  22.  
  23. ------- Forwarded Message
  24.  
  25. Received: from vnet.ibm.com [192.124.113.4] by
  26. citi.umich.edu with SMTP; Fri, 17 Jul 92 18:20:28 -0400
  27. Received: from AUSTIN by vnet.ibm.com (IBM VM SMTP V2R2) with BSMTP id 2715;
  28.    Fri, 17 Jul 92 18:19:51 EDT
  29. Received: by AUSTIN (XAGENTA 3.0) id 0659; Fri, 17 Jul 1992 14:04:19 -0500
  30. Date: Fri, 17 Jul 92 14:02:20 CDT
  31. From: "Alan Stephens (512) 838-0071 (t/l 678)" <stephens@vnet.ibm.com>
  32. To:    jwh@citi.umich.edu
  33. Subject: Linear eXecutable Module Format
  34.  
  35. James,
  36.  
  37. I've found the owner of the document, and he sent a current copy to me.  I've
  38. attached it to the bottom of my note (following my signature).  Please feel
  39. free to distribute this to whomever you choose.  I hope I've been able to help.
  40.  
  41. Regards,
  42.   Alan
  43.  
  44. -
  45. ------------------------------------------------------------------------------
  46. Alan Stephens                          Surface Mail:  IBM Austin
  47. IBM Personal Systems Programming Ctr.                 Bldg. 901, ZIP 9151
  48. VNet:     STEPHENS at AUSTIN                          11400 Burnet Rd.
  49. IBMMail:  USIB37RD at IBMMAIL                         Austin, TX  78758
  50. Internet: stephens@vnet.ibm.com, or           phone:  (512) 838-0071 (t/l 678)
  51.           apsteph@cs.utexas.edu
  52. - -----8<---8<---Cut
  53. Here---8<---8<---------------------------------------------
  54.  
  55.            LX - Linear eXecutable Module Format Description
  56.  
  57.                             June 3, 1992
  58.  
  59.  
  60.  
  61.    Figure 1. 32-bit Linear EXE File Layout
  62.  
  63.        00h +------------------+  <--+
  64.            | DOS 2 Compatible |     |
  65.            |    EXE Header    |     |
  66.        1Ch +------------------+     |
  67.            |      unused      |     |
  68.            +------------------+     |
  69.        24h |  OEM Identifier  |     |
  70.        26h |  OEM Info        |     |
  71.            |                  |     |-- DOS 2.0 Section
  72.        3Ch |  Offset to       |     |   (Discarded)
  73.            |  Linear EXE      |     |
  74.            |  Header          |     |
  75.        40h +------------------+     |
  76.            |   DOS 2.0 Stub   |     |
  77.            |   Program &      |     |
  78.            |   Reloc. Table   |     |
  79.            +------------------+  <--+
  80.            |                  |
  81.        xxh +------------------+  <--+
  82.            |    Executable    |     |
  83.            |       Info       |     |
  84.            +------------------+     |
  85.            |      Module      |     |
  86.            |       Info       |     |
  87.            +------------------+     |-- Linear Executable
  88.            |  Loader Section  |     |   Module Header
  89.            |       Info       |     |   (Resident)
  90.            +------------------+     |
  91.            |   Table Offset   |     |
  92.            |       Info       |     |
  93.            +------------------+  <--+
  94.            |   Object Table   |     |
  95.            +------------------+     |
  96.            | Object Page Table|     |
  97.            +------------------+     |
  98.            |  Resource Table  |     |
  99.            +------------------+     |
  100.            |  Resident Name   |     |
  101.            |      Table       |     |
  102.            +------------------+     |-- Loader Section
  103.            |   Entry Table    |     |   (Resident)
  104.            +------------------+     |
  105.            |   Module Format  |     |
  106.            | Directives Table |     |
  107.            |    (Optional)    |     |
  108.            +------------------+     |
  109.            |     Resident     |     |
  110.            | Directives Data  |     |
  111.            |    (Optional)    |     |
  112.            |                  |     |
  113.            |  (Verify Record) |     |
  114.            +------------------+     |
  115.            |     Per-Page     |     |
  116.            |     Checksum     |     |
  117.            +------------------+  <--+
  118.            | Fixup Page Table |     |
  119.            +------------------+     |
  120.            |   Fixup Record   |     |
  121.            |       Table      |     |
  122.            +------------------+     |-- Fixup Section
  123.            |   Import Module  |     |   (Optionally Resident)
  124.            |    Name Table    |     |
  125.            +------------------+     |
  126.            | Import Procedure |     |
  127.            |    Name Table    |     |
  128.            +------------------+  <--+
  129.            |   Preload Pages  |     |
  130.            +------------------+     |
  131.            |    Demand Load   |     |
  132.            |       Pages      |     |
  133.            +------------------+     |
  134.            |  Iterated Pages  |     |
  135.            +------------------+     |
  136.            |   Non-Resident   |     |-- (Non-Resident)
  137.            |    Name Table    |     |
  138.            +------------------+     |
  139.            |   Non-Resident   |     |
  140.            | Directives Data  |     |
  141.            |    (Optional)    |     |
  142.            |                  |     |
  143.            |  (To be Defined) |     |
  144.            +------------------+  <--+
  145.            |    Debug Info    |     |-- (Not used by Loader)
  146.            +------------------+  <--+
  147.  
  148.  
  149.  
  150.  Figure 2. 32-bit Linear EXE Header
  151.  
  152.            +-----+-----+-----+-----+-----+-----+-----+-----+
  153.        00h | "L"   "X" |B-ORD|W-ORD|     FORMAT LEVEL      |
  154.            +-----+-----+-----+-----+-----+-----+-----+-----+
  155.        08h | CPU TYPE  |  OS TYPE  |    MODULE VERSION     |
  156.            +-----+-----+-----+-----+-----+-----+-----+-----+
  157.        10h |     MODULE FLAGS      |   MODULE # OF PAGES   |
  158.            +-----+-----+-----+-----+-----+-----+-----+-----+
  159.        18h |     EIP OBJECT #      |          EIP          |
  160.            +-----+-----+-----+-----+-----+-----+-----+-----+
  161.        20h |     ESP OBJECT #      |          ESP          |
  162.            +-----+-----+-----+-----+-----+-----+-----+-----+
  163.        28h |       PAGE SIZE       |   PAGE OFFSET SHIFT   |
  164.            +-----+-----+-----+-----+-----+-----+-----+-----+
  165.        30h |  FIXUP SECTION SIZE   | FIXUP SECTION CHECKSUM|
  166.            +-----+-----+-----+-----+-----+-----+-----+-----+
  167.        38h |  LOADER SECTION SIZE  |LOADER SECTION CHECKSUM|
  168.            +-----+-----+-----+-----+-----+-----+-----+-----+
  169.        40h |    OBJECT TABLE OFF   |  # OBJECTS IN MODULE  |
  170.            +-----+-----+-----+-----+-----+-----+-----+-----+
  171.        48h | OBJECT PAGE TABLE OFF | OBJECT ITER PAGES OFF |
  172.            +-----+-----+-----+-----+-----+-----+-----+-----+
  173.        50h | RESOURCE TABLE OFFSET |#RESOURCE TABLE ENTRIES|
  174.            +-----+-----+-----+-----+-----+-----+-----+-----+
  175.        58h | RESIDENT NAME TBL OFF |   ENTRY TABLE OFFSET  |
  176.            +-----+-----+-----+-----+-----+-----+-----+-----+
  177.        60h | MODULE DIRECTIVES OFF | # MODULE DIRECTIVES   |
  178.            +-----+-----+-----+-----+-----+-----+-----+-----+
  179.        68h | FIXUP PAGE TABLE OFF  |FIXUP RECORD TABLE OFF |
  180.            +-----+-----+-----+-----+-----+-----+-----+-----+
  181.        70h | IMPORT MODULE TBL OFF | # IMPORT MOD ENTRIES  |
  182.            +-----+-----+-----+-----+-----+-----+-----+-----+
  183.        78h |  IMPORT PROC TBL OFF  | PER-PAGE CHECKSUM OFF |
  184.            +-----+-----+-----+-----+-----+-----+-----+-----+
  185.        80h |   DATA PAGES OFFSET   |    #PRELOAD PAGES     |
  186.            +-----+-----+-----+-----+-----+-----+-----+-----+
  187.        88h | NON-RES NAME TBL OFF  | NON-RES NAME TBL LEN  |
  188.            +-----+-----+-----+-----+-----+-----+-----+-----+
  189.        90h | NON-RES NAME TBL CKSM |   AUTO DS OBJECT #    |
  190.            +-----+-----+-----+-----+-----+-----+-----+-----+
  191.        98h |    DEBUG INFO OFF     |    DEBUG INFO LEN     |
  192.            +-----+-----+-----+-----+-----+-----+-----+-----+
  193.        A0h |   #INSTANCE PRELOAD   |   #INSTANCE DEMAND    |
  194.            +-----+-----+-----+-----+-----+-----+-----+-----+
  195.        A8h |       HEAPSIZE        |
  196.            +-----+-----+-----+-----+
  197.  
  198.  Note: The OBJECT ITER PAGES OFF must either be 0 or set to the
  199.  same value as DATA PAGES OFFSET in OS/2 2.0. Ie., iterated pages are
  200.  required to be in the same section of the file as regular pages.
  201.  
  202.  Note: Table offsets  in the Linear  EXE Header may be set to
  203.  zero  to indicate that the table does not  exist in the  EXE
  204.  file and it's size is zero.
  205.  
  206.      "L" "X" = DW  Signature word.
  207.          The signature word is used by the loader to identify
  208.          the EXE file as  a valid  32-bit  Linear  Executable
  209.          Module  Format.  "L" is low order byte. "X"  is high
  210.          order byte.
  211.  
  212.      B-ORD = DB  Byte Ordering.
  213.          This byte specifies the byte ordering for the linear
  214.          EXE format.  The values are:
  215.  
  216.              00H - Little Endian Byte Ordering.
  217.              01H - Big Endian Byte Ordering.
  218.  
  219.      W-ORD = DB  Word Ordering.
  220.          This byte specifies the Word ordering for the linear
  221.          EXE format.  The values are:
  222.  
  223.              00H - Little Endian Word Ordering.
  224.              01H - Big Endian Word Ordering.
  225.  
  226.      Format Level = DD  Linear EXE Format Level.
  227.          The  Linear EXE Format Level is set  to  0  for  the
  228.          initial version  of  the 32-bit linear  EXE  format.
  229.          Each  incompatible  change to the  linear EXE format
  230.          must increment this value.  This  allows the  system
  231.          to recognized future EXE file versions  so  that  an
  232.          appropriate  error message  may  be displayed  if an
  233.          attempt is made to load them.
  234.  
  235.      CPU Type = DW  Module CPU Type.
  236.          This  field specifies the type  of  CPU required  by
  237.          this module to run.  The values are:
  238.  
  239.              01H  -  80286  or  upwardly  compatible  CPU  is
  240.              required to execute this module.
  241.              02H  -  80386  or  upwardly  compatible  CPU  is
  242.              required to execute this module.
  243.              03H  -  80486  or  upwardly  compatible  CPU  is
  244.              required to execute this module.
  245.  
  246.      OS Type = DW  Module OS Type.
  247.          This field specifies the type  of  Operating  system
  248.          required to run  this module.  The currently defined
  249.          values are:
  250.  
  251.              00H - Unknown (any "new-format" OS)
  252.              01H - OS/2 (default)
  253.              02H - Windows
  254.              03H - DOS 4.x
  255.              04H - Windows 386
  256.  
  257.      MODULE VERSION = DD  Version of the linear EXE module.
  258.          This is useful for differentiating between revisions
  259.          of dynamic linked modules.  This  value is specified
  260.          at link time by the user.
  261.  
  262.      MODULE FLAGS = DD  Flag bits for the module.
  263.          The module flag bits have the following definitions.
  264.  
  265.              00000001h = Reserved for system use.
  266.              00000002h = Reserved for system use.
  267.              00000004h = Per-Process Library Initialization.
  268.                  The setting  of this  bit  requires the  EIP
  269.                  Object  #  and  EIP  fields  to  have  valid
  270.                  values.  If the EIP Object # and EIP  fields
  271.                  are  valid  and this  bit is  NOT  set, then
  272.                  Global Library  Initialization  is  assumed.
  273.                  Setting this bit for an EXE file is invalid.
  274.  
  275.              00000008h = Reserved for system use.
  276.              00000010h = Internal fixups for the  module have
  277.              been applied.
  278.                  The  setting   of  this  bit  in  a   Linear
  279.                  Executable Module indicates that each object
  280.                  of  the module  has a preferred load address
  281.                  specified  in  the Object  Table  Reloc Base
  282.                  Addr.  If the module's  objects  can  not be
  283.                  loaded at  these  preferred  addresses, then
  284.                  the   relocation  records  that  have   been
  285.                  retained in the file data will be applied.
  286.  
  287.              00000020h = External fixups for  the module have
  288.              been applied.
  289.              00000040h = Reserved for system use.
  290.              00000080h = Reserved for system use.
  291.              00000100h = Incompatible with PM windowing.
  292.              00000200h = Compatible with PM windowing.
  293.              00000300h = Uses PM windowing API.
  294.              00000400h = Reserved for system use.
  295.              00000800h = Reserved for system use.
  296.              00001000h = Reserved for system use.
  297.              00002000h = Module is not loadable.
  298.                  When  the 'Module is  not loadable' flag  is
  299.                  set, it indicates that  either  errors  were
  300.                  detected at link  time or that the module is
  301.                  being  incrementally  linked  and  therefore
  302.                  can't be loaded.
  303.  
  304.              00004000h = Reserved for system use.
  305.              00038000h = Module type mask.
  306.              00000000h = Program module.
  307.                  A module  can not  contain  dynamic links to
  308.                  other modules that have the 'program module'
  309.                  type.
  310.  
  311.              00008000h = Library module.
  312.              00018000h = Protected Memory Library module.
  313.              00020000h = Physical Device Driver module.
  314.              00028000h = Virtual Device Driver module.
  315.              40000000h = Per-process Library Termination.
  316.                  The  setting of this bit  requires  the  EIP
  317.                  Object  #  and  EIP  fields  to  have  valid
  318.                  values.  If the EIP Object  # and EIP fields
  319.                  are  valid  and  this bit  is NOT  set, then
  320.                  Global  Library   Termination   is  assumed.
  321.                  Setting this bit for an EXE file is invalid.
  322.  
  323.      MODULE # PAGES = DD  Number of pages in module.
  324.  
  325.          This field specifies the number of  pages physically
  326.          contained in  this module.  In  other  words,  pages
  327.          containing  either enumerated or  iterated data,  or
  328.          zero-fill pages  that have relocations,  not invalid
  329.          or zero-fill  pages implied by  the  Virtual Size in
  330.          the Object  Table being  larger  than  the number of
  331.          pages actually in  the linear EXE file.  These pages
  332.          are  contained in the  'preload pages', 'demand load
  333.          pages'  and  'iterated  data pages' sections of  the
  334.          linear EXE module.  This  is  used  to determine the
  335.          size  of the page information tables  in  the linear
  336.          EXE module.
  337.  
  338.      EIP OBJECT #  = DD The Object number to which  the Entry
  339.      Address is relative.
  340.          This specifies the object to which the Entry Address
  341.          is  relative.  This must be a  nonzero  value  for a
  342.          program module to be correctly loaded.  A zero value
  343.          for a library module indicates that no library entry
  344.          routine exists.  If  this  value  is zero, then both
  345.          the  Per-process Library Initialization bit and  the
  346.          Per-process Library Termination bit must be clear in
  347.          the module flags,  or  else the loader will fail  to
  348.          load   the  module.  Further,  if  the   Per-process
  349.          Library Termination  bit is set, then the  object to
  350.          which  this field  refers  must  be a 32-bit  object
  351.          (i.e., the Big/Default bit must be set in the object
  352.          flags; see below).
  353.  
  354.      EIP = DD  Entry Address of module.
  355.          The  Entry  Address  is  the  starting  address  for
  356.          program modules and  the  library initialization and
  357.          Library termination address for library modules.
  358.  
  359.      ESP OBJECT # = DD The Object number to  which the ESP is
  360.      relative.
  361.          This  specifies the object to which the starting ESP
  362.          is relative.  This  must be  a  nonzero  value for a
  363.          program  module to be correctly  loaded.  This field
  364.          is ignored for a library module.
  365.  
  366.      ESP = DD  Starting stack address of module.
  367.          The  ESP defines the starting stack  pointer address
  368.          for program modules.  A zero  value  in  this  field
  369.          indicates   that   the  stack  pointer   is  to   be
  370.          initialized  to the  highest  address/offset in  the
  371.          object.  This field is ignored for a library module.
  372.  
  373.      PAGE SIZE = DD  The size of one page for this system.
  374.          This  field  specifies  the  page size  used  by the
  375.          linear EXE  format and the  system.  For the initial
  376.          version of this linear  EXE format the page  size is
  377.          4Kbytes.  (The 4K page size  is specified by a value
  378.          of 4096 in this field.)
  379.  
  380.      PAGE OFFSET  SHIFT = DD  The shift left  bits  for  page
  381.      offsets.
  382.          This  field  gives the number  of bit  positions  to
  383.          shift left when interpreting  the  Object Page Table
  384.          entries' page  offset  field.  This  determines  the
  385.          alignment  of the page information in the file.  For
  386.          example, a value of  4 in this field would align all
  387.          pages in the  Data Pages and Iterated Pages sections
  388.          on 16  byte  (paragraph)  boundaries.  A Page Offset
  389.          Shift of 9 would align all pages on a 512 byte (disk
  390.          sector) basis.  The default  value for this field is
  391.          12 (decimal), which give a 4096 byte alignment.  All
  392.          other offsets are byte aligned.
  393.  
  394.      FIXUP  SECTION  SIZE  =  DD  Total  size  of  the  fixup
  395.      information in bytes.
  396.          This includes the following 4 tables:
  397.  
  398.              - Fixup Page Table
  399.              - Fixup Record Table
  400.              - Import Module name Table
  401.              - Import Procedure Name Table
  402.  
  403.      FIXUP  SECTION  CHECKSUM   =   DD   Checksum  for  fixup
  404.      information.
  405.          This is a cryptographic checksum covering all of the
  406.          fixup  information.  The  checksum   for  the  fixup
  407.          information  is kept separate because the fixup data
  408.          is  not  always loaded into  main  memory  with  the
  409.          'loader  section'.  If  the  checksum feature is not
  410.          implemented, then the  linker will set  these fields
  411.          to zero.
  412.  
  413.      LOADER  SECTION  SIZE  =  DD  Size  of  memory  resident
  414.      tables.
  415.          This  is  the  total  size  in bytes of  the  tables
  416.          required to be memory resident for the module, while
  417.          the module is in use.  This total size  includes all
  418.          tables from the Object  Table down to  and including
  419.          the Per-Page Checksum Table.
  420.  
  421.      LOADER  SECTION  CHECKSUM  =  DD  Checksum   for  loader
  422.      section.
  423.          This is a cryptographic checksum covering all of the
  424.          loader section information.  If the checksum feature
  425.          is not implemented,  then the linker  will set these
  426.          fields to zero.
  427.  
  428.      OBJECT TABLE OFF = DD  Object Table offset.
  429.          This offset  is  relative  to  the  beginning of the
  430.          linear EXE header.
  431.  
  432.      # OBJECTS IN MODULE = DD  Object Table Count.
  433.          This defines the number of entries in Object Table.
  434.  
  435.      OBJECT PAGE TABLE OFFSET = DD  Object Page Table offset
  436.          This offset is  relative  to  the beginning  of  the
  437.          linear EXE header.
  438.  
  439.      OBJECT  ITER  PAGES  OFF  =  DD  Object  Iterated  Pages
  440.      offset.
  441.          This offset is relative to the beginning of  the EXE
  442.          file.
  443.  
  444.      RESOURCE TABLE OFF = DD  Resource Table offset.
  445.          This offset is relative  to  the  beginning  of  the
  446.          linear EXE header.
  447.  
  448.      # RESOURCE  TABLE  ENTRIES  = DD  Number  of entries  in
  449.      Resource Table.
  450.  
  451.      RESIDENT NAME TBL OFF = DD  Resident Name Table offset.
  452.          This offset is  relative  to  the  beginning  of the
  453.          linear EXE header.
  454.  
  455.      ENTRY TBL OFF = DD  Entry Table offset.
  456.          This  offset  is  relative  to the beginning of  the
  457.          linear EXE header.
  458.  
  459.      MODULE DIRECTIVES  OFF  =  DD  Module  Format Directives
  460.      Table offset.
  461.          This  offset  is  relative  to  the beginning of the
  462.          linear EXE header.
  463.  
  464.      #  MODULE  DIRECTIVES  =  DD  Number  of  Module  Format
  465.      Directives in the Table.
  466.          This field specifies the number  of  entries in  the
  467.          Module Format Directives Table.
  468.  
  469.      FIXUP PAGE TABLE OFF = DD  Fixup Page Table offset.
  470.          This  offset  is  relative to the  beginning of  the
  471.          linear EXE header.
  472.  
  473.      FIXUP RECORD TABLE OFF = DD  Fixup Record Table Offset
  474.          This  offset is relative to  the  beginning  of  the
  475.          linear EXE header.
  476.  
  477.      IMPORT  MODULE  TBL  OFF = DD  Import  Module Name Table
  478.      offset.
  479.          This  offset is relative  to  the  beginning of  the
  480.          linear EXE header.
  481.  
  482.      # IMPORT MOD ENTRIES = DD  The  number of entries in the
  483.      Import Module Name Table.
  484.  
  485.      IMPORT PROC TBL OFF  =  DD  Import Procedure  Name Table
  486.      offset.
  487.          This offset  is relative  to  the  beginning of  the
  488.          linear EXE header.
  489.  
  490.      PER-PAGE CHECKSUM  OFF  =  DD  Per-Page  Checksum  Table
  491.      offset.
  492.          This  offset is  relative  to  the beginning of  the
  493.          linear EXE header.
  494.  
  495.      DATA PAGES OFFSET = DD   Data Pages Offset.
  496.          This offset is  relative to the beginning of the EXE
  497.          file.
  498.  
  499.      # PRELOAD PAGES = DD  Number  of  Preload pages for this
  500.      module. Note that OS/2 2.0 does not respect the preload
  501.      of pages as specified in the executable file for performance
  502.      reasons.
  503.  
  504.      NON-RES NAME  TBL  OFF  =  DD  Non-Resident  Name  Table
  505.      offset.
  506.          This offset is relative to the beginning of  the EXE
  507.          file.
  508.  
  509.      NON-RES  NAME  TBL  LEN = DD  Number  of  bytes  in  the
  510.      Non-resident name table.
  511.  
  512.      NON-RES  NAME TBL CKSM  =  DD  Non-Resident  Name  Table
  513.      Checksum.
  514.          This is a cryptographic checksum of the Non-Resident
  515.          Name Table.
  516.  
  517.      AUTO  DS OBJECT  #  =  DD  The Auto Data  Segment Object
  518.      number.
  519.          This is the object number for  the Auto Data Segment
  520.          used by 16-bit modules.  This field is supported for
  521.          16-bit compatibility only and is not used by  32-bit
  522.          modules.
  523.  
  524.      DEBUG INFO OFF = DD  Debug Information offset.
  525.          This offset  is relative  to  the  beginning  of the
  526.          linear EXE header.
  527.  
  528.      DEBUG INFO LEN = DD  Debug Information length.
  529.          The length of the debug information in bytes.
  530.  
  531.       #  INSTANCE  PRELOAD  = DD Instance  pages  in  preload
  532.      section.
  533.          The  number  of instance  data pages  found  in  the
  534.          preload section.
  535.  
  536.       #  INSTANCE  DEMAND  =  DD  Instance  pages  in  demand
  537.      section.
  538.          The  number  of instance  data pages  found  in  the
  539.          demand section.
  540.  
  541.       HEAPSIZE = DD Heap size added to the Auto DS Object.
  542.          The heap size is the  number  of  bytes added to the
  543.          Auto  Data  Segment  by the loader.  This  field  is
  544.          supported for  16-bit compatibility only and is  not
  545.          used by 32-bit modules.
  546.  
  547.  
  548.  
  549.  
  550.  
  551.      Program (EXE) startup registers and Library entry registers
  552.  
  553.  
  554.      Program startup registers are defined as follows.
  555.  
  556.          EIP = Starting program entry address.
  557.  
  558.          ESP = Top of stack address.
  559.  
  560.          CS = Code selector for base of linear address space.
  561.  
  562.          DS =  ES  = SS = Data  selector  for  base of linear
  563.          address space.
  564.  
  565.          FS =  Data selector  of  base of Thread  Information
  566.          Block (TIB).
  567.  
  568.          GS = 0.
  569.  
  570.          EAX = EBX = 0.
  571.  
  572.          ECX = EDX = 0.
  573.  
  574.          ESI = EDI = 0.
  575.  
  576.          EBP = 0.
  577.  
  578.          [ESP+0] =  Return  address to  routine  which  calls
  579.          DosExit(1,EAX).
  580.  
  581.          [ESP+4] = Module handle for program module.
  582.  
  583.          [ESP+8] = Reserved.
  584.  
  585.          [ESP+12] = Environment data object address.
  586.  
  587.          [ESP+16]   =   Command  line   linear   address   in
  588.          environment data object.
  589.  
  590.  
  591.      Library initialization registers are defined as follows.
  592.  
  593.          EIP = Library entry address.
  594.  
  595.          ESP = User program stack.
  596.  
  597.          CS = Code selector for base of linear address space.
  598.  
  599.          DS  = ES = SS = Data  selector  for  base  of linear
  600.          address space.
  601.  
  602.          Note that a  32-bit Protected Memory Library  module
  603.          will be  given  a  GDT  selector in  the  DS  and ES
  604.          registers (PROTDS)  that  addresses the  full linear
  605.          address  space  available  to  a  application.  This
  606.          selector  should  be  saved  by  the  initialization
  607.          routine.  Non-Protected  Memory Library modules will
  608.          receive a selector (FLATDS) that  addresses the same
  609.          amount of linear  address  space as an application's
  610.          .EXE can.
  611.  
  612.          FS  = Data selector  of base  of  Thread Information
  613.          Block (TIB).
  614.  
  615.          GS = 0.
  616.  
  617.          EAX = EBX = 0.
  618.  
  619.          ECX = EDX = 0.
  620.  
  621.          ESI = EDI = 0.
  622.  
  623.          EBP = 0.
  624.  
  625.          [ESP+0] = Return address to system, (EAX)  =  return
  626.          code.
  627.  
  628.          [ESP+4] = Module handle for library module.
  629.  
  630.          [ESP+8] = 0 (Initialization)
  631.  
  632.      Note that a  32-bit  library may specify  that its entry
  633.      address is  in  a 16-bit code object.  In this case, the
  634.      entry registers are the same  as for  entry to a library
  635.      using the Segmented  EXE format.  These  are  documented
  636.      elsewhere.  This  means  that  a  16-bit  library may be
  637.      relinked to take advantage of the benefits of the Linear
  638.      EXE format (notably, efficient paging).
  639.  
  640.  
  641.      Library termination registers are defined as follows.
  642.  
  643.          EIP = Library entry address.
  644.  
  645.          ESP = User program stack.
  646.  
  647.          CS = Code selector for base of linear address space.
  648.  
  649.          DS  =  ES  = SS  = Data  selector for base of linear
  650.          address space.
  651.  
  652.          FS  =  Data  selector of base of  Thread Information
  653.          Block (TIB).
  654.  
  655.          GS = 0.
  656.  
  657.          EAX = EBX = 0.
  658.  
  659.          ECX = EDX = 0.
  660.  
  661.          ESI = EDI = 0.
  662.  
  663.          EBP = 0.
  664.  
  665.          [ESP+0] = Return address to system.
  666.  
  667.          [ESP+4] = Module handle for library module.
  668.  
  669.          [ESP+8] = 1 (Termination)
  670.  
  671.      Note  that  Library  termination  is  not  allowed   for
  672.      libraries with 16-bit entries.
  673.  
  674.  
  675.  
  676.  
  677.  
  678.      Object Table
  679.  
  680.  
  681.  The number of entries in the Object Table  is given by the #
  682.  Objects in Module  field  in the linear EXE header.  Entries
  683.  in the Object Table are numbered starting from one.
  684.  
  685.  Each Object Table entry has the following format:
  686.  
  687.            +-----+-----+-----+-----+-----+-----+-----+-----+
  688.        00h |     VIRTUAL SIZE      |    RELOC BASE ADDR    |
  689.            +-----+-----+-----+-----+-----+-----+-----+-----+
  690.        08h |     OBJECT FLAGS      |    PAGE TABLE INDEX   |
  691.            +-----+-----+-----+-----+-----+-----+-----+-----+
  692.        10h |  # PAGE TABLE ENTRIES |       RESERVED        |
  693.            +-----+-----+-----+-----+-----+-----+-----+-----+
  694.  
  695.      VIRTUAL SIZE = DD  Virtual memory size.
  696.          This  is  the  size  of  the  object  that  will  be
  697.          allocated  when the object is loaded.  The  object's
  698.          virtual  size (rounded  up to  the page  size value)
  699.          must be  greater than or equal to the total  size of
  700.          the  pages  in the  EXE  file  for the object.  This
  701.          memory size must also be large enough to contain all
  702.          of the iterated data and uninitialized  data in  the
  703.          EXE file.
  704.  
  705.      RELOC BASE ADDR = DD Relocation Base Address.
  706.          The relocation base  address the object is currently
  707.          relocated to.  If the internal relocation fixups for
  708.          the  module have been  removed, this is  the address
  709.          the object will be allocated at by the loader.
  710.  
  711.      OBJECT FLAGS = DW  Flag bits for the object.
  712.          The object flag bits have the following definitions.
  713.  
  714.              0001h = Readable Object.
  715.              0002h = Writable Object.
  716.              0004h = Executable Object.
  717.                  The readable,  writable and executable flags
  718.                  provide    support    for    all    possible
  719.                  protections.  In systems where  all of these
  720.                  protections are not  supported,  the  loader
  721.                  will   be   responsible   for   making   the
  722.                  appropriate protection match for the system.
  723.  
  724.              0008h = Resource Object.
  725.              0010h = Discardable Object.
  726.              0020h = Object is Shared.
  727.              0040h = Object has Preload Pages.
  728.              0080h = Object has Invalid Pages.
  729.              0100h = Object has Zero Filled Pages.
  730.              0200h = Object is Resident (valid for VDDs, PDDs
  731.              only).
  732.              0300h = Object is Resident  &  Contiguous (VDDs,
  733.              PDDs only).
  734.              0400h  =  Object is  Resident  & 'long-lockable'
  735.              (VDDs, PDDs only).
  736.              0800h = Reserved for system use.
  737.              1000h = 16:16 Alias Required (80x86 Specific).
  738.              2000h   =   Big/Default   Bit   Setting   (80x86
  739.              Specific).
  740.                  The 'big/default'  bit , for data  segments,
  741.                  controls the setting of the Big  bit  in the
  742.                  segment descriptor.  (The Big bit, or B-bit,
  743.                  determines whether ESP or SP is used  as the
  744.                  stack pointer.)  For code segments, this bit
  745.                  controls the setting of the  Default  bit in
  746.                  the segment descriptor.  (The  Default  bit,
  747.                  or  D-bit, determines  whether  the  default
  748.                  word  size  is 32-bits or 16-bits.  It  also
  749.                  affects   the    interpretation    of    the
  750.                  instruction stream.)
  751.  
  752.              4000h =  Object is  conforming  for  code (80x86
  753.              Specific).
  754.              8000h  =  Object  I/O  privilege   level  (80x86
  755.              Specific).
  756.                  Only used for 16:16 Alias Objects.
  757.  
  758.      PAGE TABLE INDEX = DD  Object Page Table Index.
  759.          This specifies the number of  the first  object page
  760.          table  entry for this object.  The object page table
  761.          specifies where in the EXE file a page  can be found
  762.          for   a   given   object   and   specifies  per-page
  763.          attributes.
  764.  
  765.          The object table entries are ordered by logical page
  766.          in the  object  table.  In  other  words  the object
  767.          table entries  are sorted based  on  the object page
  768.          table index value.
  769.  
  770.      #  PAGE TABLE ENTRIES  =  DD  #  of  object  page  table
  771.      entries for this object.
  772.          Any logical pages at the  end  of an  object that do
  773.          not  have  an   entry   in  the  object  page  table
  774.          associated  with them are handled as zero  filled or
  775.          invalid pages by the loader.
  776.  
  777.          When the last  logical pages  of an  object  are not
  778.          specified with an object page table entry,  they are
  779.          treated as either zero filled pages or invalid pages
  780.          based on the last entry in the object page table for
  781.          that object.  If  the last entry was  neither a zero
  782.          filled  or invalid  page, then the additional  pages
  783.          are treated as zero filled pages.
  784.  
  785.      RESERVED = DD  Reserved for future use.  Must  be set to
  786.      zero.
  787.  
  788.  
  789.  
  790.      Object Page Table
  791.  
  792.  
  793.  The  Object  page table provides information about a logical
  794.  page in  an object.  A  logical  page  may be  an enumerated
  795.  page, a pseudo page or an iterated  page.  The  structure of
  796.  the  object page table in conjunction with the  structure of
  797.  the  object table allows for efficient access of a page when
  798.  a page fault occurs, while  still allowing the physical page
  799.  data to be located  in the preload page, demand load page or
  800.  iterated data  page sections in the linear  EXE  module. The
  801.  logical page entries  in the Object Page Table  are numbered
  802.  starting from one.  The Object Page Table is parallel to the
  803.  Fixup  Page Table  as  they are both indexed by the  logical
  804.  page number.
  805.  
  806.  Each Object Page Table entry has the following format:
  807.  
  808.           63                     32 31       16 15         0
  809.            +-----+-----+-----+-----+-----+-----+-----+-----+
  810.        00h |    PAGE DATA OFFSET   | DATA SIZE |   FLAGS   |
  811.            +-----+-----+-----+-----+-----+-----+-----+-----+
  812.  
  813.      PAGE DATA OFFSET = DD  Offset  to  the page  data in the
  814.      EXE file.
  815.          This field, when bit shifted left by the PAGE OFFSET
  816.          SHIFT from the  module header, specifies  the offset
  817.          from  the beginning of  the Preload Page section  of
  818.          the  physical  page  data  in   the  EXE  file  that
  819.          corresponds to this logical  page  entry.  The  page
  820.          data  may  reside in the  Preload Pages, Demand Load
  821.          Pages or the Iterated Data Pages sections.
  822.  
  823.          If  the  FLAGS  field  specifies  that  this  is   a
  824.          zero-Filled page  then the  PAGE DATA  OFFSET  field
  825.          will contain a 0.
  826.  
  827.          If the logical page is specified as an iterated data
  828.          page,  as  indicated  by the FLAGS field, then  this
  829.          field specifies the  offset into the  Iterated  Data
  830.          Pages section.
  831.  
  832.          The logical page number  (Object Page  Table index),
  833.          is  used  to index  the Fixup Page Table to find any
  834.          fixups associated with the logical page.
  835.  
  836.  
  837.      DATA SIZE = DW  Number of bytes of data for this page.
  838.          This field specifies the actual number of bytes that
  839.          represent the page in  the  file.  If  the PAGE SIZE
  840.          field  from the  module header is greater  than  the
  841.          value of this  field and the FLAGS field indicates a
  842.          Legal Physical  Page,  the remaining bytes are to be
  843.          filled with zeros.  If  the FLAGS field indicates an
  844.          Iterated  Data Page,  the iterated data records will
  845.          completely fill out the remainder.
  846.  
  847.  
  848.      FLAGS =  DW  Attributes  specifying  characteristics  of
  849.      this logical page.
  850.          The bit definitions for this word field follow,
  851.  
  852.              00h = Legal Physical Page  in the module (Offset
  853.              from Preload Page Section).
  854.              01h  = Iterated Data Page (Offset from  Iterated
  855.              Data Pages Section).
  856.              02h = Invalid Page (zero).
  857.              03h = Zero Filled Page (zero).
  858.              04h = Range of Pages.
  859.  
  860.  
  861.  
  862.  
  863.      Resource Table
  864.  
  865.  
  866.  The resource table is  an array of  resource  table entries.
  867.  Each resource  table entry  contains  a type ID and name ID.
  868.  These entries  are used to locate resource objects contained
  869.  in the Object table.  The number  of entries in the resource
  870.  table is defined by the  Resource Table Count located in the
  871.  linear EXE  header.  More than one resource may be contained
  872.  within  a  single  object.  Resource table entries are in  a
  873.  sorted  order,  (ascending,  by Resource Name ID  within the
  874.  Resource  Type  ID).  This  allows  the  DosGetResource  API
  875.  function to use a binary search when looking  up  a resource
  876.  in  a 32-bit module instead of the linear  search being used
  877.  in the current 16-bit module.
  878.  
  879.  Each resource entry has the following format:
  880.  
  881.            +-----+-----+-----+-----+
  882.        00h |  TYPE ID  |  NAME ID  |
  883.            +-----+-----+-----+-----+
  884.        04h |     RESOURCE SIZE     |
  885.            +-----+-----+-----+-----+-----+-----+
  886.        08h |   OBJECT  |        OFFSET         |
  887.            +-----+-----+-----+-----+-----+-----+
  888.  
  889.  
  890.      TYPE ID = DW  Resource type ID.
  891.          The type of resources are:
  892.  
  893.              BTMP = Bitmap
  894.              EMSG = Error message string
  895.              FONT = Fonts
  896.  
  897.      NAME ID = DW  An ID used as a name for the resource when
  898.      referred to.
  899.  
  900.      RESOURCE SIZE =  DD  The  number of  bytes the  resource
  901.      consists of.
  902.  
  903.      OBJECT = DW  The number of the object which contains the
  904.      resource.
  905.  
  906.      OFFSET  = DD  The  offset  within the  specified  object
  907.      where the resource begins.
  908.  
  909.  
  910.  
  911.  
  912.  
  913.      Resident or Non-resident Name Table Entry
  914.  
  915.  
  916.  The  resident and  non-resident name tables define the ASCII
  917.  names  and  ordinal  numbers  for  exported  entries  in the
  918.  module.  In  addition the first  entry in the resident  name
  919.  table contains  the  module name. These tables  are  used to
  920.  translate a procedure name  string into an ordinal number by
  921.  searching for a matching name string.  The ordinal number is
  922.  used  to  locate the  entry  point information in the  entry
  923.  table.
  924.  
  925.  The resident name  table is kept  resident  in system memory
  926.  while the  module is loaded.  It is intended to contain  the
  927.  exported  entry point names  that  are frequently dynamicaly
  928.  linked to  by  name.  Non-resident  names  are  not  kept in
  929.  memory and are read from the  EXE file when a  dynamic  link
  930.  reference  is made.  Exported  entry  point  names  that are
  931.  infrequently dynamicaly linked to by  name  or are  commonly
  932.  referenced  by  ordinal  number  should  be  placed  in  the
  933.  non-resident name  table.  The trade off made for references
  934.  by name is performance vs memory usage.
  935.  
  936.  Import  references  by  name  require  these  tables  to  be
  937.  searched  to  obtain the entry point ordinal number.  Import
  938.  references  by  ordinal  number  provide the fastest  lookup
  939.  since the search of these tables is not required.
  940.  
  941.  The strings are CASE SENSITIVE and are NOT NULL TERMINATED.
  942.  
  943.  Each name table entry has the following format:
  944.  
  945.            +-----+-----+-----+-----+     +-----+-----+-----+
  946.        00h | LEN |    ASCII STRING  . . .      | ORDINAL # |
  947.            +-----+-----+-----+-----+     +-----+-----+-----+
  948.  
  949.  
  950.      LEN = DB  String Length.
  951.          This  defines the length  of the string in bytes.  A
  952.          zero length indicates there  are no more  entries in
  953.          table.  The length of  each  ascii  name  string  is
  954.          limited to 127 characters.
  955.  
  956.          The high bit in  the LEN field (bit 7) is defined as
  957.          an Overload bit.  This bit signifies that additional
  958.          information is contained in  the  linear  EXE module
  959.          and will be  used in the  future  for parameter type
  960.          checking.
  961.  
  962.      ASCII STRING = DB  ASCII String.
  963.          This is a variable length string  with  it's  length
  964.          defined  in  bytes by the LEN field.  The string  is
  965.          case case sensitive and is not null terminated.
  966.  
  967.      ORDINAL # = DW  Ordinal number.
  968.          The ordinal number  in  an  ordered  index  into the
  969.          entry table for this entry point.
  970.  
  971.  
  972.  
  973.  
  974.  
  975.      Entry Table
  976.  
  977.  
  978.  The entry table contains object  and offset information that
  979.  is used to resolve fixup  references  to  the  entry  points
  980.  within this module.  Not all entry points in the entry table
  981.  will be exported, some entry points will only be used within
  982.  the module.  An  ordinal number is  used to  index  into the
  983.  entry table.  The entry table entries  are numbered starting
  984.  from one.
  985.  
  986.  The  list  of  entries  are compressed into 'bundles', where
  987.  possible.  The entries within  each bundle are all the  same
  988.  size.  A bundle starts with  a  count field  which indicates
  989.  the number of entries in the bundle.  The  count is followed
  990.  by a  type field  which identifies the  bundle format.  This
  991.  provides  both  a  means  for  saving  space as  well  as  a
  992.  mechanism for extending the bundle types.
  993.  
  994.  The type field  allows  the  definition of 256 bundle types.
  995.  The following bundle types will initially be defined:
  996.  
  997.      Unused Entry.
  998.      16-bit Entry.
  999.      286 Call Gate Entry.
  1000.      32-bit Entry.
  1001.      Forwarder Entry.
  1002.  
  1003.  The bundled entry table has the following format:
  1004.  
  1005.            +-----+-----+-----+-----+-----+
  1006.        00h | CNT |TYPE | BUNDLE INFO . . .
  1007.            +-----+-----+-----+-----+-----+
  1008.  
  1009.  
  1010.      CNT = DB  Number of entries.
  1011.          This is the number of entries in this bundle.
  1012.  
  1013.          A  zero value for  the number of entries  identifies
  1014.          the  end of the entry  table.  There  is no  further
  1015.          bundle  information when  the number  of entries  is
  1016.          zero.  In other words the entry  table is terminated
  1017.          by a single zero byte.
  1018.  
  1019.      TYPE = DB  Bundle type.
  1020.          This  defines the  bundle type  which determines the
  1021.          contents of the BUNDLE INFO.
  1022.  
  1023.              The follow types are defined:
  1024.  
  1025.                  00h = Unused Entry.
  1026.                  01h = 16-bit Entry.
  1027.                  02h = 286 Call Gate Entry.
  1028.                  03h = 32-bit Entry.
  1029.                  04h = Forwarder Entry.
  1030.                  80h = Parameter Typing Information Present.
  1031.                      This   bit  signifies   that  additional
  1032.                      information  is contained in the  linear
  1033.                      EXE module  and  will  be  used  in  the
  1034.                      future for parameter type checking.
  1035.  
  1036.  
  1037.      The following is the format for each bundle type:
  1038.  
  1039.                +-----+-----+
  1040.            00h | CNT |TYPE |
  1041.                +-----+-----+
  1042.  
  1043.          CNT = DB  Number of entries.
  1044.              This is the number of unused entries to skip.
  1045.  
  1046.          TYPE = DB  0 (Unused Entry)
  1047.  
  1048.                +-----+-----+-----+-----+
  1049.            00h | CNT |TYPE |   OBJECT  |
  1050.                +-----+-----+-----+-----+
  1051.            04h |FLAGS|  OFFSET   |
  1052.                +-----+-----+-----+
  1053.            07h | ... |   . . .   |
  1054.                +     +     +     +
  1055.  
  1056.  
  1057.          CNT = DB  Number of entries.
  1058.              This is the  number of 16-bit  entries  in  this
  1059.              bundle.  The flags and offset value are repeated
  1060.              this number of times.
  1061.  
  1062.          TYPE = DB  1 (16-bit Entry)
  1063.  
  1064.              OBJECT = DW  Object number.
  1065.                  This is the object number for the entries in
  1066.                  this bundle.
  1067.  
  1068.              FLAGS = DB  Entry flags.
  1069.                  These  are the  flags for this entry  point.
  1070.                  They have the following definition.
  1071.  
  1072.                      01h = Exported entry flag.
  1073.                      F8h = Parameter word count mask.
  1074.  
  1075.              OFFSET = DW  Offset in object.
  1076.                  This is the  offset  in the  object for  the
  1077.                  entry point defined at this ordinal number.
  1078.  
  1079.  
  1080.                +-----+-----+-----+-----+
  1081.            00h | CNT |TYPE |   OBJECT  |
  1082.                +-----+-----+-----+-----+-----+
  1083.            04h |FLAGS|  OFFSET   | CALLGATE  |
  1084.                +-----+-----+-----+-----+-----+
  1085.            09h | ... |   . . .   |   . . .   |
  1086.                +     +     +     +     +     +
  1087.  
  1088.  
  1089.          CNT = DB  Number of entries.
  1090.              This is  the number of 286  call gate entries in
  1091.              this  bundle.  The  flags,  callgate, and offset
  1092.              value are repeated this number of times.
  1093.  
  1094.          TYPE = DB  2 (286 Call Gate Entry)
  1095.              The 286 Call Gate Entry  Point type is needed by
  1096.              the loader only  if ring  2 segments  are to  be
  1097.              supported.  286  Call  Gate  entries  contain  2
  1098.              extra bytes  which  are  used by  the  loader to
  1099.              store an LDT callgate selector value.
  1100.  
  1101.          OBJECT = DW  Object number.
  1102.              This is the  object  number  for the  entries in
  1103.              this bundle.
  1104.  
  1105.          FLAGS = DB  Entry flags.
  1106.              These are the flags  for this entry point.  They
  1107.              have the following definition.
  1108.  
  1109.                  01h = Exported entry flag.
  1110.                  F8h = Parameter word count mask.
  1111.  
  1112.          OFFSET = DW  Offset in object.
  1113.              This is the offset in the object  for  the entry
  1114.              point defined at this ordinal number.
  1115.  
  1116.          CALLGATE = DW  Callgate selector.
  1117.              The callgate  selector is a  reserved field used
  1118.              by the  loader  to store a  call  gate  selector
  1119.              value for references  to  ring  2  entry points.
  1120.              When a  ring 3 reference to a ring 2 entry point
  1121.              is  made,  the  callgate  selector with  a  zero
  1122.              offset is place in the relocation fixup address.
  1123.              The  segment  number  and  offset  in segment is
  1124.              placed in the LDT callgate.
  1125.  
  1126.  
  1127.                +-----+-----+-----+-----+
  1128.            00h | CNT |TYPE |   OBJECT  |
  1129.                +-----+-----+-----+-----+-----+
  1130.            04h |FLAGS|        OFFSET         |
  1131.                +-----+-----+-----+-----+-----+
  1132.            09h | ... |         . . .         |
  1133.                +     +     +     +     +     +
  1134.  
  1135.          CNT = DB  Number of entries.
  1136.              This is  the  number  of  32-bit entries in this
  1137.              bundle.  The flags and offset value are repeated
  1138.              this number of times.
  1139.  
  1140.          TYPE = DB  3 (32-bit Entry)
  1141.              The 32-bit Entry type will  only be  defined  by
  1142.              the linker when the offset in the object can not
  1143.              be specified by a 16-bit offset.
  1144.  
  1145.          OBJECT = DW  Object number.
  1146.              This  is  the object  number for the  entries in
  1147.              this bundle.
  1148.  
  1149.          FLAGS = DB  Entry flags.
  1150.              These are the  flags for this entry point.  They
  1151.              have the following definition.
  1152.  
  1153.                  01h = Exported entry flag.
  1154.                  F8h = Parameter dword count mask.
  1155.  
  1156.          OFFSET = DD  Offset in object.
  1157.              This is  the  offset in the object for the entry
  1158.              point defined at this ordinal number.
  1159.  
  1160.            +-----+-----+-----+-----+
  1161.        00h | CNT |TYPE | RESERVED  |
  1162.            +-----+-----+-----+-----+-----+-----+-----+
  1163.        04h |FLAGS| MOD ORD#  | OFFSET / ORDNUM       |
  1164.            +-----+-----+-----+-----+-----+-----+-----+
  1165.        09h | ... |    ...    |          ...          |
  1166.            +     +     +     +     +     +     +     +
  1167.  
  1168.      CNT = DB  Number of entries.
  1169.          This  is  the number  of forwarder  entries in  this
  1170.          bundle.  The  FLAGS,  MOD  ORD#,  and  OFFSET/ORDNUM
  1171.          values are repeated this number of times.
  1172.  
  1173.      TYPE = DB  4 (Forwarder Entry)
  1174.  
  1175.      RESERVED = DW 0
  1176.          This field is reserved for future use.
  1177.  
  1178.      FLAGS = DB  Forwarder flags.
  1179.          These  are the flags  for  this  entry  point.  They
  1180.          have the following definition.
  1181.  
  1182.              01h = Import by ordinal.
  1183.              F7h = Reserved for future use; should be zero.
  1184.  
  1185.      MOD ORD# = DW Module Ordinal Number
  1186.          This  is the index into the Import Module Name Table
  1187.          for this forwarder.
  1188.  
  1189.      OFFSET  /  ORDNUM = DD Procedure  Name Offset  or Import
  1190.      Ordinal Number
  1191.          If the FLAGS field indicates import by ordinal, then
  1192.          this field  is  the  ordinal number  into  the Entry
  1193.          Table of the target module, otherwise this  field is
  1194.          the  offset  into the Procedure Names Table  of  the
  1195.          target module.
  1196.  
  1197.  A Forwarder entry (type  = 4) is  an entry point whose value
  1198.  is an imported  reference.  When  a load  time  fixup occurs
  1199.  whose target is a forwarder, the  loader obtains the address
  1200.  imported by the forwarder and  uses that imported address to
  1201.  resolve the fixup.
  1202.  
  1203.  A forwarder  may refer  to an entry point  in another module
  1204.  which  is itself a  forwarder, so there  can be a  chain  of
  1205.  forwarders.  The  loader  will traverse the chain  until  it
  1206.  finds a non-forwarded entry point which terminates the chain
  1207.  ,  and  use  this to  resolve  the original fixup.  Circular
  1208.  chains are detected by the loader  and result in a load time
  1209.  error.  A  maximum of 1024 forwarders is allowed in a chain;
  1210.  more than this results in a load time error.
  1211.  
  1212.  Forwarders  are useful for merging and recombining API calls
  1213.  into  different  sets   of   libraries,   while  maintaining
  1214.  compatibility with applications.  For example, if one wanted
  1215.  to  combine MONCALLS,  MOUCALLS,  and VIOCALLS into a single
  1216.  libraries, one  could  provide entry  points  for  the three
  1217.  libraries  that   are  forwarders  pointing  to  the  common
  1218.  implementation.
  1219.  
  1220.  
  1221.  
  1222.      Module Format Directives Table
  1223.  
  1224.  
  1225.  The Module Format Directives Table is an optional table that
  1226.  allows additional options to  be specified.  It also  allows
  1227.  for  the extension of the  linear  EXE  format  by  allowing
  1228.  additional tables  of  information to be added to the linear
  1229.  EXE  module  without affecting the format  of the linear EXE
  1230.  header.  Likewise,  module format directives provide a place
  1231.  in   the   linear  EXE  module  for  'temporary  tables'  of
  1232.  information,  such as  incremental linking  information  and
  1233.  statistic information  gathered  on the module.  When  there
  1234.  are no module format directives for a linear EXE module, the
  1235.  fields  in  the linear EXE  header  referencing  the  module
  1236.  format directives table are zero.
  1237.  
  1238.  Each Module  Format Directive Table entry  has the following
  1239.  format:
  1240.  
  1241.            +-----+-----+-----+-----+-----+-----+----+----+
  1242.        00h | DIRECT #  | DATA LEN  |     DATA OFFSET     |
  1243.            +-----+-----+-----+-----+-----+-----+----+----+
  1244.  
  1245.      DIRECT # = DW  Directive number.
  1246.          The directive number specifies the type of directive
  1247.          defined.  This  can be used to  determine the format
  1248.          of  the  information  in  the  directive  data.  The
  1249.          following directive numbers have been defined:
  1250.  
  1251.              8000h = Resident Flag Mask.
  1252.                  Directive numbers with this bit set indicate
  1253.                  that the directive data is in  the  resident
  1254.                  area and will  be kept  resident  in  memory
  1255.                  when the module is loaded.
  1256.  
  1257.              8001h = Verify Record Directive. (Verify  record
  1258.              is a resident table.)
  1259.              0002h = Language Information Directive. (This is
  1260.              a non-resident table.)
  1261.              0003h = Co-Processor Required Support Table.
  1262.              0004h = Thread State Initialization Directive.
  1263.  
  1264.          Additional directives can be  added as needed in the
  1265.          future, as long as  they  do  not overlap previously
  1266.          defined directive numbers.
  1267.  
  1268.      DATA LEN = DW  Directive data length.
  1269.          This specifies the length in  byte of  the directive
  1270.          data for this directive number.
  1271.  
  1272.      DIRECTIVE OFFSET = DD  Directive data offset.
  1273.          This  is the offset to  the directive data for  this
  1274.          directive number.  It  is  relative to beginning  of
  1275.          linear EXE header for a resident table, and relative
  1276.          to  the  beginning of the EXE  file for non-resident
  1277.          tables.
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.      Verify Record Directive Table
  1284.  
  1285.  
  1286.  The Verify Record Directive Table  is an optional table.  It
  1287.  maintains a record  of  the pages in  the EXE file that have
  1288.  been  fixed up  and written back to the  original linear EXE
  1289.  module, along with the  module  dependencies used to perform
  1290.  these fixups.  This table  provides  an  efficient means for
  1291.  verifying the  virtual  addresses  required for the fixed up
  1292.  pages when the module is loaded.
  1293.  
  1294.  Each Verify Record entry has the following format:
  1295.  
  1296.            +-----+-----+
  1297.        00h |# OF ENTRY |
  1298.            +-----+-----+-----+-----+-----+-----+
  1299.        02h | MOD ORD # |  VERSION  | MOD # OBJ |
  1300.            +-----+-----+-----+-----+-----+-----+
  1301.        08h | OBJECT #  | BASE ADDR |  VIRTUAL  |
  1302.            +-----+-----+-----+-----+-----+-----+
  1303.        0Eh |   . . .   |   . . .   |   . . .   |
  1304.            +     +     +     +     +     +     +
  1305.  
  1306.      # OF ENTRY = DW  Number of module dependencies.
  1307.          This field specifies how many  entries there  are in
  1308.          the verify record directive table.  This is equal to
  1309.          the number of modules referenced by this module.
  1310.  
  1311.      MOD  ORD # = DW  Ordinal index  into  the  Import Module
  1312.      Name Table.
  1313.          This value is an ordered  index  in  to  the  Import
  1314.          Module Name Table for the referenced module.
  1315.  
  1316.      VERSION = DW  Module Version.
  1317.  
  1318.          This  is the version of  the  referenced module that
  1319.          the fixups  were originally performed.  This is used
  1320.          to insure the same version  of the referenced module
  1321.          is  loaded  that  was  fixed up  in this module  and
  1322.          therefore   the   fixups  are  still  correct.  This
  1323.          requires  the  version number  in  a  module  to  be
  1324.          incremented anytime the entry point offsets change.
  1325.  
  1326.      MOD # OBJ = DW  Module # of Object Entries.
  1327.          This field is used to  identify the number of object
  1328.          verify  entries  that   follow  for  the  referenced
  1329.          module.
  1330.  
  1331.      OBJECT # = DW  Object # in Module.
  1332.          This  field  specifies  the  object  number  in  the
  1333.          referenced module that is being verified.
  1334.  
  1335.      BASE ADDR = DW  Object load base address.
  1336.          This is  the  address that the object was  loaded at
  1337.          when the fixups were performed.
  1338.  
  1339.      VIRTUAL = DW  Object virtual address size.
  1340.          This field specifies the  total  amount  of  virtual
  1341.          memory required for this object.
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.      Per-Page Checksum
  1348.  
  1349.  
  1350.  The  Per-Page   Checksum   table   provides   space   for  a
  1351.  cryptographic  checksum for each  physical  page  in the EXE
  1352.  file.
  1353.  
  1354.  The checksum table is arranged such that the first entry  in
  1355.  the table corresponds to the first logical page of code/data
  1356.  in the EXE file (usually a preload page) and the  last entry
  1357.  corresponds to  the  last  logical  page  in  the  EXE  file
  1358.  (usually a iterated data page).
  1359.  
  1360.                      +-----+-----+-----+-----+
  1361.     Logical Page #1  |        CHECKSUM       |
  1362.                      +-----+-----+-----+-----+
  1363.     Logical Page #2  |        CHECKSUM       |
  1364.                      +-----+-----+-----+-----+
  1365.                                . . .
  1366.  
  1367.                      +-----+-----+-----+-----+
  1368.     Logical Page #n  |        CHECKSUM       |
  1369.                      +-----+-----+-----+-----+
  1370.  
  1371.  
  1372.      CHECKSUM = DD  Cryptographic checksum.
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.      Fixup Page Table
  1379.  
  1380.  
  1381.  The Fixup Page Table provides a simple  mapping of a logical
  1382.  page number to an  offset  into  the Fixup Record  Table for
  1383.  that page.
  1384.  
  1385.  This table is parallel to the Object Page Table, except that
  1386.  there is one  additional entry in this table to indicate the
  1387.  end of the Fixup Record Table.
  1388.  
  1389.  The format of each entry is:
  1390.  
  1391.                    +-----+-----+-----+-----+
  1392.   Logical Page #1  |  OFFSET FOR PAGE #1   |
  1393.                    +-----+-----+-----+-----+
  1394.   Logical Page #2  |  OFFSET FOR PAGE #2   |
  1395.                    +-----+-----+-----+-----+
  1396.                              . . .
  1397.                    +-----+-----+-----+-----+
  1398.   Logical Page #n  |  OFFSET FOR PAGE #n   |
  1399.                    +-----+-----+-----+-----+
  1400.                    |OFF TO END OF FIXUP REC|   This is equal to:
  1401.                    +-----+-----+-----+-----+   Offset for page #n + Size
  1402.                                                of fixups for page #n
  1403.  
  1404.  
  1405.      OFFSET FOR PAGE # = DD  Offset for fixup record for this
  1406.      page.
  1407.          This  field specifies the offset, from the beginning
  1408.          of the fixup record table, to the first fixup record
  1409.          for this page.
  1410.  
  1411.      OFF TO  END  OF FIXUP REC = DD  Offset to the end of the
  1412.      fixup records.
  1413.          This field specifies  the offset  following the last
  1414.          fixup record in the fixup record table.  This is the
  1415.          last entry in the fixup page table.
  1416.  
  1417.          The fixup records are kept in order by logical  page
  1418.          in the fixup record table.  This  allows the end  of
  1419.          each page's fixup records  is defined by  the offset
  1420.          for  the  next logical  page's fixup  records.  This
  1421.          last  entry provides  support of this mechanism  for
  1422.          the last page in the fixup page table.
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.      Fixup Record Table
  1429.  
  1430.  
  1431.  The  Fixup  Record Table contains entries  for all fixups in
  1432.  the linear EXE module.  The fixup records for a logical page
  1433.  are  grouped together and kept  in  sorted order by  logical
  1434.  page number.  The  fixups for  each page are  further sorted
  1435.  such that all external fixups  and internal selector/pointer
  1436.  fixups come before internal non-selector/non-pointer fixups.
  1437.  This allows  the  loader  to  ignore internal fixups  if the
  1438.  loader  is  able  to  load  all  objects  at  the  addresses
  1439.  specified in the object table.
  1440.  
  1441.  Each relocation record has the following format:
  1442.  
  1443.            +-----+-----+-----+-----+
  1444.        00h | SRC |FLAGS|SRCOFF/CNT*|
  1445.            +-----+-----+-----+-----+-----+-----+
  1446.    03h/04h |           TARGET DATA *           |
  1447.            +-----+-----+-----+-----+-----+-----+
  1448.            | SRCOFF1 @ |   . . .   | SRCOFFn @ |
  1449.            +-----+-----+----   ----+-----+-----+
  1450.  
  1451.          * These fields are variable size.
  1452.          @ These fields are optional.
  1453.  
  1454.  
  1455.      SRC = DB  Source type.
  1456.          The source type specifies the  size  and type of the
  1457.          fixup to  be  performed  on  the  fixup source.  The
  1458.          source type is defined as follows:
  1459.  
  1460.              0Fh = Source mask.
  1461.              00h = Byte fixup (8-bits).
  1462.              01h = (undefined).
  1463.              02h = 16-bit Selector fixup (16-bits).
  1464.              03h = 16:16 Pointer fixup (32-bits).
  1465.              04h = (undefined).
  1466.              05h = 16-bit Offset fixup (16-bits).
  1467.              06h = 16:32 Pointer fixup (48-bits).
  1468.              07h = 32-bit Offset fixup (32-bits).
  1469.              08h   =   32-bit  Self-relative   offset   fixup
  1470.              (32-bits).
  1471.              10h = Fixup to Alias Flag.
  1472.                  When the 'Fixup to Alias' Flag is  set,  the
  1473.                  source fixup refers to  the 16:16  alias for
  1474.                  the  object.  This is only  valid for source
  1475.                  types  of 2, 3, and 6.  For  fixups such  as
  1476.                  this, the linker and loader will be required
  1477.                  to   perform   additional   checks  such  as
  1478.                  ensuring that the  target  offset  for  this
  1479.                  fixup is less than 64K.
  1480.  
  1481.              20h = Source List Flag.
  1482.  
  1483.                  When  the  'Source  List'  Flag is set,  the
  1484.                  SRCOFF field  is compressed  to  a byte  and
  1485.                  contains the number of source offsets, and a
  1486.                  list  of source  offsets  follows the end of
  1487.                  fixup  record (after  the  optional additive
  1488.                  value).
  1489.  
  1490.      FLAGS = DB  Target Flags.
  1491.          The target flags specify how the target  information
  1492.          is interpreted.  The  target flags  are  defined  as
  1493.          follows:
  1494.  
  1495.              03h = Fixup target type mask.
  1496.              00h = Internal reference.
  1497.              01h = Imported reference by ordinal.
  1498.              02h = Imported reference by name.
  1499.              03h = Internal reference via entry table.
  1500.              04h = Additive Fixup Flag.
  1501.                  When set, an additive value trails the fixup
  1502.                  record (before the  optional  source  offset
  1503.                  list).
  1504.  
  1505.              08h = Reserved.  Must be zero.
  1506.              10h = 32-bit Target Offset Flag.
  1507.                  When  set, the  target  offset  is  32-bits,
  1508.                  otherwise it is 16-bits.
  1509.  
  1510.              20h = 32-bit Additive Fixup Flag.
  1511.                  When set,  the  additive value  is  32-bits,
  1512.                  otherwise it is 16-bits.
  1513.  
  1514.              40h = 16-bit Object Number/Module Ordinal Flag.
  1515.                  When  set,  the   object  number  or  module
  1516.                  ordinal number  is 16-bits, otherwise  it is
  1517.                  8-bits.
  1518.  
  1519.              80h = 8-bit Ordinal Flag.
  1520.                  When  set,  the  ordinal number  is  8-bits,
  1521.                  otherwise it is 16-bits.
  1522.  
  1523.      SRCOFF =  DW/CNT  = DB  Source  offset  or source offset
  1524.      list count.
  1525.          This field contains  either  an  offset  or  a count
  1526.          depending on the  Source  List Flag.  If the  Source
  1527.          List Flag is  set,  a list of source offsets follows
  1528.          the additive field and this field contains the count
  1529.          of  the  entries   in   the   source   offset  list.
  1530.          Otherwise, this is the single source offset for  the
  1531.          fixup.  Source offsets are relative to the beginning
  1532.          of the page where the fixup is to be made.
  1533.  
  1534.          Note that for fixups that  cross page  boundaries, a
  1535.          separate  fixup  record is  specified for each page.
  1536.          An offset is still used for the 2nd  page but it now
  1537.          becomes a negative offset since the fixup originated
  1538.          on  the  preceding page.  (For  example, if only the
  1539.          last one byte of a 32-bit address is on the page  to
  1540.          be fixed up, then the offset would  have  a value of
  1541.          -3.)
  1542.  
  1543.      TARGET DATA = Target data for fixup.
  1544.          The  format of the  TARGET  DATA  is  dependent upon
  1545.          target flags.
  1546.  
  1547.      SRCOFF1 - SRCOFFn = DW[]  Source offset list.
  1548.          This list is present if the  Source List Flag is set
  1549.          in the Target Flags field.  The number of entries in
  1550.          the  source offset list is defined in the SRCOFF/CNT
  1551.          field.  The  source  offsets  are  relative  to  the
  1552.          beginning of the  page where  the fixups are  to  be
  1553.          made.
  1554.  
  1555.                +-----+-----+-----+-----+
  1556.            00h | SRC |FLAGS|SRCOFF/CNT*|
  1557.                +-----+-----+-----+-----+-----+-----+
  1558.        03h/04h |  OBJECT * |        TRGOFF * @     |
  1559.                +-----+-----+-----+-----+-----+-----+
  1560.                | SRCOFF1 @ |   . . .   | SRCOFFn @ |
  1561.                +-----+-----+----   ----+-----+-----+
  1562.  
  1563.              * These fields are variable size.
  1564.              @ These fields are optional.
  1565.  
  1566.  
  1567.          OBJECT = D[B|W]  Target object number.
  1568.              This field is an index into the current module's
  1569.              Object Table to  specify  the target Object.  It
  1570.              is  a  Byte  value  when   the   '16-bit  Object
  1571.              Number/Module Ordinal  Flag' bit  in  the target
  1572.              flags field is clear and  a Word  value when the
  1573.              bit is set.
  1574.  
  1575.  
  1576.          TRGOFF = D[W|D]  Target offset.
  1577.              This  field  is  an  offset  into  the specified
  1578.              target  Object.  It  is  not  present  when  the
  1579.              Source Type  specifies a  16-bit Selector fixup.
  1580.              It  is  a  Word value when  the  '32-bit  Target
  1581.              Offset Flag'  bit  in the target flags field  is
  1582.              clear and a Dword value when the bit is set.
  1583.  
  1584.                +-----+-----+-----+-----+
  1585.            00h | SRC |FLAGS|SRCOFF/CNT*|
  1586.                +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
  1587.        03h/04h | MOD ORD# *| PROCEDURE NAME OFFSET*|     ADDITIVE * @      |
  1588.                +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
  1589.                | SRCOFF1 @ |   . . .   | SRCOFFn @ |
  1590.                +-----+-----+----   ----+-----+-----+
  1591.  
  1592.              * These fields are variable size.
  1593.              @ These fields are optional.
  1594.  
  1595.  
  1596.          MOD ORD # =  D[B|W]  Ordinal  index into the  Import
  1597.          Module Name Table.
  1598.              This value  is an ordered index in to the Import
  1599.              Module Name Table  for the module containing the
  1600.              procedure entry point.  It is a Byte value  when
  1601.              the '16-bit  Object Number/Module  Ordinal' Flag
  1602.              bit  in the target flags  field is  clear  and a
  1603.              Word  value  when  the  bit  is set.  The loader
  1604.              creates a table of pointers with each pointer in
  1605.              the  table  corresponds to the  modules named in
  1606.              the  Import  Module Name Table.  This  value  is
  1607.              used  by  the loader  to  index into  this table
  1608.              created by the  loader  to locate the referenced
  1609.              module.
  1610.  
  1611.          PROCEDURE NAME  OFFSET  =  D[W|D]  Offset  into  the
  1612.          Import Procedure Name Table.
  1613.              This   field   is  an  offset  into  the  Import
  1614.              Procedure Name Table.  It  is a Word  value when
  1615.              the  '32-bit  Target Offset  Flag'  bit  in  the
  1616.              target flags field  is clear and  a Dword  value
  1617.              when the bit is set.
  1618.  
  1619.          ADDITIVE = D[W|D]  Additive fixup value.
  1620.              This field exists in the fixup  record only when
  1621.              the 'Additive  Fixup  Flag'  bit  in  the target
  1622.              flags field is set.  When  the  'Additive  Fixup
  1623.              Flag' is clear the fixup record does not contain
  1624.              this  field  and is immediately followed by  the
  1625.              next fixup record (or  by the source offset list
  1626.              for this fixup record).
  1627.  
  1628.              This value is added to the address  derived from
  1629.              the  target entry point.  This field  is  a Word
  1630.              value when the '32-bit Additive Flag' bit in the
  1631.              target flags field is  clear  and a  Dword value
  1632.              when the bit is set.
  1633.  
  1634.                +-----+-----+-----+-----+
  1635.            00h | SRC |FLAGS|SRCOFF/CNT*|
  1636.                +-----+-----+-----+-----+-----+-----+-----+-----+
  1637.        03h/04h | MOD ORD# *|IMPORT ORD*|     ADDITIVE * @      |
  1638.                +-----+-----+-----+-----+-----+-----+-----+-----+
  1639.                | SRCOFF1 @ |   . . .   | SRCOFFn @ |
  1640.                +-----+-----+----   ----+-----+-----+
  1641.  
  1642.              * These fields are variable size.
  1643.              @ These fields are optional.
  1644.  
  1645.  
  1646.          MOD ORD  # = D[B|W]  Ordinal index  into  the Import
  1647.          Module Name Table.
  1648.              This value is an ordered index  in to the Import
  1649.              Module  Name Table for the module containing the
  1650.              procedure  entry point.  It is a Byte value when
  1651.              the '16-bit Object Number/Module  Ordinal'  Flag
  1652.              bit in the target flags  field is  clear  and  a
  1653.              Word  value  when  the  bit  is set.  The loader
  1654.              creates a table of pointers with each pointer in
  1655.              the table  corresponds  to the  modules named in
  1656.              the  Import Module  Name Table.  This  value  is
  1657.              used by the loader  to  index  into  this  table
  1658.              created  by the loader to locate the  referenced
  1659.              module.
  1660.  
  1661.          IMPORT ORD = D[B|W|D]  Imported ordinal number.
  1662.              This is the imported procedure's ordinal number.
  1663.              It is a Byte value when  the '8-bit Ordinal' bit
  1664.              in the target flags  field is set.  Otherwise it
  1665.              is  a Word value when the '32-bit Target  Offset
  1666.              Flag' bit in the target flags field is clear and
  1667.              a Dword value when the bit is set.
  1668.  
  1669.          ADDITIVE = D[W|D]  Additive fixup value.
  1670.              This field exists in the fixup  record only when
  1671.              the  'Additive Fixup Flag'  bit  in  the  target
  1672.              flags field is set.  When  the  'Additive  Fixup
  1673.              Flag' is clear the fixup record does not contain
  1674.              this field  and  is  immediately followed by the
  1675.              next fixup record (or  by the source offset list
  1676.              for this fixup record).
  1677.  
  1678.              This value is  added to the address derived from
  1679.              the  target entry point.  This field is  a  Word
  1680.              value when the '32-bit Additive Flag' bit in the
  1681.              target flags field  is  clear and a Dword  value
  1682.              when the bit is set.
  1683.  
  1684.                +-----+-----+-----+-----+
  1685.            00h | SRC |FLAGS|SRCOFF/CNT*|
  1686.                +-----+-----+-----+-----+-----+-----+
  1687.        03h/04h |  ORD # *  |     ADDITIVE * @      |
  1688.                +-----+-----+-----+-----+-----+-----+
  1689.                | SRCOFF1 @ |   . . .   | SRCOFFn @ |
  1690.                +-----+-----+----   ----+-----+-----+
  1691.  
  1692.              * These fields are variable size.
  1693.              @ These fields are optional.
  1694.  
  1695.          ENTRY #  =  D[B|W]  Ordinal  index  into  the  Entry
  1696.          Table.
  1697.              This field is an index into the current module's
  1698.              Entry  Table  to  specify the target Object  and
  1699.              offset.  It  is a Byte  value when  the  '16-bit
  1700.              Object Number/Module  Ordinal' Flag bit  in  the
  1701.              target flags field is  clear  and  a  Word value
  1702.              when the bit is set.
  1703.  
  1704.          ADDITIVE = D[W|D]  Additive fixup value.
  1705.              This field exists in the  fixup record only when
  1706.              the  'Additive Fixup  Flag'  bit  in the  target
  1707.              flags  field is set.  When the  'Additive  Fixup
  1708.              Flag' is clear the fixup record does not contain
  1709.              this  field and is  immediately followed  by the
  1710.              next fixup record (or by the source  offset list
  1711.              for this fixup record).
  1712.  
  1713.              This value  is added to the address derived from
  1714.              the  target  entry point.  This field is a  Word
  1715.              value when the '32-bit Additive Flag' bit in the
  1716.              target  flags  field  is clear and a Dword value
  1717.              when the bit is set.
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.   Import Module Name Table
  1724.  
  1725.  
  1726.  The import module name table defines the module name strings
  1727.  imported through dynamic link references.  These strings are
  1728.  referenced through the imported relocation fixups.
  1729.  
  1730.  To determine the  length  of the  import  module  name table
  1731.  subtract the import module name table offset from the import
  1732.  procedure  name  table offset.  These values are located  in
  1733.  the  linear EXE header.  The end  of the import module  name
  1734.  table  is  not  terminated by  a special  character,  it  is
  1735.  followed directly by the import procedure name table.
  1736.  
  1737.  The strings are CASE SENSITIVE and NOT NULL TERMINATED.
  1738.  
  1739.  Each name table entry has the following format:
  1740.  
  1741.            +-----+-----+-----+-----+     +-----+
  1742.        00h | LEN |    ASCII STRING  . . .      |
  1743.            +-----+-----+-----+-----+     +-----+
  1744.  
  1745.      LEN = DB  String Length.
  1746.          This defines the length of the string in bytes.  The
  1747.          length of each ascii name string is  limited  to 127
  1748.          characters.
  1749.  
  1750.      ASCII STRING = DB  ASCII String.
  1751.          This is a  variable  length string with it's  length
  1752.          defined in bytes by the  LEN  field.  The  string is
  1753.          case sensitive and is not null terminated.
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.      Import Procedure Name Table
  1760.  
  1761.  
  1762.  The import procedure name table defines  the  procedure name
  1763.  strings  imported  by  this  module   through  dynamic  link
  1764.  references.   These   strings  are  referenced  through  the
  1765.  imported relocation fixups.
  1766.  
  1767.  To determine the length  of the import procedure  name table
  1768.  add the fixup section size  to the  fixup page table offset,
  1769.  this computes the  offset to  the end of the  fixup section,
  1770.  then subtract the import procedure name table offset.  These
  1771.  values are located  in  the linear  EXE header.  The  import
  1772.  procedure name table is followed by the data pages  section.
  1773.  Since the  data pages  section is aligned  on a 'page  size'
  1774.  boundary, padded space  may  exist  between the  last import
  1775.  name  string  and the first page in  the data pages section.
  1776.  If this padded space exists it will be zero filled.
  1777.  
  1778.  The strings are CASE SENSITIVE and NOT NULL TERMINATED.
  1779.  
  1780.  Each name table entry has the following format:
  1781.  
  1782.            +-----+-----+-----+-----+     +-----+
  1783.        00h | LEN |    ASCII STRING  . . .      |
  1784.            +-----+-----+-----+-----+     +-----+
  1785.  
  1786.      LEN = DB  String Length.
  1787.          This defines the length of the string in bytes.  The
  1788.          length of each ascii  name  string is limited to 127
  1789.          characters.
  1790.  
  1791.          The high bit  in the LEN field (bit 7) is defined as
  1792.          an Overload bit.  This bit signifies that additional
  1793.          information  is  contained in the  linear EXE module
  1794.          and will  be  used in the future for  parameter type
  1795.          checking.
  1796.  
  1797.      ASCII STRING = DB  ASCII String.
  1798.          This is  a variable  length string  with it's length
  1799.          defined in bytes by the LEN  field.  The  string  is
  1800.          case sensitive and is not null terminated.
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806.      Preload Pages
  1807.  
  1808.  
  1809.  The  Preload Pages section  is an  optional section  in  the
  1810.  linear EXE module that coalesces a 'preload page set' into a
  1811.  contiguous section.  The  preload page set can be defined as
  1812.  the set of first used pages in the module.  The preload page
  1813.  set can be specified by the application developer or can  be
  1814.  derived by a  tool that  analyzes the programs memory  usage
  1815.  while  it  is  running.  By grouping the  preload  page  set
  1816.  together, the preload pages can be read  from the linear EXE
  1817.  module with one disk read.
  1818.  
  1819.  The structure of  the preload pages is no different than  if
  1820.  they  were  demand  loaded.  They  are  non-iterated  pages.
  1821.  Their sizes are determined  by the Object Page Table entries
  1822.  that  correspond.  If  the  specified size is less than  the
  1823.  PAGE SIZE field given in the linear  EXE  module  header the
  1824.  remainder of the page is filled with zeros when loaded.
  1825.  
  1826.  All pages  begin on a  PAGE  OFFSET  SHIFT boundary from the
  1827.  base of the preload page section, as specified in the linear
  1828.  EXE  header.  The  pages are ordered by logical  page number
  1829.  within this section.
  1830.  
  1831. Note: OS/2 2.0 does not respect preload pages. Performance tests
  1832. showed that better system performance was obtained by not
  1833. respecting the preload request in the executable file.
  1834.  
  1835.  
  1836.  
  1837.  
  1838.      Demand Load Pages
  1839.  
  1840.  
  1841.  The   Demand   Loaded   Pages  section   contains   all  the
  1842.  non-iterated  pages  for a linear  EXE  module that are  not
  1843.  preloaded.  When  required,  the whole  page is loaded  into
  1844.  memory  from  the module.  The characteristics  of  each  of
  1845.  these pages is specified  in the  Object Page  Table.  Every
  1846.  page begins on a PAGE OFFSET SHIFT  boundary  aligned offset
  1847.  from the demand  loaded pages base specified  in the  linear
  1848.  EXE header.  Their  sizes are determined by the  Object Page
  1849.  Table  entries that correspond.  If  the  specified size  is
  1850.  less than the PAGE SIZE field given in the linear EXE module
  1851.  header the  remainder  of the page is filled with zeros when
  1852.  loaded.  The pages are ordered by logical page number within
  1853.  this section.
  1854.  
  1855.  
  1856.  
  1857.  
  1858.      Iterated Data Pages
  1859.  
  1860.  
  1861.  The Iterated Data Pages section contains all the pages for a
  1862.  linear EXE module that are iterated.  When required, the set
  1863.  of iteration records are loaded into  memory from the module
  1864.  and  expanded  to  reconstitute  the  page.  Every   set  of
  1865.  iteration records begins on  a PAGE OFFSET SHIFT offset from
  1866.  the  OBJECT ITER  PAGES  OFF  specified  in  the linear  EXE
  1867.  header.  Their sizes are determined by the Object Page Table
  1868.  entries  that correspond.  The  pages are ordered by logical
  1869.  page number within this section.
  1870.  
  1871.  This  record structure is used to describe the iterated data
  1872.  for an object on a per-page basis.
  1873.  
  1874.            +-----+-----+-----+-----+
  1875.        00h |#ITERATIONS|DATA LENGTH|
  1876.            +-----+-----+-----+-----+-----+
  1877.        04h |DATA BYTES |   . . .   | ... |
  1878.            +-----+-----+-----+-----+-----+
  1879.  
  1880.  Figure 19. Object Iterated Data Record (Iteration Record)
  1881.  
  1882.      #ITERATIONS = DW  Number of iterations.
  1883.          This specifies the number of  times that the data is
  1884.          replicated.
  1885.  
  1886.      DATA LENGTH = DW  The size of the data pattern in bytes.
  1887.          This specifies the number of bytes of  data of which
  1888.          the pattern consists.  The maximum size is  one half
  1889.          of the PAGE SIZE (given in the module header).  If a
  1890.          pattern exceeds  this value then the data page  will
  1891.          not be condensed into iterated data.
  1892.  
  1893.      DATA  =  DB  *  DATA  LENGTH  The  Data  pattern  to  be
  1894.      replicated.
  1895.          The next iteration record  will  immediately  follow
  1896.          the  last  byte of the  pattern.  The  offset of the
  1897.          next iteration record is easily calculated from  the
  1898.          offset  of  this record  by adding  the  DATA LENGTH
  1899.          field  and  the sizes  of the  #ITERATIONS  and DATA
  1900.          LENGTH fields.
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.      Debug Information
  1907.  
  1908.  
  1909.  The debug information  is  defined by  the debugger  and  is
  1910.  not controlled by the linear EXE format or linker.  The only
  1911.  data defined by the linear EXE format relative  to the debug
  1912.  information is  it's offset  in  the  EXE file and length in
  1913.  bytes as defined in the linear EXE header.
  1914.  
  1915.  To  support multiple debuggers the first word of  the  debug
  1916.  information is  a type  field which determines the format of
  1917.  the debug information.
  1918.  
  1919.            00h   01h   02h   03h   04h
  1920.            +-----+-----+-----+-----+-----+-----+-----+-----+
  1921.            | 'N' | 'B' | '0' |  n  |   DEBUGGER DATA  . . . .
  1922.            +-----+-----+-----+-----+-----+-----+-----+-----+
  1923.  
  1924.  
  1925.      TYPE = DB DUP 4 Format type.
  1926.          This defines  the type of debugger data  that exists
  1927.          in  the  remainder of  the  debug  information.  The
  1928.          signature consists  of  a  string  of four (4) ASCII
  1929.          characters:   "NB0"    followed    by   the    ASCII
  1930.          representation  for 'n'.  The  values  for  'n'  are
  1931.          defined as follows.
  1932.  
  1933.          These format types are defined.
  1934.  
  1935.              00h = 32-bit CodeView debugger format.
  1936.              01h = AIX debugger format.
  1937.              02h = 16-bit CodeView debugger format.
  1938.              04h = 32-bit OS/2 PM debugger (IBM) format.
  1939.  
  1940.      DEBUGGER DATA = Debugger specific data.
  1941.          The  format  of the debugger data  is defined by the
  1942.          debugger that is being used.
  1943.  
  1944.          The  values  defined  for  the  type  field are  not
  1945.          enforced by the  system.  It is  the  responsibility
  1946.          of  the  linker  or  debugging tools to  follow  the
  1947.          convention for the type field that is defined here.
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953. ------- End of Forwarded Message
  1954.  
  1955.