00001 /* NLM (NetWare Loadable Module) support for BFD. 00002 Copyright 1993, 1994 Free Software Foundation, Inc. 00003 00004 Written by Fred Fish @ Cygnus Support 00005 00006 This file is part of BFD, the Binary File Descriptor library. 00007 00008 This program is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 00021 00022 00023 /* This file is part of NLM support for BFD, and contains the portions 00024 that describe how NLM is represented externally by the BFD library. 00025 I.E. it describes the in-file representation of NLM. It requires 00026 the nlm/common.h file which contains the portions that are common to 00027 both the internal and external representations. 00028 00029 Note that an NLM header consists of three parts: 00030 00031 (1) A fixed length header that has specific fields of known length, 00032 at specific offsets in the file. 00033 00034 (2) A variable length header that has specific fields in a specific 00035 order, but some fields may be variable length. 00036 00037 (3) A auxiliary header that has various optional fields in no specific 00038 order. There is no way to identify the end of the auxiliary headers 00039 except by finding a header without a recognized 'stamp'. 00040 00041 The exact format of the fixed length header unfortunately varies 00042 from one NLM target to another, due to padding. Each target 00043 defines the correct external format in a separate header file. 00044 00045 */ 00046 00047 /* NLM Header */ 00048 00049 /* The version header is one of the optional auxiliary headers and 00050 follows the fixed length and variable length NLM headers. */ 00051 00052 typedef struct nlmNAME(external_version_header) 00053 { 00054 00055 /* The header is recognized by "VeRsIoN#" in the stamp field. */ 00056 char stamp[8]; 00057 00058 unsigned char majorVersion[NLM_TARGET_LONG_SIZE]; 00059 00060 unsigned char minorVersion[NLM_TARGET_LONG_SIZE]; 00061 00062 unsigned char revision[NLM_TARGET_LONG_SIZE]; 00063 00064 unsigned char year[NLM_TARGET_LONG_SIZE]; 00065 00066 unsigned char month[NLM_TARGET_LONG_SIZE]; 00067 00068 unsigned char day[NLM_TARGET_LONG_SIZE]; 00069 00070 } NlmNAME(External_Version_Header); 00071 00072 00073 typedef struct nlmNAME(external_copyright_header) 00074 { 00075 00076 /* The header is recognized by "CoPyRiGhT=" in the stamp field. */ 00077 00078 char stamp[10]; 00079 00080 unsigned char copyrightMessageLength[1]; 00081 00082 /* There is a variable length field here called 'copyrightMessage' 00083 that is the length specified by copyrightMessageLength. */ 00084 00085 } NlmNAME(External_Copyright_Header); 00086 00087 00088 typedef struct nlmNAME(external_extended_header) 00089 { 00090 00091 /* The header is recognized by "MeSsAgEs" in the stamp field. */ 00092 00093 char stamp[8]; 00094 00095 unsigned char languageID[NLM_TARGET_LONG_SIZE]; 00096 00097 unsigned char messageFileOffset[NLM_TARGET_LONG_SIZE]; 00098 00099 unsigned char messageFileLength[NLM_TARGET_LONG_SIZE]; 00100 00101 unsigned char messageCount[NLM_TARGET_LONG_SIZE]; 00102 00103 unsigned char helpFileOffset[NLM_TARGET_LONG_SIZE]; 00104 00105 unsigned char helpFileLength[NLM_TARGET_LONG_SIZE]; 00106 00107 unsigned char RPCDataOffset[NLM_TARGET_LONG_SIZE]; 00108 00109 unsigned char RPCDataLength[NLM_TARGET_LONG_SIZE]; 00110 00111 unsigned char sharedCodeOffset[NLM_TARGET_LONG_SIZE]; 00112 00113 unsigned char sharedCodeLength[NLM_TARGET_LONG_SIZE]; 00114 00115 unsigned char sharedDataOffset[NLM_TARGET_LONG_SIZE]; 00116 00117 unsigned char sharedDataLength[NLM_TARGET_LONG_SIZE]; 00118 00119 unsigned char sharedRelocationFixupOffset[NLM_TARGET_LONG_SIZE]; 00120 00121 unsigned char sharedRelocationFixupCount[NLM_TARGET_LONG_SIZE]; 00122 00123 unsigned char sharedExternalReferenceOffset[NLM_TARGET_LONG_SIZE]; 00124 00125 unsigned char sharedExternalReferenceCount[NLM_TARGET_LONG_SIZE]; 00126 00127 unsigned char sharedPublicsOffset[NLM_TARGET_LONG_SIZE]; 00128 00129 unsigned char sharedPublicsCount[NLM_TARGET_LONG_SIZE]; 00130 00131 unsigned char sharedDebugRecordOffset[NLM_TARGET_LONG_SIZE]; 00132 00133 unsigned char sharedDebugRecordCount[NLM_TARGET_LONG_SIZE]; 00134 00135 unsigned char sharedInitializationOffset[NLM_TARGET_ADDRESS_SIZE]; 00136 00137 unsigned char SharedExitProcedureOffset[NLM_TARGET_ADDRESS_SIZE]; 00138 00139 unsigned char productID[NLM_TARGET_LONG_SIZE]; 00140 00141 unsigned char reserved0[NLM_TARGET_LONG_SIZE]; 00142 00143 unsigned char reserved1[NLM_TARGET_LONG_SIZE]; 00144 00145 unsigned char reserved2[NLM_TARGET_LONG_SIZE]; 00146 00147 unsigned char reserved3[NLM_TARGET_LONG_SIZE]; 00148 00149 unsigned char reserved4[NLM_TARGET_LONG_SIZE]; 00150 00151 unsigned char reserved5[NLM_TARGET_LONG_SIZE]; 00152 00153 } NlmNAME(External_Extended_Header); 00154 00155 00156 typedef struct nlmNAME(external_custom_header) 00157 { 00158 00159 /* The header is recognized by "CuStHeAd" in the stamp field. */ 00160 char stamp[8]; 00161 00162 /* Length of this header. */ 00163 unsigned char length[NLM_TARGET_LONG_SIZE]; 00164 00165 /* Offset to data. */ 00166 unsigned char dataOffset[NLM_TARGET_LONG_SIZE]; 00167 00168 /* Length of data. */ 00169 unsigned char dataLength[NLM_TARGET_LONG_SIZE]; 00170 00171 /* Stamp for this customer header--we recognize "CyGnUsEx". */ 00172 char dataStamp[8]; 00173 00174 } NlmNAME(External_Custom_Header);
1.5.6