ecoffSyms.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:27k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* ecoffSyms.h - MIPS ECOFF symbols definitions header */
  2. /* Copyright 1984-1994 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01i,04nov94,kdl  merge cleanup - added missing comment marks.
  7. 01h,30sep93,caf  removed AUXINT() macro and associated global variable.
  8. 01g,22sep92,rrr  added support for c++
  9. 01f,04jul92,jcf  cleaned up.
  10. 01e,23jun92,ajm  quiet ansi warnings
  11. 01d,26may92,rrr  the tree shuffle
  12. 01c,17may92,ajm  introduced to new.master
  13. 01b,20feb92,ajm  added little endian bitfield defs
  14. 01a,15jan92,ajm  written from mips syms.h, symconst.h, sym.h, stsupport.h
  15. */
  16. #ifndef __INCecoffSymsh
  17. #define __INCecoffSymsh
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /* --------------------------------------------------------- */
  22. /* | Copyright (c) 1986, 1989 MIPS Computer Systems, Inc.  | */
  23. /* | All Rights Reserved.                                  | */
  24. /* --------------------------------------------------------- */
  25. /* Copyright (c) 1984 AT&T */
  26. /*   All Rights Reserved   */
  27. /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
  28. /* The copyright notice above does not evidence any    */
  29. /* actual or intended publication of such source code. */
  30. /* Defines for "special" symbols   */
  31. #define _ETEXT "etext"
  32. #define _EDATA "edata"
  33. #define _END "end"
  34. /*
  35.  * The displacement of the gp is from the start of the small data section
  36.  * is GP_DISP.  The GP_PAD is the padding of the gp area so small negitive
  37.  * offset from gp relocation values can allways be used.
  38.  */
  39. #define GP_PAD 16
  40. #define GP_DISP (32768 - GP_PAD)
  41. #define GP_SIZE  (GP_DISP+32767)
  42. /* "special" symbols for starts of sections */
  43. #define _FTEXT "_ftext"
  44. #define _FDATA "_fdata"
  45. #define _FBSS "_fbss"
  46. #define _GP "_gp"
  47. #define _PROCEDURE_TABLE "_procedure_table"
  48. #define _PROCEDURE_TABLE_SIZE "_procedure_table_size"
  49. #define _PROCEDURE_STRING_TABLE "_procedure_string_table"
  50. #define _COBOL_MAIN "_cobol_main"
  51. #define _START "__start"
  52. /* --------------------------------------------------------- */
  53. /* | Copyright (c) 1986, 1989 MIPS Computer Systems, Inc.  | */
  54. /* | All Rights Reserved.                                  | */
  55. /* --------------------------------------------------------- */
  56. /* (C) Copyright 1984 by Third Eye Software, Inc.
  57.  *
  58.  * Third Eye Software, Inc. grants reproduction and use rights to
  59.  * all parties, PROVIDED that this comment is maintained in the copy.
  60.  *
  61.  * Third Eye makes no claims about the applicability of this
  62.  * symbol table to a particular use.
  63.  */
  64. /* glevels for field in FDR */
  65. #define GLEVEL_0 2
  66. #define GLEVEL_1 1
  67. #define GLEVEL_2 0 /* for upward compat reasons. */
  68. #define GLEVEL_3 3
  69. /* magic number fo symheader */
  70. #define magicSym 0x7009
  71. /* Language codes */
  72. #define langC 0
  73. #define langPascal 1
  74. #define langFortran 2
  75. #define langAssembler 3 /* one Assembley inst might map to many mach */
  76. #define langMachine 4
  77. #define langNil 5
  78. #define langAda 6
  79. #define langPl1 7
  80. #define langCobol 8
  81. #define langMax 9 /* maximun allowed 32 -- 5 bits */
  82. /* The following are value definitions for the fields in the SYMR */
  83. /*
  84.  * Storage Classes
  85.  */
  86. #define scNil 0
  87. #define scText 1 /* text symbol */
  88. #define scData 2 /* initialized data symbol */
  89. #define scBss 3 /* un-initialized data symbol */
  90. #define scRegister 4 /* value of symbol is register number */
  91. #define scAbs 5 /* value of symbol is absolute */
  92. #define scUndefined 6 /* who knows? */
  93. #define scCdbLocal 7 /* variable's value is IN se->va.?? */
  94. #define scBits 8 /* this is a bit field */
  95. #define scCdbSystem 9 /* variable's value is IN CDB's address space */
  96. #define scDbx 9 /* overlap dbx internal use */
  97. #define scRegImage 10 /* register value saved on stack */
  98. #define scInfo 11 /* symbol contains debugger information */
  99. #define scUserStruct 12 /* address in struct user for current process */
  100. #define scSData 13 /* load time only small data */
  101. #define scSBss 14 /* load time only small common */
  102. #define scRData 15 /* load time only read only data */
  103. #define scVar 16 /* Var parameter (fortran,pascal) */
  104. #define scCommon 17 /* common variable */
  105. #define scSCommon 18 /* small common */
  106. #define scVarRegister 19 /* Var parameter in a register */
  107. #define scVariant 20 /* Variant record */
  108. #define scSUndefined 21 /* small undefined(external) data */
  109. #define scInit 22 /* .init section symbol */
  110. #define scBasedVar 23 /* Fortran or PL/1 ptr based var */
  111. #define scMax 32
  112. /*
  113.  *   Symbol Types
  114.  */
  115. #define stNil 0 /* Nuthin' special */
  116. #define stGlobal 1 /* external symbol */
  117. #define stStatic 2 /* static */
  118. #define stParam 3 /* procedure argument */
  119. #define stLocal 4 /* local variable */
  120. #define stLabel 5 /* label */
  121. #define stProc 6 /*     "      "  Procedure */
  122. #define stBlock 7 /* beginnning of block */
  123. #define stEnd 8 /* end (of anything) */
  124. #define stMember 9 /* member (of anything - struct/union/enum */
  125. #define stTypedef 10 /* type definition */
  126. #define stFile 11 /* file name */
  127. #define stRegReloc 12 /* register relocation */
  128. #define stForward 13 /* forwarding address */
  129. #define stStaticProc 14 /* load time only static procs */
  130. #define stConstant 15 /* const */
  131. #define stStaParam 16 /* Fortran static parameters */
  132.     /* Psuedo-symbols - internal to debugger */
  133. #define stStr 60 /* string */
  134. #define stNumber 61 /* pure number (ie. 4 NOR 2+2) */
  135. #define stExpr 62 /* 2+2 vs. 4 */
  136. #define stType 63 /* post-coersion SER */
  137. #define stMax 64
  138. /* definitions for fields in TIR */
  139. /* type qualifiers for ti.tq0 -> ti.(itqMax-1) */
  140. #define tqNil 0 /* bt is what you see */
  141. #define tqPtr 1 /* pointer */
  142. #define tqProc 2 /* procedure */
  143. #define tqArray 3 /* duh */
  144. #define tqFar 4 /* longer addressing - 8086/8 land */
  145. #define tqVol 5 /* volatile */
  146. #define tqMax 8
  147. /* basic types as seen in ti.bt */
  148. #define btNil 0 /* undefined */
  149. #define btAdr 1 /* address - integer same size as pointer */
  150. #define btChar 2 /* character */
  151. #define btUChar 3 /* unsigned character */
  152. #define btShort 4 /* short */
  153. #define btUShort 5 /* unsigned short */
  154. #define btInt 6 /* int */
  155. #define btUInt 7 /* unsigned int */
  156. #define btLong 8 /* long */
  157. #define btULong 9 /* unsigned long */
  158. #define btFloat 10 /* float (real) */
  159. #define btDouble 11 /* Double (real) */
  160. #define btStruct 12 /* Structure (Record) */
  161. #define btUnion 13 /* Union (variant) */
  162. #define btEnum 14 /* Enumerated */
  163. #define btTypedef 15 /* defined via a typedef, isymRef points */
  164. #define btRange 16 /* subrange of int */
  165. #define btSet 17 /* pascal sets */
  166. #define btComplex 18 /* fortran complex */
  167. #define btDComplex 19 /* fortran double complex */
  168. #define btIndirect 20 /* forward or unnamed typedef */
  169. #define btFixedDec 21 /* Fixed Decimal */
  170. #define btFloatDec 22 /* Float Decimal */
  171. #define btString 23 /* Varying Length Character String */
  172. #define btBit 24 /* Aligned Bit String */
  173. #define btPicture 25 /* Picture */
  174. #define btVoid 26 /* void */
  175. #define btMax 64
  176. #if (MFG == MIPS)
  177. /* optimization type codes */
  178. #define otNil 0
  179. #define otReg 1 /* move var to reg */
  180. #define otBlock 2 /* begin basic block */
  181. #define otProc 3 /* procedure */
  182. #define otInline 4 /* inline procedure */
  183. #define otEnd 5 /* whatever you started */
  184. #define otMax 6 /* KEEP UP TO DATE */
  185. #endif /* (MFG == MIPS) */
  186. /* --------------------------------------------------------- */
  187. /* | Copyright (c) 1986, 1989 MIPS Computer Systems, Inc.  | */
  188. /* | All Rights Reserved.                                  | */
  189. /* --------------------------------------------------------- */
  190. /* (C) Copyright 1984 by Third Eye Software, Inc.
  191.  *
  192.  * Third Eye Software, Inc. grants reproduction and use rights to
  193.  * all parties, PROVIDED that this comment is maintained in the copy.
  194.  *
  195.  * Third Eye makes no claims about the applicability of this
  196.  * symbol table to a particular use.
  197.  */
  198. /*
  199.  * This file contains the definition of the Third Eye Symbol Table.
  200.  *
  201.  * Symbols are assumed to be in 'encounter order' - i.e. the order that
  202.  * the things they represent were encountered by the compiler/assembler/loader.
  203.  * EXCEPT for globals! These are assumed to be bunched together,
  204.  * probably right after the last 'normal' symbol.  Globals ARE sorted
  205.  * in ascending order.
  206.  *
  207.  * -----------------------------------------------------------------------
  208.  * A brief word about Third Eye naming/use conventions:
  209.  *
  210.  * All arrays and index's are 0 based.
  211.  * All "ifooMax" values are the highest legal value PLUS ONE. This makes
  212.  * them good for allocating arrays, etc. All checks are "ifoo < ifooMax".
  213.  *
  214.  * "isym" Index into the SYMbol table.
  215.  * "ipd" Index into the Procedure Descriptor array.
  216.  * "ifd" Index into the File Descriptor array.
  217.  * "iss" Index into String Space.
  218.  * "cb" Count of Bytes.
  219.  * "rgPd" array whose domain is "0..ipdMax-1" and RanGe is PDR.
  220.  * "rgFd" array whose domain is "0..ifdMax-1" and RanGe is FDR.
  221.  */
  222. /*
  223.  * Symbolic Header (HDR) structure.
  224.  * As long as all the pointers are set correctly,
  225.  * we don't care WHAT order the various sections come out in!
  226.  *
  227.  * A file produced solely for the use of CDB will probably NOT have
  228.  * any instructions or data areas in it, as these are available
  229.  * in the original.
  230.  */
  231. typedef struct {
  232. short magic; /* to verify validity of the table */
  233. short vstamp; /* version stamp */
  234. long ilineMax; /* number of line number entries */
  235. long cbLine; /* number of bytes for line number entries */
  236. long cbLineOffset; /* offset to start of line number entries*/
  237. long idnMax; /* max index into dense number table */
  238. long cbDnOffset; /* offset to start dense number table */
  239. long ipdMax; /* number of procedures */
  240. long cbPdOffset; /* offset to procedure descriptor table */
  241. long isymMax; /* number of local symbols */
  242. long cbSymOffset; /* offset to start of local symbols*/
  243. long ioptMax; /* max index into optimization symbol entries */
  244. long cbOptOffset; /* offset to optimization symbol entries */
  245. long iauxMax; /* number of auxillary symbol entries */
  246. long cbAuxOffset; /* offset to start of auxillary symbol entries*/
  247. long issMax; /* max index into local strings */
  248. long cbSsOffset; /* offset to start of local strings */
  249. long issExtMax; /* max index into external strings */
  250. long cbSsExtOffset; /* offset to start of external strings */
  251. long ifdMax; /* number of file descriptor entries */
  252. long cbFdOffset; /* offset to file descriptor table */
  253. long crfd; /* number of relative file descriptor entries */
  254. long cbRfdOffset; /* offset to relative file descriptor table */
  255. long iextMax; /* max index into external symbols */
  256. long cbExtOffset; /* offset to start of external symbol entries*/
  257. /* If you add machine dependent fields, add them here */
  258. } HDRR, *pHDRR;
  259. #define cbHDRR sizeof(HDRR)
  260. #define hdrNil ((pHDRR)0)
  261. /*
  262.  * The FDR and PDR structures speed mapping of address <-> name.
  263.  * They are sorted in ascending memory order and are kept in
  264.  * memory by CDB at runtime.
  265.  */
  266. /*
  267.  * File Descriptor
  268.  *
  269.  * There is one of these for EVERY FILE, whether compiled with
  270.  * full debugging symbols or not.  The name of a file should be
  271.  * the path name given to the compiler.  This allows the user
  272.  * to simply specify the names of the directories where the COMPILES
  273.  * were done, and we will be able to find their files.
  274.  * A field whose comment starts with "R - " indicates that it will be
  275.  * setup at runtime.
  276.  */
  277. typedef struct fdr {
  278. unsigned long adr; /* memory address of beginning of file */
  279. long rss; /* file name (of source, if known) */
  280. long issBase; /* file's string space */
  281. long cbSs; /* number of bytes in the ss */
  282. long isymBase; /* beginning of symbols */
  283. long csym; /* count file's of symbols */
  284. long ilineBase; /* file's line symbols */
  285. long cline; /* count of file's line symbols */
  286. long ioptBase; /* file's optimization entries */
  287. long copt; /* count of file's optimization entries */
  288. short ipdFirst; /* start of procedures for this file */
  289. short cpd; /* count of procedures for this file */
  290. long iauxBase; /* file's auxiliary entries */
  291. long caux; /* count of file's auxiliary entries */
  292. long rfdBase; /* index into the file indirect table */
  293. long crfd; /* count file indirect entries */
  294. unsigned lang: 5; /* language for this file */
  295. unsigned fMerge : 1; /* whether this file can be merged */
  296. unsigned fReadin : 1; /* true if it was read in (not just created) */
  297. unsigned fBigendian : 1;/* if set, was compiled on big endian machine */
  298. /* aux's will be in compile host's sex */
  299. unsigned glevel : 2; /* level this file was compiled with */
  300. unsigned reserved : 22;  /* reserved for future use */
  301. long cbLineOffset; /* byte offset from header for this file ln's */
  302. long cbLine; /* size of lines for this file */
  303. } FDR, *pFDR;
  304. #define cbFDR sizeof(FDR)
  305. #define fdNil ((pFDR)0)
  306. #define ifdNil -1
  307. #define ifdTemp 0
  308. #define ilnNil -1
  309. /*
  310.  * Procedure Descriptor
  311.  *
  312.  * There is one of these for EVERY TEXT LABEL.
  313.  * If a procedure is in a file with full symbols, then isym
  314.  * will point to the PROC symbols, else it will point to the
  315.  * global symbol for the label.
  316.  */
  317. typedef struct pdr {
  318. unsigned long adr; /* memory address of start of procedure */
  319. long isym; /* start of local symbol entries */
  320. long iline; /* start of line number entries*/
  321. long regmask; /* save register mask */
  322. long regoffset; /* save register offset */
  323. long iopt; /* start of optimization symbol entries*/
  324. long fregmask; /* save floating point register mask */
  325. long fregoffset; /* save floating point register offset */
  326. long frameoffset; /* frame size */
  327. short framereg; /* frame pointer register */
  328. short pcreg; /* offset or reg of return pc */
  329. long lnLow; /* lowest line in the procedure */
  330. long lnHigh; /* highest line in the procedure */
  331. long cbLineOffset; /* byte offset for this procedure from the fd base */
  332. } PDR, *pPDR;
  333. #define cbPDR sizeof(PDR)
  334. #define pdNil ((pPDR) 0)
  335. #define ipdNil -1
  336. /*
  337.  * The structure of the runtime procedure descriptor created by the loader
  338.  * for use by the static exception system.
  339.  */
  340. typedef struct runtime_pdr {
  341. unsigned long adr; /* memory address of start of procedure */
  342. long regmask; /* save register mask */
  343. long regoffset; /* save register offset */
  344. long fregmask; /* save floating point register mask */
  345. long fregoffset; /* save floating point register offset */
  346. long frameoffset; /* frame size */
  347. short framereg; /* frame pointer register */
  348. short pcreg; /* offset or reg of return pc */
  349. long irpss; /* index into the runtime string table */
  350. long reserved;
  351. struct exception_info *exception_info;/* pointer to exception array */
  352. } RPDR, *pRPDR;
  353. #define cbRPDR sizeof(RPDR)
  354. #define rpdNil ((pRPDR) 0)
  355. /*
  356.  * Line Numbers
  357.  *
  358.  * Line Numbers are segregated from the normal symbols because they
  359.  * are [1] smaller , [2] are of no interest to your
  360.  * average loader, and [3] are never needed in the middle of normal
  361.  * scanning and therefore slow things down.
  362.  *
  363.  * By definition, the first LINER for any given procedure will have
  364.  * the first line of a procedure and represent the first address.
  365.  */
  366. typedef long LINER, *pLINER;
  367. #define lineNil ((pLINER)0)
  368. #define cbLINER sizeof(LINER)
  369. #define ilineNil -1
  370. /*
  371.  * The Symbol Structure (GFW, to those who Know!)
  372.  */
  373. typedef struct {
  374. long iss; /* index into String Space of name */
  375. long value; /* value of symbol */
  376. unsigned st : 6; /* symbol type */
  377. unsigned sc  : 5; /* storage class - text, data, etc */
  378. unsigned reserved : 1; /* reserved */
  379. unsigned index : 20; /* index into sym/aux table */
  380. } SYMR, *pSYMR;
  381. /*
  382.  *  Now SYMR with Little Endian bitfields for swaps
  383.  */
  384. typedef struct {
  385. long iss; /* index into String Space of name */
  386. long value; /* value of symbol */
  387. unsigned index : 20; /* index into sym/aux table */
  388. unsigned reserved : 1; /* reserved */
  389. unsigned sc  : 5; /* storage class - text, data, etc */
  390. unsigned st : 6; /* symbol type */
  391. } SYMR_LE, *pSYMR_LE;
  392. #define symNil ((pSYMR)0)
  393. #define cbSYMR sizeof(SYMR)
  394. #define isymNil -1
  395. #define indexNil 0xfffff
  396. #define issNil -1
  397. #define issNull 0
  398. /* The following converts a memory resident string to an iss.
  399.  * This hack is recognized in SbFIss, in sym.c of the debugger.
  400.  */
  401. #define IssFSb(sb) (0x80000000 | ((unsigned long)(sb)))
  402. /* E X T E R N A L   S Y M B O L  R E C O R D
  403.  *
  404.  * Same as the SYMR except it contains file context to determine where
  405.  * the index is.
  406.  */
  407. typedef struct {
  408. unsigned jmptbl:1; /* symbol is a jump table entry for shlibs */
  409. unsigned cobol_main:1; /* symbol is a cobol main procedure */
  410. unsigned reserved:14; /* reserved for future use */
  411. short ifd; /* where the iss and index fields point into */
  412. SYMR asym; /* symbol for the external */
  413. } EXTR, *pEXTR;
  414. /*
  415.  *
  416.  *  Now EXTR with Litte Endian bit fields for swaps
  417.  *
  418.  */
  419. typedef struct {
  420. unsigned reserved:14; /* reserved for future use */
  421. unsigned cobol_main:1; /* symbol is a cobol main procedure */
  422. unsigned jmptbl:1; /* symbol is a jump table entry for shlibs */
  423. short ifd; /* where the iss and index fields point into */
  424. SYMR asym; /* symbol for the external */
  425. } EXTR_LE, *pEXTR_LE;
  426. #define extNil ((pEXTR)0)
  427. #define cbEXTR sizeof(EXTR)
  428. /* A U X I L L A R Y   T Y P E  I N F O R M A T I O N */
  429. /*
  430.  * Type Information Record
  431.  */
  432. typedef struct {
  433. unsigned fBitfield : 1; /* set if bit width is specified */
  434. unsigned continued : 1; /* indicates additional TQ info in next AUX */
  435. unsigned bt  : 6; /* basic type */
  436. unsigned tq4 : 4;
  437. unsigned tq5 : 4;
  438. /* ---- 16 bit boundary ---- */
  439. unsigned tq0 : 4;
  440. unsigned tq1 : 4; /* 6 type qualifiers - tqPtr, etc. */
  441. unsigned tq2 : 4;
  442. unsigned tq3 : 4;
  443. } TIR, *pTIR;
  444. #define cbTIR sizeof(TIR)
  445. #define tiNil ((pTIR)0)
  446. #define itqMax 6
  447. /*
  448.  * Relative symbol record
  449.  *
  450.  * If the rfd field is 4095, the index field indexes into the global symbol
  451.  * table.
  452.  */
  453. typedef struct {
  454. unsigned rfd : 12;    /* index into the file indirect table */
  455. unsigned index : 20; /* index int sym/aux/iss tables */
  456. } RNDXR, *pRNDXR;
  457. #define cbRNDXR sizeof(RNDXR)
  458. #define rndxNil ((pRNDXR)0)
  459. /* dense numbers or sometimes called block numbers are stored in this type,
  460.  * a rfd of 0xffffffff is an index into the global table.
  461.  */
  462. typedef struct {
  463. unsigned long rfd;    /* index into the file table */
  464. unsigned long index;  /* index int sym/aux/iss tables */
  465. } DNR, *pDNR;
  466. #define cbDNR sizeof(DNR)
  467. #define dnNil ((pDNR)0)
  468. /*
  469.  * Auxillary information occurs only if needed.
  470.  * It ALWAYS occurs in this order when present.
  471.     isymMac used by stProc only
  472.     TIR type info
  473.     TIR additional TQ info (if first TIR was not enough)
  474.     rndx if (bt == btStruct,btUnion,btEnum,btSet,btRange,
  475.     btTypedef):
  476.     rsym.index == iaux for btSet or btRange
  477.     else rsym.index == isym
  478.     dimLow btRange, btSet
  479.     dimMac btRange, btSet
  480.     rndx0 As many as there are tq arrays
  481.     dimLow0
  482.     dimHigh0
  483.     ...
  484.     rndxMax-1
  485.     dimLowMax-1
  486.     dimHighMax-1
  487.     width in bits if (bit field), width in bits.
  488.  */
  489. #define cAuxMax (6 + (idimMax*3))
  490. /* a union of all possible info in the AUX universe */
  491. typedef union {
  492. TIR ti; /* type information record */
  493. RNDXR rndx; /* relative index into symbol table */
  494. long dnLow; /* low dimension */
  495. long dnHigh; /* high dimension */
  496. long isym; /* symbol table index (end of proc) */
  497. long iss; /* index into string space (not used) */
  498. long width; /* width for non-default sized struc fields */
  499. long count; /* count of ranges for variant arm */
  500. } AUXU, *pAUXU;
  501. #define cbAUXU sizeof(AUXU)
  502. #define auxNil ((pAUXU)0)
  503. #define iauxNil -1
  504. /*
  505.  * Optimization symbols
  506.  *
  507.  * Optimization symbols contain some overlap information with the normal
  508.  * symbol table. In particular, the proc information
  509.  * is somewhat redundant but necessary to easily find the other information
  510.  * present.
  511.  *
  512.  * All of the offsets are relative to the beginning of the last otProc
  513.  */
  514. typedef struct {
  515. unsigned ot: 8; /* optimization type */
  516. unsigned value: 24; /* address where we are moving it to */
  517. RNDXR rndx; /* points to a symbol or opt entry */
  518. unsigned long offset; /* relative offset this occured */
  519. } OPTR, *pOPTR;
  520. #define optNil ((pOPTR) 0)
  521. #define cbOPTR sizeof(OPTR)
  522. #define ioptNil -1
  523. /*
  524.  * File Indirect
  525.  *
  526.  * When a symbol is referenced across files the following procedure is used:
  527.  * 1) use the file index to get the File indirect entry.
  528.  * 2) use the file indirect entry to get the File descriptor.
  529.  * 3) add the sym index to the base of that file's sym table
  530.  *
  531.  */
  532. typedef long RFDT, *pRFDT;
  533. #define cbRFDT sizeof(RFDT)
  534. #define rfdNil -1
  535. /*
  536.  * The file indirect table in the mips loader is known as an array of FITs.
  537.  * This is done to keep the code in the loader readable in the area where
  538.  * these tables are merged.  Note this is only a name change.
  539.  */
  540. typedef long FIT, *pFIT;
  541. #define cbFIT sizeof(FIT)
  542. #define ifiNil -1
  543. #define fiNil ((pFIT) 0)
  544. /* Dense numbers
  545.  *
  546.  * Rather than use file index, symbol index pairs to represent symbols
  547.  * and globals, we use dense number so that they can be easily embeded
  548.  * in intermediate code and the programs that process them can
  549.  * use direct access tabls instead of hash table (which would be
  550.  * necesary otherwise because of the sparse name space caused by
  551.  * file index, symbol index pairs. Dense number are represented
  552.  * by RNDXRs.
  553.  */
  554. /*
  555.  * The following table defines the meaning of each SYM field as
  556.  * a function of the "st". (scD/B == scData OR scBss)
  557.  *
  558.  * Note: the value "isymMac" is used by symbols that have the concept
  559.  * of enclosing a block of related information.  This value is the
  560.  * isym of the first symbol AFTER the end associated with the primary
  561.  * symbol. For example if a procedure was at isym==90 and had an
  562.  * isymMac==155, the associated end would be at isym==154, and the
  563.  * symbol at 155 would probably (although not necessarily) be the
  564.  * symbol for the next procedure.  This allows rapid skipping over
  565.  * internal information of various sorts. "stEnd"s ALWAYS have the
  566.  * isym of the primary symbol that started the block.
  567.  *
  568. ST SC VALUE INDEX
  569. -------- ------ -------- ------@0@a,04jul92,jcf   cleaned up.
  570. stFile scText address isymMac
  571. stLabel scText address ---
  572. stGlobal scD/B address iaux
  573. stStatic scD/B address iaux
  574. stParam scAbs offset iaux
  575. stLocal scAbs offset iaux
  576. stProc scText address iaux (isymMac is first AUX)
  577. stStaticProc scText address iaux (isymMac is first AUX)
  578. stMember scNil ordinal --- (if member of enum)
  579. stMember scNil byte offset iaux (if member of struct/union)
  580. stMember scBits bit offset iaux (bit field spec)
  581. stBlock scText address isymMac (text block)
  582. stBlock scNil cb isymMac (struct/union member define)
  583. stBlock scNil cMembers isymMac (enum member define)
  584. stEnd scText address isymStart
  585. stEnd scNil ------- isymStart (struct/union/enum)
  586. stTypedef scNil ------- iaux
  587. stRegReloc sc??? value old register number
  588. stForward sc??? new address isym to original symbol
  589. stConstant scInfo value --- (scalar)
  590. stConstant scInfo iss --- (complex, e.g. string)
  591.  *
  592.  */
  593. /* --------------------------------------------------------- */
  594. /* | Copyright (c) 1986, 1989 MIPS Computer Systems, Inc.  | */
  595. /* | All Rights Reserved.                                  | */
  596. /* --------------------------------------------------------- */
  597. /* Revision 2.1.1.1  1993/06/07  15:55:11  wise
  598.  * project.initialize
  599.  *
  600.  * Revision 1.1  1993/06/07  11:11:14  wise
  601.  */
  602. /*
  603.  * Author Mark I. Himelstein
  604.  * Date Started 5/15/85
  605.  * Purpose provide support to uc to produce mips symbol tables.
  606.  */
  607. #if FALSE
  608. /* removed because global variable in header file causes compile problems */
  609. AUXU _auxtemp;
  610. #define AUXINT(c) ((_auxtemp.isym = c), _auxtemp)
  611. #endif /* FALSE */
  612. /* the following struct frames the FDR dtructure and is used at runtime
  613.  * to access the objects in the FDR with pointers (since the FDR
  614.  * only has indeces.
  615.  */
  616. typedef struct {
  617. pFDR pfd; /* file descriptor for this file */
  618. pSYMR psym; /* symbols for this file */
  619. long csymMax; /* max allocated */
  620. pAUXU paux; /* auxiliaries for this file */
  621. long cauxMax; /* max allocated */
  622. char *pss; /* strings space for this file */
  623. long cbssMax; /* max bytes allowed in ss */
  624. pOPTR popt; /* optimization table for this file */
  625. long coptMax; /* max allocated */
  626. pLINER pline; /* lines for this file */
  627. long clineMax; /* max allocated */
  628. pRFDT prfd; /* file indirect for this file */
  629. long crfdMax; /* max allocated */
  630. pPDR ppd; /* procedure descriptor tables */
  631. long cpdMax; /* max allocated */
  632. long freadin; /* set if read in */
  633. } CFDR, *pCFDR;
  634. #define cbCFDR sizeof (CFDR)
  635. #define cfdNil ((pCFDR) 0)
  636. #define icfdNil -1
  637. /* the following struct embodies the HDRR dtructure and is used at runtime
  638.  * to access the objects in the HDRR with pointers (since the HDRR
  639.  * only has indeces.
  640.  */
  641. typedef struct {
  642. long fappend; /* are we appending to this beast ? */
  643. pCFDR pcfd; /* the compile time file descriptors */
  644. pFDR pfd; /* all of the file descriptors in this cu */
  645. long cfd; /* count of file descriptors */
  646. long cfdMax; /* max file descriptors */
  647. pSYMR psym; /* the symbols for this cu */
  648. pEXTR pext; /* externals for this cu */
  649. long cext; /* number of externals */
  650. long cextMax; /* max currently allowed */
  651. char *pssext; /* string space for externals */
  652. long cbssext; /* # of bytes in ss */
  653. long cbssextMax; /* # of bytes allowed in ss */
  654. pAUXU paux; /* auxiliaries for this cu */
  655. char *pss; /* string space for this cu */
  656. pDNR pdn; /* dense number table for this cu */
  657. long cdn; /* number of dn's */
  658. long cdnMax; /* max currently allowed */
  659. pOPTR popt; /* optimization table for this cu */
  660. pLINER pline; /* lines for this cu */
  661. pRFDT prfd; /* file indirect for this cu */
  662. pPDR ppd; /* procedure descriptor tables */
  663. int flags; /* which has been read in already */
  664. int fswap; /* do dubtables need to be swapped */
  665. HDRR hdr; /* header from disk */
  666. } CHDRR, *pCHDRR;
  667. #define cbCHDRR sizeof (CHDRR)
  668. #define chdrNil ((pCHDRR) 0)
  669. #define ichdrNil -1
  670. /* constants and macros */
  671. #define ST_FILESINIT 25  /* initial number of files */
  672. #define ST_STRTABINIT 512  /* initial number of bytes in strring space */
  673. #define ST_EXTINIT 32 /* initial number of symbols/file */
  674. #define ST_SYMINIT 64 /* initial number of symbols/file */
  675. #define ST_AUXINIT 64 /* initial number of auxiliaries/file */
  676. #define ST_LINEINIT 512 /* initial number of auxiliaries/file */
  677. #define ST_PDINIT 32 /* initial number of procedures in one file */
  678. #define ST_DNINIT 128 /* initial # of dense numbers */
  679. #define ST_FDISS 1 /* we expect a fd's iss to be this */
  680. #define ST_IDNINIT 2 /* start the dense num tab with this entry */
  681. #define ST_PROCTIROFFSET 1 /* offset from aux of proc's tir */
  682. #define ST_RELOC 1 /* this sym has been reloced already */
  683. #define ST_EXTIFD 0x7fffffff /* ifd for externals */
  684. #define ST_RFDESCAPE 0xfff /* rndx.rfd escape says next aux is rfd */
  685. #define ST_ANONINDEX 0xfffff /* rndx.index for anonymous names */
  686. #define ST_PEXTS 0x01 /* mask, if set externals */
  687. #define ST_PSYMS 0x02 /* mask, if set symbols */
  688. #define ST_PLINES 0x04 /* mask, if set lines */
  689. #define ST_PHEADER 0x08 /* mask, if set headers */
  690. #define ST_PDNS 0x10 /* mask, if set dense numbers */
  691. #define ST_POPTS 0x20 /* mask, if set optimization entries */
  692. #define ST_PRFDS 0x40 /* mask, if set file indirect entries */
  693. #define ST_PSSS 0x80 /* mask, if set string space */
  694. #define ST_PPDS 0x100 /* mask, if set proc descriptors */
  695. #define ST_PFDS 0x200 /* mask, if set file descriptors */
  696. #define ST_PAUXS 0x400 /* mask, if set auxiliaries */
  697. #define ST_PSSEXTS 0x800 /* mask, if set external string space */
  698. #define ST_FCOMPLEXBT(bt) ((bt == btStruct) || (bt == btUnion) || (bt == btTypedef) || (bt == btEnum))
  699. #define valueNil 0
  700. #define export
  701. /*
  702.  * Constants to describe aux types used in swap_aux( , ,type);
  703.  */
  704. #define ST_AUX_TIR 0
  705. #define ST_AUX_RNDXR 1
  706. #define ST_AUX_DNLOW 2
  707. #define ST_AUX_DNMAC 3
  708. #define ST_AUX_ISYM 4
  709. #define ST_AUX_ISS 5
  710. #define ST_AUX_WIDTH 6
  711. /* Revision 2.1.1.1  1993/06/07  15:55:11  wise
  712.  * project.initialize
  713.  *
  714.  * Revision 1.1  1993/06/07  11:11:14  wise
  715.  */
  716. #ifdef __cplusplus
  717. }
  718. #endif
  719. #endif /* __INCecoffSymsh */