Back to index

cell-binutils  2.17cvs20070401
alpha-ext.h
Go to the documentation of this file.
00001 /* Alpha NLM (NetWare Loadable Module) support for BFD.
00002    Copyright 1993 Free Software Foundation, Inc.
00003    By Ian Lance Taylor, Cygnus Support
00004 
00005 This file is part of BFD, the Binary File Descriptor library.
00006 
00007 This program is free software; you can redistribute it and/or modify
00008 it under the terms of the GNU General Public License as published by
00009 the Free Software Foundation; either version 2 of the License, or
00010 (at your option) any later version.
00011 
00012 This program is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with this program; if not, write to the Free Software
00019 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00020 
00021 /* An Alpha NLM starts with an instance of this structure.  */
00022 
00023 struct nlm32_alpha_external_prefix_header
00024 {
00025   /* Magic number.  Must be NLM32_ALPHA_MAGIC.  */
00026   unsigned char magic[4];
00027   /* Format descriptor.  Current value is 2.  */
00028   unsigned char format[4];
00029   /* Size of prefix header.  */
00030   unsigned char size[4];
00031   /* Padding.  */
00032   unsigned char pad1[4];
00033   /* More fields may be added later, supposedly.  */
00034 };
00035 
00036 /* The external format of an Alpha NLM reloc.  This is the same as an
00037    Alpha ECOFF reloc.  */
00038 
00039 struct nlm32_alpha_external_reloc
00040 {
00041   unsigned char r_vaddr[8];
00042   unsigned char r_symndx[4];
00043   unsigned char r_bits[4];
00044 };
00045 
00046 /* Constants to unpack the r_bits field of a reloc.  */
00047 
00048 #define RELOC_BITS0_TYPE_LITTLE                  0xff
00049 #define RELOC_BITS0_TYPE_SH_LITTLE        0
00050 
00051 #define RELOC_BITS1_EXTERN_LITTLE         0x01
00052 
00053 #define RELOC_BITS1_OFFSET_LITTLE         0x7e
00054 #define RELOC_BITS1_OFFSET_SH_LITTLE             1
00055 
00056 #define RELOC_BITS1_RESERVED_LITTLE              0x80
00057 #define RELOC_BITS1_RESERVED_SH_LITTLE           7
00058 #define RELOC_BITS2_RESERVED_LITTLE              0xff
00059 #define RELOC_BITS2_RESERVED_SH_LEFT_LITTLE      1
00060 #define RELOC_BITS3_RESERVED_LITTLE              0x03
00061 #define RELOC_BITS3_RESERVED_SH_LEFT_LITTLE      9
00062 
00063 #define RELOC_BITS3_SIZE_LITTLE                  0xfc
00064 #define RELOC_BITS3_SIZE_SH_LITTLE        2
00065 
00066 /* The external format of the fixed header.  */
00067 
00068 typedef struct nlm32_alpha_external_fixed_header
00069 {
00070 
00071   /* The signature field identifies the file as an NLM.  It must contain
00072      the signature string, which depends upon the NLM target. */
00073 
00074   unsigned char signature[24];
00075 
00076   /* The version of the header.  At this time, the highest version number
00077      is 4. */
00078 
00079   unsigned char version[4];
00080 
00081   /* The name of the module, which must be a DOS name (1-8 characters followed
00082      by a period and a 1-3 character extension).  The first byte is the byte
00083      length of the name and the last byte is a null terminator byte.  This
00084      field is fixed length, and any unused bytes should be null bytes.  The
00085      value is set by the OUTPUT keyword to NLMLINK. */
00086 
00087   unsigned char moduleName[14];
00088 
00089   /* Padding to make it come out correct. */
00090 
00091   unsigned char pad1[2];
00092 
00093   /* The byte offset of the code image from the start of the file. */
00094 
00095   unsigned char codeImageOffset[4];
00096 
00097   /* The size of the code image, in bytes. */
00098 
00099   unsigned char codeImageSize[4];
00100 
00101   /* The byte offset of the data image from the start of the file. */
00102 
00103   unsigned char dataImageOffset[4];
00104 
00105   /* The size of the data image, in bytes. */
00106 
00107   unsigned char dataImageSize[4];
00108 
00109   /* The size of the uninitialized data region that the loader is to be
00110      allocated at load time.  Uninitialized data follows the initialized
00111      data in the NLM address space. */
00112 
00113   unsigned char uninitializedDataSize[4];
00114 
00115   /* The byte offset of the custom data from the start of the file.  The
00116      custom data is set by the CUSTOM keyword to NLMLINK.  It is possible
00117      for this to be EOF if there is no custom data. */
00118 
00119   unsigned char customDataOffset[4];
00120 
00121   /* The size of the custom data, in bytes. */
00122 
00123   unsigned char customDataSize[4];
00124 
00125   /* The byte offset of the module dependencies from the start of the file.
00126      The module dependencies are determined by the MODULE keyword in
00127      NLMLINK. */
00128 
00129   unsigned char moduleDependencyOffset[4];
00130 
00131   /* The number of module dependencies at the moduleDependencyOffset. */
00132 
00133   unsigned char numberOfModuleDependencies[4];
00134 
00135   /* The byte offset of the relocation fixup data from the start of the file */
00136      
00137   unsigned char relocationFixupOffset[4];
00138 
00139   unsigned char numberOfRelocationFixups[4];
00140 
00141   unsigned char externalReferencesOffset[4];
00142 
00143   unsigned char numberOfExternalReferences[4];
00144 
00145   unsigned char publicsOffset[4];
00146 
00147   unsigned char numberOfPublics[4];
00148 
00149   /* The byte offset of the internal debug info from the start of the file.
00150      It is possible for this to be EOF if there is no debug info. */
00151 
00152   unsigned char debugInfoOffset[4];
00153 
00154   unsigned char numberOfDebugRecords[4];
00155 
00156   unsigned char codeStartOffset[4];
00157 
00158   unsigned char exitProcedureOffset[4];
00159 
00160   unsigned char checkUnloadProcedureOffset[4];
00161 
00162   unsigned char moduleType[4];
00163 
00164   unsigned char flags[4];
00165 
00166 } Nlm32_alpha_External_Fixed_Header;