1*3d8817e4Smiod /* i386 NLM (NetWare Loadable Module) support for BFD.
2*3d8817e4Smiod    Copyright 1993 Free Software Foundation, Inc.
3*3d8817e4Smiod 
4*3d8817e4Smiod This file is part of BFD, the Binary File Descriptor library.
5*3d8817e4Smiod 
6*3d8817e4Smiod This program is free software; you can redistribute it and/or modify
7*3d8817e4Smiod it under the terms of the GNU General Public License as published by
8*3d8817e4Smiod the Free Software Foundation; either version 2 of the License, or
9*3d8817e4Smiod (at your option) any later version.
10*3d8817e4Smiod 
11*3d8817e4Smiod This program is distributed in the hope that it will be useful,
12*3d8817e4Smiod but WITHOUT ANY WARRANTY; without even the implied warranty of
13*3d8817e4Smiod MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*3d8817e4Smiod GNU General Public License for more details.
15*3d8817e4Smiod 
16*3d8817e4Smiod You should have received a copy of the GNU General Public License
17*3d8817e4Smiod along with this program; if not, write to the Free Software
18*3d8817e4Smiod Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
19*3d8817e4Smiod 
20*3d8817e4Smiod /* The external format of the fixed header.  */
21*3d8817e4Smiod 
22*3d8817e4Smiod typedef struct nlm32_i386_external_fixed_header
23*3d8817e4Smiod {
24*3d8817e4Smiod 
25*3d8817e4Smiod   /* The signature field identifies the file as an NLM.  It must contain
26*3d8817e4Smiod      the signature string, which depends upon the NLM target. */
27*3d8817e4Smiod 
28*3d8817e4Smiod   unsigned char signature[24];
29*3d8817e4Smiod 
30*3d8817e4Smiod   /* The version of the header.  At this time, the highest version number
31*3d8817e4Smiod      is 4. */
32*3d8817e4Smiod 
33*3d8817e4Smiod   unsigned char version[4];
34*3d8817e4Smiod 
35*3d8817e4Smiod   /* The name of the module, which must be a DOS name (1-8 characters followed
36*3d8817e4Smiod      by a period and a 1-3 character extension).  The first byte is the byte
37*3d8817e4Smiod      length of the name and the last byte is a null terminator byte.  This
38*3d8817e4Smiod      field is fixed length, and any unused bytes should be null bytes.  The
39*3d8817e4Smiod      value is set by the OUTPUT keyword to NLMLINK. */
40*3d8817e4Smiod 
41*3d8817e4Smiod   unsigned char moduleName[14];
42*3d8817e4Smiod 
43*3d8817e4Smiod   /* The byte offset of the code image from the start of the file. */
44*3d8817e4Smiod 
45*3d8817e4Smiod   unsigned char codeImageOffset[4];
46*3d8817e4Smiod 
47*3d8817e4Smiod   /* The size of the code image, in bytes. */
48*3d8817e4Smiod 
49*3d8817e4Smiod   unsigned char codeImageSize[4];
50*3d8817e4Smiod 
51*3d8817e4Smiod   /* The byte offset of the data image from the start of the file. */
52*3d8817e4Smiod 
53*3d8817e4Smiod   unsigned char dataImageOffset[4];
54*3d8817e4Smiod 
55*3d8817e4Smiod   /* The size of the data image, in bytes. */
56*3d8817e4Smiod 
57*3d8817e4Smiod   unsigned char dataImageSize[4];
58*3d8817e4Smiod 
59*3d8817e4Smiod   /* The size of the uninitialized data region that the loader is to be
60*3d8817e4Smiod      allocated at load time.  Uninitialized data follows the initialized
61*3d8817e4Smiod      data in the NLM address space. */
62*3d8817e4Smiod 
63*3d8817e4Smiod   unsigned char uninitializedDataSize[4];
64*3d8817e4Smiod 
65*3d8817e4Smiod   /* The byte offset of the custom data from the start of the file.  The
66*3d8817e4Smiod      custom data is set by the CUSTOM keyword to NLMLINK.  It is possible
67*3d8817e4Smiod      for this to be EOF if there is no custom data. */
68*3d8817e4Smiod 
69*3d8817e4Smiod   unsigned char customDataOffset[4];
70*3d8817e4Smiod 
71*3d8817e4Smiod   /* The size of the custom data, in bytes. */
72*3d8817e4Smiod 
73*3d8817e4Smiod   unsigned char customDataSize[4];
74*3d8817e4Smiod 
75*3d8817e4Smiod   /* The byte offset of the module dependencies from the start of the file.
76*3d8817e4Smiod      The module dependencies are determined by the MODULE keyword in
77*3d8817e4Smiod      NLMLINK. */
78*3d8817e4Smiod 
79*3d8817e4Smiod   unsigned char moduleDependencyOffset[4];
80*3d8817e4Smiod 
81*3d8817e4Smiod   /* The number of module dependencies at the moduleDependencyOffset. */
82*3d8817e4Smiod 
83*3d8817e4Smiod   unsigned char numberOfModuleDependencies[4];
84*3d8817e4Smiod 
85*3d8817e4Smiod   /* The byte offset of the relocation fixup data from the start of the file */
86*3d8817e4Smiod 
87*3d8817e4Smiod   unsigned char relocationFixupOffset[4];
88*3d8817e4Smiod 
89*3d8817e4Smiod   unsigned char numberOfRelocationFixups[4];
90*3d8817e4Smiod 
91*3d8817e4Smiod   unsigned char externalReferencesOffset[4];
92*3d8817e4Smiod 
93*3d8817e4Smiod   unsigned char numberOfExternalReferences[4];
94*3d8817e4Smiod 
95*3d8817e4Smiod   unsigned char publicsOffset[4];
96*3d8817e4Smiod 
97*3d8817e4Smiod   unsigned char numberOfPublics[4];
98*3d8817e4Smiod 
99*3d8817e4Smiod   /* The byte offset of the internal debug info from the start of the file.
100*3d8817e4Smiod      It is possible for this to be EOF if there is no debug info. */
101*3d8817e4Smiod 
102*3d8817e4Smiod   unsigned char debugInfoOffset[4];
103*3d8817e4Smiod 
104*3d8817e4Smiod   unsigned char numberOfDebugRecords[4];
105*3d8817e4Smiod 
106*3d8817e4Smiod   unsigned char codeStartOffset[4];
107*3d8817e4Smiod 
108*3d8817e4Smiod   unsigned char exitProcedureOffset[4];
109*3d8817e4Smiod 
110*3d8817e4Smiod   unsigned char checkUnloadProcedureOffset[4];
111*3d8817e4Smiod 
112*3d8817e4Smiod   unsigned char moduleType[4];
113*3d8817e4Smiod 
114*3d8817e4Smiod   unsigned char flags[4];
115*3d8817e4Smiod 
116*3d8817e4Smiod } Nlm32_i386_External_Fixed_Header;
117