source: trunk/src/binutils/include/coff/sym.h@ 1722

Last change on this file since 1722 was 10, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 16.4 KB
Line 
1/* Declarations of internal format of MIPS ECOFF symbols.
2 Originally contributed by MIPS Computer Systems and Third Eye Software.
3 Changes contributed by Cygnus Support are in the public domain.
4
5 This file is just aggregated with the files that make up the GNU
6 release; it is not considered part of GAS, GDB, or other GNU
7 programs. */
8
9/*
10 * |-----------------------------------------------------------|
11 * | Copyright (c) 1992, 1991, 1990 MIPS Computer Systems, Inc.|
12 * | MIPS Computer Systems, Inc. grants reproduction and use |
13 * | rights to all parties, PROVIDED that this comment is |
14 * | maintained in the copy. |
15 * |-----------------------------------------------------------|
16 */
17#ifndef _SYM_H
18#define _SYM_H
19
20/* (C) Copyright 1984 by Third Eye Software, Inc.
21 *
22 * Third Eye Software, Inc. grants reproduction and use rights to
23 * all parties, PROVIDED that this comment is maintained in the copy.
24 *
25 * Third Eye makes no claims about the applicability of this
26 * symbol table to a particular use.
27 */
28
29/*
30 * This file contains the definition of the Third Eye Symbol Table.
31 *
32 * Symbols are assumed to be in 'encounter order' - i.e. the order that
33 * the things they represent were encountered by the compiler/assembler/loader.
34 * EXCEPT for globals! These are assumed to be bunched together,
35 * probably right after the last 'normal' symbol. Globals ARE sorted
36 * in ascending order.
37 *
38 * -----------------------------------------------------------------------
39 * A brief word about Third Eye naming/use conventions:
40 *
41 * All arrays and index's are 0 based.
42 * All "ifooMax" values are the highest legal value PLUS ONE. This makes
43 * them good for allocating arrays, etc. All checks are "ifoo < ifooMax".
44 *
45 * "isym" Index into the SYMbol table.
46 * "ipd" Index into the Procedure Descriptor array.
47 * "ifd" Index into the File Descriptor array.
48 * "iss" Index into String Space.
49 * "cb" Count of Bytes.
50 * "rgPd" array whose domain is "0..ipdMax-1" and RanGe is PDR.
51 * "rgFd" array whose domain is "0..ifdMax-1" and RanGe is FDR.
52 */
53
54
55/*
56 * Symbolic Header (HDR) structure.
57 * As long as all the pointers are set correctly,
58 * we don't care WHAT order the various sections come out in!
59 *
60 * A file produced solely for the use of CDB will probably NOT have
61 * any instructions or data areas in it, as these are available
62 * in the original.
63 */
64
65typedef struct {
66 short magic; /* to verify validity of the table */
67 short vstamp; /* version stamp */
68 long ilineMax; /* number of line number entries */
69 bfd_vma cbLine; /* number of bytes for line number entries */
70 bfd_vma cbLineOffset; /* offset to start of line number entries*/
71 long idnMax; /* max index into dense number table */
72 bfd_vma cbDnOffset; /* offset to start dense number table */
73 long ipdMax; /* number of procedures */
74 bfd_vma cbPdOffset; /* offset to procedure descriptor table */
75 long isymMax; /* number of local symbols */
76 bfd_vma cbSymOffset; /* offset to start of local symbols*/
77 long ioptMax; /* max index into optimization symbol entries */
78 bfd_vma cbOptOffset; /* offset to optimization symbol entries */
79 long iauxMax; /* number of auxillary symbol entries */
80 bfd_vma cbAuxOffset; /* offset to start of auxillary symbol entries*/
81 long issMax; /* max index into local strings */
82 bfd_vma cbSsOffset; /* offset to start of local strings */
83 long issExtMax; /* max index into external strings */
84 bfd_vma cbSsExtOffset; /* offset to start of external strings */
85 long ifdMax; /* number of file descriptor entries */
86 bfd_vma cbFdOffset; /* offset to file descriptor table */
87 long crfd; /* number of relative file descriptor entries */
88 bfd_vma cbRfdOffset; /* offset to relative file descriptor table */
89 long iextMax; /* max index into external symbols */
90 bfd_vma cbExtOffset; /* offset to start of external symbol entries*/
91 /* If you add machine dependent fields, add them here */
92 } HDRR, *pHDRR;
93#define cbHDRR sizeof(HDRR)
94#define hdrNil ((pHDRR)0)
95
96/*
97 * The FDR and PDR structures speed mapping of address <-> name.
98 * They are sorted in ascending memory order and are kept in
99 * memory by CDB at runtime.
100 */
101
102/*
103 * File Descriptor
104 *
105 * There is one of these for EVERY FILE, whether compiled with
106 * full debugging symbols or not. The name of a file should be
107 * the path name given to the compiler. This allows the user
108 * to simply specify the names of the directories where the COMPILES
109 * were done, and we will be able to find their files.
110 * A field whose comment starts with "R - " indicates that it will be
111 * setup at runtime.
112 */
113typedef struct fdr {
114 bfd_vma adr; /* memory address of beginning of file */
115 long rss; /* file name (of source, if known) */
116 long issBase; /* file's string space */
117 bfd_vma cbSs; /* number of bytes in the ss */
118 long isymBase; /* beginning of symbols */
119 long csym; /* count file's of symbols */
120 long ilineBase; /* file's line symbols */
121 long cline; /* count of file's line symbols */
122 long ioptBase; /* file's optimization entries */
123 long copt; /* count of file's optimization entries */
124 unsigned short ipdFirst;/* start of procedures for this file */
125 short cpd; /* count of procedures for this file */
126 long iauxBase; /* file's auxiliary entries */
127 long caux; /* count of file's auxiliary entries */
128 long rfdBase; /* index into the file indirect table */
129 long crfd; /* count file indirect entries */
130 unsigned lang: 5; /* language for this file */
131 unsigned fMerge : 1; /* whether this file can be merged */
132 unsigned fReadin : 1; /* true if it was read in (not just created) */
133 unsigned fBigendian : 1;/* if set, was compiled on big endian machine */
134 /* aux's will be in compile host's sex */
135 unsigned glevel : 2; /* level this file was compiled with */
136 unsigned reserved : 22; /* reserved for future use */
137 bfd_vma cbLineOffset; /* byte offset from header for this file ln's */
138 bfd_vma cbLine; /* size of lines for this file */
139 } FDR, *pFDR;
140#define cbFDR sizeof(FDR)
141#define fdNil ((pFDR)0)
142#define ifdNil -1
143#define ifdTemp 0
144#define ilnNil -1
145
146
147/*
148 * Procedure Descriptor
149 *
150 * There is one of these for EVERY TEXT LABEL.
151 * If a procedure is in a file with full symbols, then isym
152 * will point to the PROC symbols, else it will point to the
153 * global symbol for the label.
154 */
155
156typedef struct pdr {
157 bfd_vma adr; /* memory address of start of procedure */