"I am a person who works hard and plays hard."

Yuan Wei
Second Year Graduate Student Department of Computer Science
University of Virginia Charlottesville, VA 22903
Email: yw3f@cs.virginia.edu


Source Code Analysis

Main Page   Compound List   File List   Compound Members   File Members  

ecoff.h

Go to the documentation of this file.
00001 /*
00002  * ecoff.h - SimpleScalar ECOFF definitions
00003  *
00004  * This file is a part of the SimpleScalar tool suite written by
00005  * Todd M. Austin as a part of the Multiscalar Research Project.
00006  *  
00007  * The tool suite is currently maintained by Doug Burger and Todd M. Austin.
00008  * 
00009  * Copyright (C) 1994, 1995, 1996, 1997 by Todd M. Austin
00010  *
00011  * This source file is distributed "as is" in the hope that it will be
00012  * useful.  The tool set comes with no warranty, and no author or
00013  * distributor accepts any responsibility for the consequences of its
00014  * use. 
00015  * 
00016  * Everyone is granted permission to copy, modify and redistribute
00017  * this tool set under the following conditions:
00018  * 
00019  *    This source code is distributed for non-commercial use only. 
00020  *    Please contact the maintainer for restrictions applying to 
00021  *    commercial use.
00022  *
00023  *    Permission is granted to anyone to make or distribute copies
00024  *    of this source code, either as received or modified, in any
00025  *    medium, provided that all copyright notices, permission and
00026  *    nonwarranty notices are preserved, and that the distributor
00027  *    grants the recipient permission for further redistribution as
00028  *    permitted by this document.
00029  *
00030  *    Permission is granted to distribute this file in compiled
00031  *    or executable form under the same conditions that apply for
00032  *    source code, provided that either:
00033  *
00034  *    A. it is accompanied by the corresponding machine-readable
00035  *       source code,
00036  *    B. it is accompanied by a written offer, with no time limit,
00037  *       to give anyone a machine-readable copy of the corresponding
00038  *       source code in return for reimbursement of the cost of
00039  *       distribution.  This written offer must permit verbatim
00040  *       duplication by anyone, or
00041  *    C. it is distributed by someone who received only the
00042  *       executable form, and is accompanied by a copy of the
00043  *       written offer of source code that they received concurrently.
00044  *
00045  * In other words, you are welcome to use, share and improve this
00046  * source file.  You are forbidden to forbid anyone else to use, share
00047  * and improve what you give them.
00048  *
00049  * INTERNET: dburger@cs.wisc.edu
00050  * US Mail:  1210 W. Dayton Street, Madison, WI 53706
00051  *
00052  * $Id: ecoff.h,v 1.1.1.1 2000/05/26 15:22:27 taustin Exp $
00053  *
00054  * $Log: ecoff.h,v $
00055  * Revision 1.1.1.1  2000/05/26 15:22:27  taustin
00056  * SimpleScalar Tool Set
00057  *
00058  *
00059  * Revision 1.2  1999/12/31 18:57:49  taustin
00060  * quad_t naming conflicts removed
00061  *
00062  * Revision 1.1  1998/08/27 16:54:03  taustin
00063  * Initial revision
00064  *
00065  * Revision 1.1  1998/05/06  01:09:18  calder
00066  * Initial revision
00067  *
00068  * Revision 1.1  1997/04/16  22:13:35  taustin
00069  * Initial revision
00070  *
00071  *
00072  */
00073 
00074 /* SimpleScalar ECOFF definitions */
00075 
00076 #ifndef ECOFF_H
00077 #define ECOFF_H
00078 
00079 #include "alpha.h"
00080 
00081 #define ECOFF_EB_MAGIC          0x0160
00082 #define ECOFF_EB_OTHER          0x6001
00083 #define ECOFF_EL_MAGIC          0x0162
00084 #define ECOFF_EL_OTHER          0x6201
00085 #define ECOFF_ALPHAMAGIC        0603
00086 
00087 struct ecoff_filehdr {
00088   half_t f_magic;
00089   half_t f_nscns;
00090   sword_t f_timdat;
00091   qword_t f_symptr;
00092   sword_t f_nsyms;
00093   half_t f_opthdr;
00094   half_t f_flags;
00095 };
00096 
00097 struct ecoff_aouthdr {
00098   half_t magic;
00099   half_t vstamp;
00100   half_t bldrev;
00101   half_t padcell;
00102   qword_t tsize;
00103   qword_t dsize;
00104   qword_t bsize;
00105   qword_t entry;
00106   qword_t text_start;
00107   qword_t data_start;
00108   qword_t bss_start;
00109   sword_t gprmask;
00110   sword_t fprmask;
00111   qword_t gp_value;
00112 };
00113 
00114 struct ecoff_scnhdr {
00115   char s_name[8];
00116   qword_t s_paddr;
00117   qword_t s_vaddr;
00118   qword_t s_size;
00119   qword_t s_scnptr;
00120   qword_t s_relptr;
00121   qword_t s_lnnoptr;
00122   half_t s_nreloc;
00123   half_t s_nlnno;
00124   sword_t s_flags;
00125 };
00126 
00127 typedef struct ecoff_symhdr_t {
00128   half_t magic;
00129   half_t vstamp;
00130 
00131   sword_t ilineMax;             /* number of line number entries */
00132   sword_t idnMax;               /* max index into dense number table */
00133   sword_t ipdMax;               /* number of procedures */
00134   sword_t isymMax;              /* number of local symbols */
00135   sword_t ioptMax;              /* max index into optimization sym entries */
00136   sword_t iauxMax;              /* number of auxiliary symbol entries */
00137   sword_t issMax;               /* max index into local strings */
00138   sword_t issExtMax;            /* max index into external strings */
00139   sword_t ifdMax;               /* number of file descriptor entries */
00140   sword_t crfd;                 /* number of relative file descriptor ents */
00141   sword_t iextMax;              /* max index into external symbols */
00142   qword_t cbLine;               /* number of bytes for line number entries */
00143   qword_t cbLineOffset;         /* offset to start of line number entries*/
00144   qword_t cbDnOffset;           /* offset to start dense number table */
00145   qword_t cbPdOffset;           /* offset to procedure descriptor table */
00146   qword_t cbSymOffset;          /* offset to start of local symbols */
00147   qword_t cbOptOffset;          /* offset to optimization symbol entries */
00148   qword_t cbAuxOffset;          /* offset to start of aux symbol entries */
00149   qword_t cbSsOffset;           /* offset to start of local strings */
00150   qword_t cbSsExtOffset;        /* offset to start of external strings */
00151   qword_t cbFdOffset;           /* offset to file descriptor table */
00152   qword_t cbRfdOffset;          /* offset to relative file descriptor table */
00153   qword_t cbExtOffset;          /* offset to start of ext symbol entries */
00154 } ecoff_HDRR;
00155 
00156 #define ECOFF_magicSym 0x1992
00157 
00158 typedef struct ecoff_fdr {
00159   word_t adr;
00160   sword_t rss;
00161   sword_t issBase;
00162   sword_t cbSs;
00163   sword_t isymBase;
00164   sword_t csym;
00165   sword_t ilineBase;
00166   sword_t cline;
00167   sword_t ioptBase;
00168   sword_t copt;
00169   half_t ipdFirst;
00170   half_t cpd;
00171   sword_t iauxBase;
00172   sword_t caux;
00173   sword_t rfdBase;
00174   sword_t crfd;
00175   unsigned lang :5;
00176   unsigned fMerge :1;
00177   unsigned fReadin :1;
00178   unsigned fBigendian :1;
00179   unsigned reserved :24;
00180   sword_t cbLineOffset;
00181   sword_t cbLine;
00182 } ecoff_FDR;
00183 
00184 typedef struct ecoff_pdr {
00185   word_t adr;
00186   sword_t isym;
00187   sword_t iline;
00188   sword_t regmask;
00189   sword_t regoffset;
00190   sword_t iopt;
00191   sword_t fregmask;
00192   sword_t fregoffset;
00193   sword_t frameoffset;
00194   half_t framereg;
00195   half_t pcreg;
00196   sword_t lnLow;
00197   sword_t lnHigh;
00198   sword_t cbLineOffset;
00199 } ecoff_PDR;
00200 
00201 typedef struct ecoff_SYMR {
00202   qword_t value;
00203   sword_t iss;
00204   unsigned st :6;
00205   unsigned sc :5;
00206   unsigned reserved :1;
00207   unsigned index :20;
00208 } ecoff_SYMR;
00209 
00210 typedef struct ecoff_EXTR {
00211   ecoff_SYMR asym;
00212   sword_t ifd;
00213   sword_t reserved;
00214 } ecoff_EXTR;
00215 
00216 #define ECOFF_R_SN_TEXT         1
00217 #define ECOFF_R_SN_RDATA        2
00218 #define ECOFF_R_SN_DATA         3
00219 #define ECOFF_R_SN_SDATA        4
00220 #define ECOFF_R_SN_SBSS         5
00221 #define ECOFF_R_SN_BSS          6
00222 
00223 #define ECOFF_STYP_TEXT         0x0020
00224 #define ECOFF_STYP_RDATA        0x0100
00225 #define ECOFF_STYP_DATA         0x0040
00226 #define ECOFF_STYP_SDATA        0x0200
00227 #define ECOFF_STYP_SBSS         0x0400
00228 #define ECOFF_STYP_BSS          0x0080
00229 #define ECOFF_STYP_INIT         0x80000000      /* sect only contains the text
00230                                                    insts for the .init sec. */
00231 #define ECOFF_STYP_FINI         0x01000000      /* insts for .fini */
00232 #define ECOFF_STYP_RCONST       0x02200000      /* overloads with reginfo */
00233 #define ECOFF_STYP_LITA         0x04000000      /* addr literals only        */
00234 #define ECOFF_STYP_LIT8         0x08000000      /* lit pool for 8 byte lits */
00235 #define ECOFF_STYP_LIT4         0x10000000      /* lit pool for 4 byte lits */
00236 #define ECOFF_STYP_XDATA        0x02400000      /* exception sections */
00237 #define ECOFF_STYP_PDATA        0x02800000      /* exception sections */
00238 
00239 #define ECOFF_stNil             0
00240 #define ECOFF_stGlobal          1
00241 #define ECOFF_stStatic          2
00242 #define ECOFF_stParam           3
00243 #define ECOFF_stLocal           4
00244 #define ECOFF_stLabel           5
00245 #define ECOFF_stProc            6
00246 #define ECOFF_stBlock           7
00247 #define ECOFF_stEnd             8
00248 #define ECOFF_stMember          9
00249 #define ECOFF_stTypedef         10
00250 #define ECOFF_stFile            11
00251 #define ECOFF_stRegReloc        12
00252 #define ECOFF_stForward         13
00253 #define ECOFF_stStaticProc      14
00254 #define ECOFF_stConstant        15
00255 
00256 #endif /* ECOFF_H */


UVa CS Department of Computer Science
School of Engineering, University of Virginia
151 Engineer's Way, P.O. Box 400740
Charlottesville, Virginia 22904-4740

(434) 982-2200  Fax: (434) 982-2214