Back to index

cell-binutils  2.17cvs20070401
sparc.h
Go to the documentation of this file.
00001 /* coff information for Sparc.
00002    
00003    Copyright 2001 Free Software Foundation, Inc.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 2 of the License, or
00008    (at your option) any later version.
00009    
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014    
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00018 
00019 /* This file is an amalgamation of several standard include files that
00020    define coff format, such as filehdr.h, aouthdr.h, and so forth.  In
00021    addition, all datatypes have been translated into character arrays of
00022    (presumed) equivalent size.  This is necessary so that this file can
00023    be used with different systems while still yielding the same results.  */
00024 
00025 #define L_LNNO_SIZE 2
00026 #define DO_NOT_DEFINE_SYMENT
00027 #define DO_NOT_DEFINE_AUXENT
00028 #include "coff/external.h"
00029 
00030 #define F_RELFLG     (0x0001)      /* relocation info stripped */
00031 #define F_EXEC              (0x0002)      /* file is executable */
00032 #define F_LNNO              (0x0004)      /* line numbers stripped */
00033 #define F_LSYMS             (0x0008)      /* local symbols stripped */
00034 
00035 #define SPARCMAGIC   (0540)
00036 
00037 /* This is Lynx's all-platform magic number for executables. */
00038 
00039 #define LYNXCOFFMAGIC       (0415)
00040 
00041 #define OMAGIC          0404    /* object files, eg as output */
00042 #define ZMAGIC          0413    /* demand load format, eg normal ld output */
00043 #define STMAGIC             0401   /* target shlib */
00044 #define SHMAGIC             0443   /* host   shlib */
00045 
00046 /* More names of "special" sections. */
00047 
00048 #define _TV   ".tv"
00049 #define _INIT ".init"
00050 #define _FINI ".fini"
00051 
00052 /********************** SYMBOLS **********************/
00053 
00054 #define E_SYMNMLEN   (8)    /* # characters in a symbol name   */
00055 #define E_FILNMLEN   (14)   /* # characters in a file name            */
00056 #define E_DIMNUM     (4)    /* # array dimensions in auxiliary entry */
00057 
00058 struct external_syment 
00059 {
00060   union {
00061     char e_name[E_SYMNMLEN];
00062     struct {
00063       char e_zeroes[4];
00064       char e_offset[4];
00065     } e;
00066 #if 0 /* of doubtful value */
00067     char e_nptr[2][4];
00068     struct {
00069       char e_leading_zero[1];
00070       char e_dbx_type[1];
00071       char e_dbx_desc[2];
00072     } e_dbx;
00073 #endif
00074   } e;
00075 
00076   char e_value[4];
00077   char e_scnum[2];
00078   char e_type[2];
00079   char e_sclass[1];
00080   char e_numaux[1];
00081   char padding[2];
00082 };
00083 
00084 #define N_BTMASK     (0xf)
00085 #define N_TMASK             (0x30)
00086 #define N_BTSHFT     (4)
00087 #define N_TSHIFT     (2)
00088   
00089 union external_auxent
00090 {
00091   struct {
00092     char x_tagndx[4];              /* str, un, or enum tag indx */
00093     union {
00094       struct {
00095        char  x_lnno[2];     /* declaration line number */
00096        char  x_size[2];     /* str/union/array size */
00097       } x_lnsz;
00098       char x_fsize[4];             /* size of function */
00099     } x_misc;
00100     union {
00101       struct {                     /* if ISFCN, tag, or .bb */
00102        char x_lnnoptr[4];   /* ptr to fcn line # */
00103        char x_endndx[4];    /* entry ndx past block end */
00104       } x_fcn;
00105       struct {              /* if ISARY, up to 4 dimen. */
00106        char x_dimen[E_DIMNUM][2];
00107       } x_ary;
00108     } x_fcnary;
00109     char x_tvndx[2];        /* tv index */
00110   } x_sym;
00111   
00112   union {
00113     char x_fname[E_FILNMLEN];
00114     struct {
00115       char x_zeroes[4];
00116       char x_offset[4];
00117     } x_n;
00118   } x_file;
00119   
00120   struct {
00121     char x_scnlen[4];              /* section length */
00122     char x_nreloc[2];              /* # relocation entries */
00123     char x_nlinno[2];              /* # line numbers */
00124   } x_scn;
00125   
00126   struct {
00127     char x_tvfill[4];              /* tv fill value */
00128     char x_tvlen[2];        /* length of .tv */
00129     char x_tvran[2][2];            /* tv range */
00130   } x_tv;                   /* .tv section info (in auxent of sym .tv)) */
00131 
00132   char x_fill[20];          /* forces to 20-byte size */
00133 };
00134 
00135 #define       SYMENT struct external_syment
00136 #define       SYMESZ 20     
00137 #define       AUXENT union external_auxent
00138 #define       AUXESZ 20
00139 
00140 #define _ETEXT       "etext"
00141 
00142 /********************** RELOCATION DIRECTIVES **********************/
00143 
00144 struct external_reloc
00145 {
00146   char r_vaddr[4];
00147   char r_symndx[4];
00148   char r_type[2];
00149   char r_spare[2];
00150   char r_offset[4];
00151 };
00152 
00153 #define RELOC struct external_reloc
00154 #define RELSZ 16
00155