2 |
7u83 |
1 |
/*
|
|
|
2 |
Crown Copyright (c) 1997
|
|
|
3 |
|
|
|
4 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
5 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
6 |
acting through the Defence Evaluation and Research Agency
|
|
|
7 |
(DERA). It is made available to Recipients with a
|
|
|
8 |
royalty-free licence for its use, reproduction, transfer
|
|
|
9 |
to other parties and amendment for any purpose not excluding
|
|
|
10 |
product development provided that any such use et cetera
|
|
|
11 |
shall be deemed to be acceptance of the following conditions:-
|
|
|
12 |
|
|
|
13 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
14 |
reproduced upon any copies or amended versions of it;
|
|
|
15 |
|
|
|
16 |
(2) Any amended version of it shall be clearly marked to
|
|
|
17 |
show both the nature of and the organisation responsible
|
|
|
18 |
for the relevant amendment or amendments;
|
|
|
19 |
|
|
|
20 |
(3) Its onward transfer from a recipient to another
|
|
|
21 |
party shall be deemed to be that party's acceptance of
|
|
|
22 |
these conditions;
|
|
|
23 |
|
|
|
24 |
(4) DERA gives no warranty or assurance as to its
|
|
|
25 |
quality or suitability for any purpose and DERA accepts
|
|
|
26 |
no liability whatsoever in relation to any use to which
|
|
|
27 |
it may be put.
|
|
|
28 |
*/
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
/* $Id: symtab.h,v 1.2 1998/02/04 10:43:33 release Exp $ */
|
|
|
32 |
|
|
|
33 |
/* S Y M B O L T A B L E P R O D U C T I O N
|
|
|
34 |
|
|
|
35 |
by R. R. Rowlingson
|
|
|
36 |
|
|
|
37 |
Type definitions for the MIPS TDF translator to produce a .T , file (symbol table) suitable for as1.
|
|
|
38 |
|
|
|
39 |
*/
|
|
|
40 |
|
|
|
41 |
#include "cross_config.h"
|
|
|
42 |
#ifndef CROSS_INCLUDE
|
|
|
43 |
#include <sym.h>
|
|
|
44 |
#else
|
|
|
45 |
#include CROSS_INCLUDE/sym.h>
|
|
|
46 |
#endif
|
|
|
47 |
|
|
|
48 |
/********************************************************************
|
|
|
49 |
The following types store the symbolic information for each table
|
|
|
50 |
in the .T file. They consist of a count of the number of elements
|
|
|
51 |
(num,noofsyms) or size (usage) in the case of strings. This is followed
|
|
|
52 |
by a pointer to a fixed number of elements of the appropriate type . The
|
|
|
53 |
size of this space is given by the appropriate macro at the end of this file.
|
|
|
54 |
Consequently, when the number of elements in the table exceeds this fixed size
|
|
|
55 |
a new array is set up and pointed to by the nextsyms or overspill field.
|
|
|
56 |
This mechanism is transparent to the caller of the symbol table routines
|
|
|
57 |
given in new_symbol.c
|
|
|
58 |
********************************************************************/
|
|
|
59 |
|
|
|
60 |
/* array of local symbols and number of entries */
|
|
|
61 |
typedef struct lsymsd {long noofsyms;
|
|
|
62 |
pSYMR symlist;
|
|
|
63 |
struct lsymsd *nextsyms;
|
|
|
64 |
} LSYMS;
|
|
|
65 |
|
|
|
66 |
/* array of external symbols, pEXTR is a pointer to a SYMR and some additional context information */
|
|
|
67 |
typedef struct esymsd {long noofsyms;
|
|
|
68 |
pEXTR symlist;
|
|
|
69 |
struct esymsd *nextsyms;
|
|
|
70 |
} ESYMS;
|
|
|
71 |
|
|
|
72 |
/* array of strings, need one for externals and one for each file's locals */
|
|
|
73 |
typedef struct strings {long usage; /* including end of string chars */
|
|
|
74 |
char* str;
|
|
|
75 |
struct strings *overspill;
|
|
|
76 |
} STRINGS;
|
|
|
77 |
|
|
|
78 |
/* auxillary information, each AUXU differs according to the type of the symbol */
|
|
|
79 |
typedef struct auxtabd {long num;
|
|
|
80 |
pAUXU auxinfo;
|
|
|
81 |
struct auxtabd *moreaux;
|
|
|
82 |
} AUXTAB;
|
|
|
83 |
|
|
|
84 |
/* dense numbers */
|
|
|
85 |
typedef struct dtab {long num;
|
|
|
86 |
pDNR densenolist;
|
|
|
87 |
struct dtab *moredensenos;
|
|
|
88 |
} DENSETAB;
|
|
|
89 |
|
|
|
90 |
/* file descriptors */
|
|
|
91 |
typedef struct {long num;
|
|
|
92 |
pFDR filelist;
|
|
|
93 |
} FILETAB;
|
|
|
94 |
|
|
|
95 |
/* File description info, 1 for each file. Will be converted to FDR for the symbol table by adding indices etc */
|
|
|
96 |
|
|
|
97 |
typedef struct symfdrd {STRINGS* filestr;
|
|
|
98 |
LSYMS* symbols;
|
|
|
99 |
AUXTAB* auxtabs;
|
|
|
100 |
short proc_count;
|
|
|
101 |
} SYMFDR, *pSYMFDR;
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
/* type for recording isyms and filenums for each proc */
|
|
|
105 |
typedef struct {long fnum;
|
|
|
106 |
long procsymindex;
|
|
|
107 |
} PROCSYM;
|
|
|
108 |
|
|
|
109 |
/* this macro is only used by the symbol table printer and is not a genuine
|
|
|
110 |
part of the installer */
|
|
|
111 |
#define IFAUXINFO(X) (((X>=1)&&(X<5))||(X==6)||(X==9)||(X==10)||(X==14))
|
|
|
112 |
|
|
|
113 |
/* The following are the units of space allocated for the various tables */
|
|
|
114 |
|
|
|
115 |
#define STRINGTABSIZE 500 /* for each file */
|
|
|
116 |
#define SYMTABSIZE 200 /* " " */
|
|
|
117 |
#define AUXTABSIZE 200 /* " " */
|
|
|
118 |
#define DENSETABSIZE 200 /* one for all files */
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
|
123 |
|