xref: /dragonfly/contrib/gdb-7/include/coff/sym.h (revision 86d7f5d3)
1*86d7f5d3SJohn Marino /* Declarations of internal format of MIPS ECOFF symbols.
2*86d7f5d3SJohn Marino    Originally contributed by MIPS Computer Systems and Third Eye Software.
3*86d7f5d3SJohn Marino    Changes contributed by Cygnus Support are in the public domain.
4*86d7f5d3SJohn Marino 
5*86d7f5d3SJohn Marino    This file is just aggregated with the files that make up the GNU
6*86d7f5d3SJohn Marino    release; it is not considered part of GAS, GDB, or other GNU
7*86d7f5d3SJohn Marino    programs.  */
8*86d7f5d3SJohn Marino 
9*86d7f5d3SJohn Marino /*
10*86d7f5d3SJohn Marino  * |-----------------------------------------------------------|
11*86d7f5d3SJohn Marino  * | Copyright (c) 1992, 1991, 1990 MIPS Computer Systems, Inc.|
12*86d7f5d3SJohn Marino  * | MIPS Computer Systems, Inc. grants reproduction and use   |
13*86d7f5d3SJohn Marino  * | rights to all parties, PROVIDED that this comment is      |
14*86d7f5d3SJohn Marino  * | maintained in the copy.                                   |
15*86d7f5d3SJohn Marino  * |-----------------------------------------------------------|
16*86d7f5d3SJohn Marino  */
17*86d7f5d3SJohn Marino #ifndef _SYM_H
18*86d7f5d3SJohn Marino #define _SYM_H
19*86d7f5d3SJohn Marino 
20*86d7f5d3SJohn Marino /* (C) Copyright 1984 by Third Eye Software, Inc.
21*86d7f5d3SJohn Marino  *
22*86d7f5d3SJohn Marino  * Third Eye Software, Inc. grants reproduction and use rights to
23*86d7f5d3SJohn Marino  * all parties, PROVIDED that this comment is maintained in the copy.
24*86d7f5d3SJohn Marino  *
25*86d7f5d3SJohn Marino  * Third Eye makes no claims about the applicability of this
26*86d7f5d3SJohn Marino  * symbol table to a particular use.
27*86d7f5d3SJohn Marino  */
28*86d7f5d3SJohn Marino 
29*86d7f5d3SJohn Marino /*
30*86d7f5d3SJohn Marino  * This file contains the definition of the Third Eye Symbol Table.
31*86d7f5d3SJohn Marino  *
32*86d7f5d3SJohn Marino  * Symbols are assumed to be in 'encounter order' - i.e. the order that
33*86d7f5d3SJohn Marino  * the things they represent were encountered by the compiler/assembler/loader.
34*86d7f5d3SJohn Marino  * EXCEPT for globals!	These are assumed to be bunched together,
35*86d7f5d3SJohn Marino  * probably right after the last 'normal' symbol.  Globals ARE sorted
36*86d7f5d3SJohn Marino  * in ascending order.
37*86d7f5d3SJohn Marino  *
38*86d7f5d3SJohn Marino  * -----------------------------------------------------------------------
39*86d7f5d3SJohn Marino  * A brief word about Third Eye naming/use conventions:
40*86d7f5d3SJohn Marino  *
41*86d7f5d3SJohn Marino  * All arrays and index's are 0 based.
42*86d7f5d3SJohn Marino  * All "ifooMax" values are the highest legal value PLUS ONE. This makes
43*86d7f5d3SJohn Marino  * them good for allocating arrays, etc. All checks are "ifoo < ifooMax".
44*86d7f5d3SJohn Marino  *
45*86d7f5d3SJohn Marino  * "isym"	Index into the SYMbol table.
46*86d7f5d3SJohn Marino  * "ipd"	Index into the Procedure Descriptor array.
47*86d7f5d3SJohn Marino  * "ifd"	Index into the File Descriptor array.
48*86d7f5d3SJohn Marino  * "iss"	Index into String Space.
49*86d7f5d3SJohn Marino  * "cb"		Count of Bytes.
50*86d7f5d3SJohn Marino  * "rgPd"	array whose domain is "0..ipdMax-1" and RanGe is PDR.
51*86d7f5d3SJohn Marino  * "rgFd"	array whose domain is "0..ifdMax-1" and RanGe is FDR.
52*86d7f5d3SJohn Marino  */
53*86d7f5d3SJohn Marino 
54*86d7f5d3SJohn Marino 
55*86d7f5d3SJohn Marino /*
56*86d7f5d3SJohn Marino  * Symbolic Header (HDR) structure.
57*86d7f5d3SJohn Marino  * As long as all the pointers are set correctly,
58*86d7f5d3SJohn Marino  * we don't care WHAT order the various sections come out in!
59*86d7f5d3SJohn Marino  *
60*86d7f5d3SJohn Marino  * A file produced solely for the use of CDB will probably NOT have
61*86d7f5d3SJohn Marino  * any instructions or data areas in it, as these are available
62*86d7f5d3SJohn Marino  * in the original.
63*86d7f5d3SJohn Marino  */
64*86d7f5d3SJohn Marino 
65*86d7f5d3SJohn Marino typedef struct {
66*86d7f5d3SJohn Marino 	short	magic;		/* to verify validity of the table */
67*86d7f5d3SJohn Marino 	short	vstamp;		/* version stamp */
68*86d7f5d3SJohn Marino 	long	ilineMax;	/* number of line number entries */
69*86d7f5d3SJohn Marino 	bfd_vma	cbLine;		/* number of bytes for line number entries */
70*86d7f5d3SJohn Marino 	bfd_vma	cbLineOffset;	/* offset to start of line number entries*/
71*86d7f5d3SJohn Marino 	long	idnMax;		/* max index into dense number table */
72*86d7f5d3SJohn Marino 	bfd_vma	cbDnOffset;	/* offset to start dense number table */
73*86d7f5d3SJohn Marino 	long	ipdMax;		/* number of procedures */
74*86d7f5d3SJohn Marino 	bfd_vma	cbPdOffset;	/* offset to procedure descriptor table */
75*86d7f5d3SJohn Marino 	long	isymMax;	/* number of local symbols */
76*86d7f5d3SJohn Marino 	bfd_vma	cbSymOffset;	/* offset to start of local symbols*/
77*86d7f5d3SJohn Marino 	long	ioptMax;	/* max index into optimization symbol entries */
78*86d7f5d3SJohn Marino 	bfd_vma	cbOptOffset;	/* offset to optimization symbol entries */
79*86d7f5d3SJohn Marino 	long	iauxMax;	/* number of auxillary symbol entries */
80*86d7f5d3SJohn Marino 	bfd_vma	cbAuxOffset;	/* offset to start of auxillary symbol entries*/
81*86d7f5d3SJohn Marino 	long	issMax;		/* max index into local strings */
82*86d7f5d3SJohn Marino 	bfd_vma	cbSsOffset;	/* offset to start of local strings */
83*86d7f5d3SJohn Marino 	long	issExtMax;	/* max index into external strings */
84*86d7f5d3SJohn Marino 	bfd_vma	cbSsExtOffset;	/* offset to start of external strings */
85*86d7f5d3SJohn Marino 	long	ifdMax;		/* number of file descriptor entries */
86*86d7f5d3SJohn Marino 	bfd_vma	cbFdOffset;	/* offset to file descriptor table */
87*86d7f5d3SJohn Marino 	long	crfd;		/* number of relative file descriptor entries */
88*86d7f5d3SJohn Marino 	bfd_vma	cbRfdOffset;	/* offset to relative file descriptor table */
89*86d7f5d3SJohn Marino 	long	iextMax;	/* max index into external symbols */
90*86d7f5d3SJohn Marino 	bfd_vma	cbExtOffset;	/* offset to start of external symbol entries*/
91*86d7f5d3SJohn Marino 	/* If you add machine dependent fields, add them here */
92*86d7f5d3SJohn Marino 	} HDRR, *pHDRR;
93*86d7f5d3SJohn Marino #define cbHDRR sizeof(HDRR)
94*86d7f5d3SJohn Marino #define hdrNil ((pHDRR)0)
95*86d7f5d3SJohn Marino 
96*86d7f5d3SJohn Marino /*
97*86d7f5d3SJohn Marino  * The FDR and PDR structures speed mapping of address <-> name.
98*86d7f5d3SJohn Marino  * They are sorted in ascending memory order and are kept in
99*86d7f5d3SJohn Marino  * memory by CDB at runtime.
100*86d7f5d3SJohn Marino  */
101*86d7f5d3SJohn Marino 
102*86d7f5d3SJohn Marino /*
103*86d7f5d3SJohn Marino  * File Descriptor
104*86d7f5d3SJohn Marino  *
105*86d7f5d3SJohn Marino  * There is one of these for EVERY FILE, whether compiled with
106*86d7f5d3SJohn Marino  * full debugging symbols or not.  The name of a file should be
107*86d7f5d3SJohn Marino  * the path name given to the compiler.	 This allows the user
108*86d7f5d3SJohn Marino  * to simply specify the names of the directories where the COMPILES
109*86d7f5d3SJohn Marino  * were done, and we will be able to find their files.
110*86d7f5d3SJohn Marino  * A field whose comment starts with "R - " indicates that it will be
111*86d7f5d3SJohn Marino  * setup at runtime.
112*86d7f5d3SJohn Marino  */
113*86d7f5d3SJohn Marino typedef struct fdr {
114*86d7f5d3SJohn Marino 	bfd_vma	adr;		/* memory address of beginning of file */
115*86d7f5d3SJohn Marino 	long	rss;		/* file name (of source, if known) */
116*86d7f5d3SJohn Marino 	long	issBase;	/* file's string space */
117*86d7f5d3SJohn Marino 	bfd_vma	cbSs;		/* number of bytes in the ss */
118*86d7f5d3SJohn Marino 	long	isymBase;	/* beginning of symbols */
119*86d7f5d3SJohn Marino 	long	csym;		/* count file's of symbols */
120*86d7f5d3SJohn Marino 	long	ilineBase;	/* file's line symbols */
121*86d7f5d3SJohn Marino 	long	cline;		/* count of file's line symbols */
122*86d7f5d3SJohn Marino 	long	ioptBase;	/* file's optimization entries */
123*86d7f5d3SJohn Marino 	long	copt;		/* count of file's optimization entries */
124*86d7f5d3SJohn Marino 	unsigned short ipdFirst;/* start of procedures for this file */
125*86d7f5d3SJohn Marino 	short	cpd;		/* count of procedures for this file */
126*86d7f5d3SJohn Marino 	long	iauxBase;	/* file's auxiliary entries */
127*86d7f5d3SJohn Marino 	long	caux;		/* count of file's auxiliary entries */
128*86d7f5d3SJohn Marino 	long	rfdBase;	/* index into the file indirect table */
129*86d7f5d3SJohn Marino 	long	crfd;		/* count file indirect entries */
130*86d7f5d3SJohn Marino 	unsigned lang: 5;	/* language for this file */
131*86d7f5d3SJohn Marino 	unsigned fMerge : 1;	/* whether this file can be merged */
132*86d7f5d3SJohn Marino 	unsigned fReadin : 1;	/* true if it was read in (not just created) */
133*86d7f5d3SJohn Marino 	unsigned fBigendian : 1;/* if set, was compiled on big endian machine */
134*86d7f5d3SJohn Marino 				/*	aux's will be in compile host's sex */
135*86d7f5d3SJohn Marino 	unsigned glevel : 2;	/* level this file was compiled with */
136*86d7f5d3SJohn Marino 	unsigned reserved : 22;  /* reserved for future use */
137*86d7f5d3SJohn Marino 	bfd_vma	cbLineOffset;	/* byte offset from header for this file ln's */
138*86d7f5d3SJohn Marino 	bfd_vma	cbLine;		/* size of lines for this file */
139*86d7f5d3SJohn Marino 	} FDR, *pFDR;
140*86d7f5d3SJohn Marino #define cbFDR sizeof(FDR)
141*86d7f5d3SJohn Marino #define fdNil ((pFDR)0)
142*86d7f5d3SJohn Marino #define ifdNil -1
143*86d7f5d3SJohn Marino #define ifdTemp 0
144*86d7f5d3SJohn Marino #define ilnNil -1
145*86d7f5d3SJohn Marino 
146*86d7f5d3SJohn Marino 
147*86d7f5d3SJohn Marino /*
148*86d7f5d3SJohn Marino  * Procedure Descriptor
149*86d7f5d3SJohn Marino  *
150*86d7f5d3SJohn Marino  * There is one of these for EVERY TEXT LABEL.
151*86d7f5d3SJohn Marino  * If a procedure is in a file with full symbols, then isym
152*86d7f5d3SJohn Marino  * will point to the PROC symbols, else it will point to the
153*86d7f5d3SJohn Marino  * global symbol for the label.
154*86d7f5d3SJohn Marino  */
155*86d7f5d3SJohn Marino 
156*86d7f5d3SJohn Marino typedef struct pdr {
157*86d7f5d3SJohn Marino 	bfd_vma	adr;		/* memory address of start of procedure */
158*86d7f5d3SJohn Marino 	long	isym;		/* start of local symbol entries */
159*86d7f5d3SJohn Marino 	long	iline;		/* start of line number entries*/
160*86d7f5d3SJohn Marino 	long	regmask;	/* save register mask */
161*86d7f5d3SJohn Marino 	long	regoffset;	/* save register offset */
162*86d7f5d3SJohn Marino 	long	iopt;		/* start of optimization symbol entries*/
163*86d7f5d3SJohn Marino 	long	fregmask;	/* save floating point register mask */
164*86d7f5d3SJohn Marino 	long	fregoffset;	/* save floating point register offset */
165*86d7f5d3SJohn Marino 	long	frameoffset;	/* frame size */
166*86d7f5d3SJohn Marino 	short	framereg;	/* frame pointer register */
167*86d7f5d3SJohn Marino 	short	pcreg;		/* offset or reg of return pc */
168*86d7f5d3SJohn Marino 	long	lnLow;		/* lowest line in the procedure */
169*86d7f5d3SJohn Marino 	long	lnHigh;		/* highest line in the procedure */
170*86d7f5d3SJohn Marino 	bfd_vma	cbLineOffset;	/* byte offset for this procedure from the fd base */
171*86d7f5d3SJohn Marino 	/* These fields are new for 64 bit ECOFF.  */
172*86d7f5d3SJohn Marino 	unsigned gp_prologue : 8; /* byte size of GP prologue */
173*86d7f5d3SJohn Marino 	unsigned gp_used : 1;	/* true if the procedure uses GP */
174*86d7f5d3SJohn Marino 	unsigned reg_frame : 1;	/* true if register frame procedure */
175*86d7f5d3SJohn Marino 	unsigned prof : 1;	/* true if compiled with -pg */
176*86d7f5d3SJohn Marino 	unsigned reserved : 13;	/* reserved: must be zero */
177*86d7f5d3SJohn Marino 	unsigned localoff : 8;	/* offset of local variables from vfp */
178*86d7f5d3SJohn Marino 	} PDR, *pPDR;
179*86d7f5d3SJohn Marino #define cbPDR sizeof(PDR)
180*86d7f5d3SJohn Marino #define pdNil ((pPDR) 0)
181*86d7f5d3SJohn Marino #define ipdNil	-1
182*86d7f5d3SJohn Marino 
183*86d7f5d3SJohn Marino /*
184*86d7f5d3SJohn Marino  * The structure of the runtime procedure descriptor created by the loader
185*86d7f5d3SJohn Marino  * for use by the static exception system.
186*86d7f5d3SJohn Marino  */
187*86d7f5d3SJohn Marino /*
188*86d7f5d3SJohn Marino  * If 0'd out because exception_info chokes Visual C++ and because there
189*86d7f5d3SJohn Marino  * don't seem to be any references to this structure elsewhere in gdb.
190*86d7f5d3SJohn Marino  */
191*86d7f5d3SJohn Marino #if 0
192*86d7f5d3SJohn Marino typedef struct runtime_pdr {
193*86d7f5d3SJohn Marino 	bfd_vma	adr;		/* memory address of start of procedure */
194*86d7f5d3SJohn Marino 	long	regmask;	/* save register mask */
195*86d7f5d3SJohn Marino 	long	regoffset;	/* save register offset */
196*86d7f5d3SJohn Marino 	long	fregmask;	/* save floating point register mask */
197*86d7f5d3SJohn Marino 	long	fregoffset;	/* save floating point register offset */
198*86d7f5d3SJohn Marino 	long	frameoffset;	/* frame size */
199*86d7f5d3SJohn Marino 	short	framereg;	/* frame pointer register */
200*86d7f5d3SJohn Marino 	short	pcreg;		/* offset or reg of return pc */
201*86d7f5d3SJohn Marino 	long	irpss;		/* index into the runtime string table */
202*86d7f5d3SJohn Marino 	long	reserved;
203*86d7f5d3SJohn Marino 	struct exception_info *exception_info;/* pointer to exception array */
204*86d7f5d3SJohn Marino } RPDR, *pRPDR;
205*86d7f5d3SJohn Marino #define cbRPDR sizeof(RPDR)
206*86d7f5d3SJohn Marino #define rpdNil ((pRPDR) 0)
207*86d7f5d3SJohn Marino #endif
208*86d7f5d3SJohn Marino 
209*86d7f5d3SJohn Marino /*
210*86d7f5d3SJohn Marino  * Line Numbers
211*86d7f5d3SJohn Marino  *
212*86d7f5d3SJohn Marino  * Line Numbers are segregated from the normal symbols because they
213*86d7f5d3SJohn Marino  * are [1] smaller , [2] are of no interest to your
214*86d7f5d3SJohn Marino  * average loader, and [3] are never needed in the middle of normal
215*86d7f5d3SJohn Marino  * scanning and therefore slow things down.
216*86d7f5d3SJohn Marino  *
217*86d7f5d3SJohn Marino  * By definition, the first LINER for any given procedure will have
218*86d7f5d3SJohn Marino  * the first line of a procedure and represent the first address.
219*86d7f5d3SJohn Marino  */
220*86d7f5d3SJohn Marino 
221*86d7f5d3SJohn Marino typedef	long LINER, *pLINER;
222*86d7f5d3SJohn Marino #define lineNil ((pLINER)0)
223*86d7f5d3SJohn Marino #define cbLINER sizeof(LINER)
224*86d7f5d3SJohn Marino #define ilineNil	-1
225*86d7f5d3SJohn Marino 
226*86d7f5d3SJohn Marino 
227*86d7f5d3SJohn Marino 
228*86d7f5d3SJohn Marino /*
229*86d7f5d3SJohn Marino  * The Symbol Structure		(GFW, to those who Know!)
230*86d7f5d3SJohn Marino  */
231*86d7f5d3SJohn Marino 
232*86d7f5d3SJohn Marino typedef struct {
233*86d7f5d3SJohn Marino 	long	iss;		/* index into String Space of name */
234*86d7f5d3SJohn Marino 	bfd_vma	value;		/* value of symbol */
235*86d7f5d3SJohn Marino 	unsigned st : 6;	/* symbol type */
236*86d7f5d3SJohn Marino 	unsigned sc  : 5;	/* storage class - text, data, etc */
237*86d7f5d3SJohn Marino 	unsigned reserved : 1;	/* reserved */
238*86d7f5d3SJohn Marino 	unsigned index : 20;	/* index into sym/aux table */
239*86d7f5d3SJohn Marino 	} SYMR, *pSYMR;
240*86d7f5d3SJohn Marino #define symNil ((pSYMR)0)
241*86d7f5d3SJohn Marino #define cbSYMR sizeof(SYMR)
242*86d7f5d3SJohn Marino #define isymNil -1
243*86d7f5d3SJohn Marino #define indexNil 0xfffff
244*86d7f5d3SJohn Marino #define issNil -1
245*86d7f5d3SJohn Marino #define issNull 0
246*86d7f5d3SJohn Marino 
247*86d7f5d3SJohn Marino 
248*86d7f5d3SJohn Marino /* The following converts a memory resident string to an iss.
249*86d7f5d3SJohn Marino  * This hack is recognized in SbFIss, in sym.c of the debugger.
250*86d7f5d3SJohn Marino  */
251*86d7f5d3SJohn Marino #define IssFSb(sb) (0x80000000 | ((unsigned long)(sb)))
252*86d7f5d3SJohn Marino 
253*86d7f5d3SJohn Marino /* E X T E R N A L   S Y M B O L  R E C O R D
254*86d7f5d3SJohn Marino  *
255*86d7f5d3SJohn Marino  *	Same as the SYMR except it contains file context to determine where
256*86d7f5d3SJohn Marino  *	the index is.
257*86d7f5d3SJohn Marino  */
258*86d7f5d3SJohn Marino typedef struct ecoff_extr {
259*86d7f5d3SJohn Marino 	unsigned jmptbl:1;	/* symbol is a jump table entry for shlibs */
260*86d7f5d3SJohn Marino 	unsigned cobol_main:1;	/* symbol is a cobol main procedure */
261*86d7f5d3SJohn Marino 	unsigned weakext:1;	/* symbol is weak external */
262*86d7f5d3SJohn Marino 	unsigned reserved:13;	/* reserved for future use */
263*86d7f5d3SJohn Marino 	int	ifd;		/* where the iss and index fields point into */
264*86d7f5d3SJohn Marino 	SYMR	asym;		/* symbol for the external */
265*86d7f5d3SJohn Marino 	} EXTR, *pEXTR;
266*86d7f5d3SJohn Marino #define extNil ((pEXTR)0)
267*86d7f5d3SJohn Marino #define cbEXTR sizeof(EXTR)
268*86d7f5d3SJohn Marino 
269*86d7f5d3SJohn Marino 
270*86d7f5d3SJohn Marino /* A U X I L L A R Y   T Y P E	 I N F O R M A T I O N */
271*86d7f5d3SJohn Marino 
272*86d7f5d3SJohn Marino /*
273*86d7f5d3SJohn Marino  * Type Information Record
274*86d7f5d3SJohn Marino  */
275*86d7f5d3SJohn Marino typedef struct {
276*86d7f5d3SJohn Marino 	unsigned fBitfield : 1; /* set if bit width is specified */
277*86d7f5d3SJohn Marino 	unsigned continued : 1; /* indicates additional TQ info in next AUX */
278*86d7f5d3SJohn Marino 	unsigned bt  : 6;	/* basic type */
279*86d7f5d3SJohn Marino 	unsigned tq4 : 4;
280*86d7f5d3SJohn Marino 	unsigned tq5 : 4;
281*86d7f5d3SJohn Marino 	/* ---- 16 bit boundary ---- */
282*86d7f5d3SJohn Marino 	unsigned tq0 : 4;
283*86d7f5d3SJohn Marino 	unsigned tq1 : 4;	/* 6 type qualifiers - tqPtr, etc. */
284*86d7f5d3SJohn Marino 	unsigned tq2 : 4;
285*86d7f5d3SJohn Marino 	unsigned tq3 : 4;
286*86d7f5d3SJohn Marino 	} TIR, *pTIR;
287*86d7f5d3SJohn Marino #define cbTIR sizeof(TIR)
288*86d7f5d3SJohn Marino #define tiNil ((pTIR)0)
289*86d7f5d3SJohn Marino #define itqMax 6
290*86d7f5d3SJohn Marino 
291*86d7f5d3SJohn Marino /*
292*86d7f5d3SJohn Marino  * Relative symbol record
293*86d7f5d3SJohn Marino  *
294*86d7f5d3SJohn Marino  * If the rfd field is 4095, the index field indexes into the global symbol
295*86d7f5d3SJohn Marino  *	table.
296*86d7f5d3SJohn Marino  */
297*86d7f5d3SJohn Marino 
298*86d7f5d3SJohn Marino typedef struct {
299*86d7f5d3SJohn Marino 	unsigned	rfd : 12;    /* index into the file indirect table */
300*86d7f5d3SJohn Marino 	unsigned	index : 20; /* index int sym/aux/iss tables */
301*86d7f5d3SJohn Marino 	} RNDXR, *pRNDXR;
302*86d7f5d3SJohn Marino #define cbRNDXR sizeof(RNDXR)
303*86d7f5d3SJohn Marino #define rndxNil ((pRNDXR)0)
304*86d7f5d3SJohn Marino 
305*86d7f5d3SJohn Marino /* dense numbers or sometimes called block numbers are stored in this type,
306*86d7f5d3SJohn Marino  *	a rfd of 0xffffffff is an index into the global table.
307*86d7f5d3SJohn Marino  */
308*86d7f5d3SJohn Marino typedef struct {
309*86d7f5d3SJohn Marino 	unsigned long	rfd;    /* index into the file table */
310*86d7f5d3SJohn Marino 	unsigned long	index; 	/* index int sym/aux/iss tables */
311*86d7f5d3SJohn Marino 	} DNR, *pDNR;
312*86d7f5d3SJohn Marino #define cbDNR sizeof(DNR)
313*86d7f5d3SJohn Marino #define dnNil ((pDNR)0)
314*86d7f5d3SJohn Marino 
315*86d7f5d3SJohn Marino 
316*86d7f5d3SJohn Marino 
317*86d7f5d3SJohn Marino /*
318*86d7f5d3SJohn Marino  * Auxillary information occurs only if needed.
319*86d7f5d3SJohn Marino  * It ALWAYS occurs in this order when present.
320*86d7f5d3SJohn Marino 
321*86d7f5d3SJohn Marino 	    isymMac		used by stProc only
322*86d7f5d3SJohn Marino 	    TIR			type info
323*86d7f5d3SJohn Marino 	    TIR			additional TQ info (if first TIR was not enough)
324*86d7f5d3SJohn Marino 	    rndx		if (bt == btStruct,btUnion,btEnum,btSet,btRange,
325*86d7f5d3SJohn Marino 				    btTypedef):
326*86d7f5d3SJohn Marino 				    rsym.index == iaux for btSet or btRange
327*86d7f5d3SJohn Marino 				    else rsym.index == isym
328*86d7f5d3SJohn Marino 	    dimLow		btRange, btSet
329*86d7f5d3SJohn Marino 	    dimMac		btRange, btSet
330*86d7f5d3SJohn Marino 	    rndx0		As many as there are tq arrays
331*86d7f5d3SJohn Marino 	    dimLow0
332*86d7f5d3SJohn Marino 	    dimHigh0
333*86d7f5d3SJohn Marino 	    ...
334*86d7f5d3SJohn Marino 	    rndxMax-1
335*86d7f5d3SJohn Marino 	    dimLowMax-1
336*86d7f5d3SJohn Marino 	    dimHighMax-1
337*86d7f5d3SJohn Marino 	    width in bits	if (bit field), width in bits.
338*86d7f5d3SJohn Marino  */
339*86d7f5d3SJohn Marino #define cAuxMax (6 + (idimMax*3))
340*86d7f5d3SJohn Marino 
341*86d7f5d3SJohn Marino /* a union of all possible info in the AUX universe */
342*86d7f5d3SJohn Marino typedef union {
343*86d7f5d3SJohn Marino 	TIR	ti;		/* type information record */
344*86d7f5d3SJohn Marino 	RNDXR	rndx;		/* relative index into symbol table */
345*86d7f5d3SJohn Marino 	long	dnLow;		/* low dimension */
346*86d7f5d3SJohn Marino 	long	dnHigh;		/* high dimension */
347*86d7f5d3SJohn Marino 	long	isym;		/* symbol table index (end of proc) */
348*86d7f5d3SJohn Marino 	long	iss;		/* index into string space (not used) */
349*86d7f5d3SJohn Marino 	long	width;		/* width for non-default sized struc fields */
350*86d7f5d3SJohn Marino 	long	count;		/* count of ranges for variant arm */
351*86d7f5d3SJohn Marino 	} AUXU, *pAUXU;
352*86d7f5d3SJohn Marino #define cbAUXU sizeof(AUXU)
353*86d7f5d3SJohn Marino #define auxNil ((pAUXU)0)
354*86d7f5d3SJohn Marino #define iauxNil -1
355*86d7f5d3SJohn Marino 
356*86d7f5d3SJohn Marino 
357*86d7f5d3SJohn Marino /*
358*86d7f5d3SJohn Marino  * Optimization symbols
359*86d7f5d3SJohn Marino  *
360*86d7f5d3SJohn Marino  * Optimization symbols contain some overlap information with the normal
361*86d7f5d3SJohn Marino  * symbol table. In particular, the proc information
362*86d7f5d3SJohn Marino  * is somewhat redundant but necessary to easily find the other information
363*86d7f5d3SJohn Marino  * present.
364*86d7f5d3SJohn Marino  *
365*86d7f5d3SJohn Marino  * All of the offsets are relative to the beginning of the last otProc
366*86d7f5d3SJohn Marino  */
367*86d7f5d3SJohn Marino 
368*86d7f5d3SJohn Marino typedef struct {
369*86d7f5d3SJohn Marino 	unsigned ot: 8;		/* optimization type */
370*86d7f5d3SJohn Marino 	unsigned value: 24;	/* address where we are moving it to */
371*86d7f5d3SJohn Marino 	RNDXR	rndx;		/* points to a symbol or opt entry */
372*86d7f5d3SJohn Marino 	unsigned long	offset;	/* relative offset this occured */
373*86d7f5d3SJohn Marino 	} OPTR, *pOPTR;
374*86d7f5d3SJohn Marino #define optNil	((pOPTR) 0)
375*86d7f5d3SJohn Marino #define cbOPTR sizeof(OPTR)
376*86d7f5d3SJohn Marino #define ioptNil -1
377*86d7f5d3SJohn Marino 
378*86d7f5d3SJohn Marino /*
379*86d7f5d3SJohn Marino  * File Indirect
380*86d7f5d3SJohn Marino  *
381*86d7f5d3SJohn Marino  * When a symbol is referenced across files the following procedure is used:
382*86d7f5d3SJohn Marino  *	1) use the file index to get the File indirect entry.
383*86d7f5d3SJohn Marino  *	2) use the file indirect entry to get the File descriptor.
384*86d7f5d3SJohn Marino  *	3) add the sym index to the base of that file's sym table
385*86d7f5d3SJohn Marino  *
386*86d7f5d3SJohn Marino  */
387*86d7f5d3SJohn Marino 
388*86d7f5d3SJohn Marino typedef long RFDT, *pRFDT;
389*86d7f5d3SJohn Marino #define cbRFDT sizeof(RFDT)
390*86d7f5d3SJohn Marino #define rfdNil	-1
391*86d7f5d3SJohn Marino 
392*86d7f5d3SJohn Marino /*
393*86d7f5d3SJohn Marino  * The file indirect table in the mips loader is known as an array of FITs.
394*86d7f5d3SJohn Marino  * This is done to keep the code in the loader readable in the area where
395*86d7f5d3SJohn Marino  * these tables are merged.  Note this is only a name change.
396*86d7f5d3SJohn Marino  */
397*86d7f5d3SJohn Marino typedef long FIT, *pFIT;
398*86d7f5d3SJohn Marino #define cbFIT	sizeof(FIT)
399*86d7f5d3SJohn Marino #define ifiNil	-1
400*86d7f5d3SJohn Marino #define fiNil	((pFIT) 0)
401*86d7f5d3SJohn Marino 
402*86d7f5d3SJohn Marino #ifdef _LANGUAGE_PASCAL
403*86d7f5d3SJohn Marino #define ifdNil -1
404*86d7f5d3SJohn Marino #define ilnNil -1
405*86d7f5d3SJohn Marino #define ipdNil -1
406*86d7f5d3SJohn Marino #define ilineNil -1
407*86d7f5d3SJohn Marino #define isymNil -1
408*86d7f5d3SJohn Marino #define indexNil 16#fffff
409*86d7f5d3SJohn Marino #define issNil -1
410*86d7f5d3SJohn Marino #define issNull 0
411*86d7f5d3SJohn Marino #define itqMax 6
412*86d7f5d3SJohn Marino #define iauxNil -1
413*86d7f5d3SJohn Marino #define ioptNil -1
414*86d7f5d3SJohn Marino #define rfdNil -1
415*86d7f5d3SJohn Marino #define ifiNil -1
416*86d7f5d3SJohn Marino #endif	/* _LANGUAGE_PASCAL */
417*86d7f5d3SJohn Marino 
418*86d7f5d3SJohn Marino 
419*86d7f5d3SJohn Marino /* Dense numbers
420*86d7f5d3SJohn Marino  *
421*86d7f5d3SJohn Marino  * Rather than use file index, symbol index pairs to represent symbols
422*86d7f5d3SJohn Marino  *	and globals, we use dense number so that they can be easily embeded
423*86d7f5d3SJohn Marino  *	in intermediate code and the programs that process them can
424*86d7f5d3SJohn Marino  *	use direct access tabls instead of hash table (which would be
425*86d7f5d3SJohn Marino  *	necesary otherwise because of the sparse name space caused by
426*86d7f5d3SJohn Marino  *	file index, symbol index pairs. Dense number are represented
427*86d7f5d3SJohn Marino  *	by RNDXRs.
428*86d7f5d3SJohn Marino  */
429*86d7f5d3SJohn Marino 
430*86d7f5d3SJohn Marino /*
431*86d7f5d3SJohn Marino  * The following table defines the meaning of each SYM field as
432*86d7f5d3SJohn Marino  * a function of the "st". (scD/B == scData OR scBss)
433*86d7f5d3SJohn Marino  *
434*86d7f5d3SJohn Marino  * Note: the value "isymMac" is used by symbols that have the concept
435*86d7f5d3SJohn Marino  * of enclosing a block of related information.	 This value is the
436*86d7f5d3SJohn Marino  * isym of the first symbol AFTER the end associated with the primary
437*86d7f5d3SJohn Marino  * symbol. For example if a procedure was at isym==90 and had an
438*86d7f5d3SJohn Marino  * isymMac==155, the associated end would be at isym==154, and the
439*86d7f5d3SJohn Marino  * symbol at 155 would probably (although not necessarily) be the
440*86d7f5d3SJohn Marino  * symbol for the next procedure.  This allows rapid skipping over
441*86d7f5d3SJohn Marino  * internal information of various sorts. "stEnd"s ALWAYS have the
442*86d7f5d3SJohn Marino  * isym of the primary symbol that started the block.
443*86d7f5d3SJohn Marino  *
444*86d7f5d3SJohn Marino 
445*86d7f5d3SJohn Marino ST		SC	VALUE		INDEX
446*86d7f5d3SJohn Marino --------	------	--------	------
447*86d7f5d3SJohn Marino stFile		scText	address		isymMac
448*86d7f5d3SJohn Marino stLabel		scText	address		---
449*86d7f5d3SJohn Marino stGlobal	scD/B	address		iaux
450*86d7f5d3SJohn Marino stStatic	scD/B	address		iaux
451*86d7f5d3SJohn Marino stParam		scAbs	offset		iaux
452*86d7f5d3SJohn Marino stLocal		scAbs	offset		iaux
453*86d7f5d3SJohn Marino stProc		scText	address		iaux	(isymMac is first AUX)
454*86d7f5d3SJohn Marino stStaticProc	scText	address		iaux	(isymMac is first AUX)
455*86d7f5d3SJohn Marino 
456*86d7f5d3SJohn Marino stMember	scNil	ordinal		---	(if member of enum)
457*86d7f5d3SJohn Marino 	(mipsread thinks the case below has a bit, not byte, offset.)
458*86d7f5d3SJohn Marino stMember	scNil	byte offset	iaux	(if member of struct/union)
459*86d7f5d3SJohn Marino stMember	scBits	bit offset	iaux	(bit field spec)
460*86d7f5d3SJohn Marino 
461*86d7f5d3SJohn Marino stBlock		scText	address		isymMac (text block)
462*86d7f5d3SJohn Marino 	(the code seems to think that rather than scNil, we see scInfo for
463*86d7f5d3SJohn Marino 	 the two cases below.)
464*86d7f5d3SJohn Marino stBlock		scNil	cb		isymMac (struct/union member define)
465*86d7f5d3SJohn Marino stBlock		scNil	cMembers	isymMac (enum member define)
466*86d7f5d3SJohn Marino 
467*86d7f5d3SJohn Marino 	(New types added by SGI to simplify things:)
468*86d7f5d3SJohn Marino stStruct	scInfo	cb		isymMac (struct type define)
469*86d7f5d3SJohn Marino stUnion		scInfo	cb		isymMac (union  type define)
470*86d7f5d3SJohn Marino stEnum		scInfo	cMembers	isymMac (enum   type define)
471*86d7f5d3SJohn Marino 
472*86d7f5d3SJohn Marino stEnd		scText	address		isymStart
473*86d7f5d3SJohn Marino stEnd		scNil	-------		isymStart (struct/union/enum)
474*86d7f5d3SJohn Marino 
475*86d7f5d3SJohn Marino stTypedef	scNil	-------		iaux
476*86d7f5d3SJohn Marino stRegReloc	sc???	value		old register number
477*86d7f5d3SJohn Marino stForward	sc???	new address	isym to original symbol
478*86d7f5d3SJohn Marino 
479*86d7f5d3SJohn Marino stConstant	scInfo	value		--- (scalar)
480*86d7f5d3SJohn Marino stConstant	scInfo	iss		--- (complex, e.g. string)
481*86d7f5d3SJohn Marino 
482*86d7f5d3SJohn Marino  *
483*86d7f5d3SJohn Marino  */
484*86d7f5d3SJohn Marino #endif
485