4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
22 /* Copyright (c) 1988 AT&T */
23 /* All Rights Reserved */
29 #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 2.8 */
31 /* Storage Classes are defined in storclass.h */
32 #include <storclass.h>
38 /* Number of characters in a symbol name */
40 /* Number of characters in a file name */
42 /* Number of array dimensions in auxiliary entry */
49 char _n_name
[SYMNMLEN
]; /* old COFF version */
52 long _n_zeroes
; /* new == 0 */
53 long _n_offset
; /* offset into string table */
55 char *_n_nptr
[2]; /* allows for overlaying */
57 unsigned long n_value
; /* value of symbol */
58 short n_scnum
; /* section number */
59 unsigned short n_type
; /* type and derived type */
60 char n_sclass
; /* storage class */
61 char n_numaux
; /* number of aux. entries */
64 #define n_name _n._n_name
65 #define n_nptr _n._n_nptr[1]
66 #define n_zeroes _n._n_n._n_zeroes
67 #define n_offset _n._n_n._n_offset
70 * Relocatable symbols have a section number of the
71 * section in which they are defined. Otherwise, section
72 * numbers have the following meanings:
74 /* undefined symbol */
76 /* value of symbol is absolute */
78 /* special debugging symbol -- value of symbol is meaningless */
80 /* indicates symbol needs transfer vector (preload) */
81 #define N_TV (unsigned short)-3
83 /* indicates symbol needs transfer vector (postload) */
85 #define P_TV (unsigned short)-4
88 * The fundamental type of a symbol packed into the low
95 #define T_ARG 1 /* function argument (only used by compiler) */
96 #define T_CHAR 2 /* character */
97 #define T_SHORT 3 /* short integer */
98 #define T_INT 4 /* integer */
99 #define T_LONG 5 /* long integer */
100 #define T_FLOAT 6 /* floating point */
101 #define T_DOUBLE 7 /* double word */
102 #define T_STRUCT 8 /* structure */
103 #define T_UNION 9 /* union */
104 #define T_ENUM 10 /* enumeration */
105 #define T_MOE 11 /* member of enumeration */
106 #define T_UCHAR 12 /* unsigned character */
107 #define T_USHORT 13 /* unsigned short */
108 #define T_UINT 14 /* unsigned integer */
109 #define T_ULONG 15 /* unsigned long */
115 #define DT_NON 0 /* no derived type */
116 #define DT_PTR 1 /* pointer */
117 #define DT_FCN 2 /* function */
118 #define DT_ARY 3 /* array */
121 * type packing constants
126 #define N_TMASK1 0300
127 #define N_TMASK2 0360
135 /* Basic Type of x */
137 #define BTYPE(x) ((x) & N_BTMASK)
139 /* Is x a pointer ? */
141 #define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
143 /* Is x a function ? */
145 #define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
147 /* Is x an array ? */
149 #define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
151 /* Is x a structure, union, or enumeration TAG? */
153 #define ISTAG(x) ((x) == C_STRTAG || (x) == C_UNTAG || (x) == C_ENTAG)
155 #define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(DT_PTR<<N_BTSHFT)|(x&N_BTMASK))
157 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
160 * AUXILIARY ENTRY FORMAT
167 long x_tagndx
; /* str, un, or enum tag indx */
172 unsigned short x_lnno
; /* declaration line */
174 unsigned short x_size
; /* str, union, array */
177 long x_fsize
; /* size of function */
181 struct /* if ISFCN, tag, or .bb */
183 long x_lnnoptr
; /* ptr to fcn line # */
184 long x_endndx
; /* entry ndx past */
187 struct /* if ISARY, up to 4 dimen. */
189 unsigned short x_dimen
[DIMNUM
];
192 unsigned short x_tvndx
; /* tv index */
196 char x_fname
[FILNMLEN
];
200 long x_scnlen
; /* section length */
201 unsigned short x_nreloc
; /* number of reloc entries */
202 unsigned short x_nlinno
; /* number of line numbers */
207 long x_tvfill
; /* tv fill value */
208 unsigned short x_tvlen
; /* length of .tv */
209 unsigned short x_tvran
[2]; /* tv range */
210 } x_tv
; /* info about .tv section (in auxent of symbol .tv)) */
213 #define SYMENT struct syment
214 #define SYMESZ 18 /* sizeof(SYMENT) */
216 #define AUXENT union auxent
217 #define AUXESZ 18 /* sizeof(AUXENT) */
219 /* Defines for "special" symbols */
221 #define _ETEXT "etext"
222 #define _EDATA "edata"
224 #define _START "_start"