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