|
|
1.1 ! root 1: /* @(#)syms.h 2.2 */ ! 2: /* Storage Classes are defined in storclass.h */ ! 3: #include "storclass.h" ! 4: ! 5: /* Number of characters in a symbol name */ ! 6: #define SYMNMLEN 8 ! 7: /* Number of characters in a file name */ ! 8: #define FILNMLEN 14 ! 9: /* Number of array dimensions in auxiliary entry */ ! 10: #define DIMNUM 4 ! 11: ! 12: ! 13: struct syment ! 14: { ! 15: char n_name[SYMNMLEN]; ! 16: #ifndef pdp11 ! 17: unsigned ! 18: #endif ! 19: long n_value; /* value of symbol */ ! 20: short n_scnum; /* section number */ ! 21: unsigned short n_type; /* type and derived type */ ! 22: char n_sclass; /* storage class */ ! 23: char n_numaux; /* number of auxiliary entries */ ! 24: }; ! 25: ! 26: /* ! 27: Relocatable symbols have a section number of the ! 28: section in which they are defined. Otherwise, section ! 29: numbers have the following meanings: ! 30: */ ! 31: /* undefined symbol */ ! 32: #define N_UNDEF 0 ! 33: /* value of symbol is absolute */ ! 34: #define N_ABS -1 ! 35: /* special debugging symbol -- value of symbol is meaningless */ ! 36: #define N_DEBUG -2 ! 37: /* indicates symbol needs transfer vector (preload) */ ! 38: #define N_TV (unsigned short)-3 ! 39: ! 40: /* indicates symbol needs transfer vector (postload) */ ! 41: ! 42: #define P_TV (unsigned short)-4 ! 43: ! 44: /* ! 45: The fundamental type of a symbol packed into the low ! 46: 4 bits of the word. ! 47: */ ! 48: ! 49: #define _EF ".ef" ! 50: ! 51: #define T_NULL 0 ! 52: #define T_ARG 1 /* function argument (only used by compiler) */ ! 53: #define T_CHAR 2 /* character */ ! 54: #define T_SHORT 3 /* short integer */ ! 55: #define T_INT 4 /* integer */ ! 56: #define T_LONG 5 /* long integer */ ! 57: #define T_FLOAT 6 /* floating point */ ! 58: #define T_DOUBLE 7 /* double word */ ! 59: #define T_STRUCT 8 /* structure */ ! 60: #define T_UNION 9 /* union */ ! 61: #define T_ENUM 10 /* enumeration */ ! 62: #define T_MOE 11 /* member of enumeration */ ! 63: #define T_UCHAR 12 /* unsigned character */ ! 64: #define T_USHORT 13 /* unsigned short */ ! 65: #define T_UINT 14 /* unsigned integer */ ! 66: #define T_ULONG 15 /* unsigned long */ ! 67: ! 68: /* ! 69: * derived types are: ! 70: */ ! 71: ! 72: #define DT_NON 0 /* no derived type */ ! 73: #define DT_PTR 1 /* pointer */ ! 74: #define DT_FCN 2 /* function */ ! 75: #define DT_ARY 3 /* array */ ! 76: ! 77: /* ! 78: * type packing constants ! 79: */ ! 80: ! 81: #define N_BTMASK 017 ! 82: #define N_TMASK 060 ! 83: #define N_TMASK1 0300 ! 84: #define N_TMASK2 0360 ! 85: #define N_BTSHFT 4 ! 86: #define N_TSHIFT 2 ! 87: ! 88: /* ! 89: * MACROS ! 90: */ ! 91: ! 92: /* Basic Type of x */ ! 93: ! 94: #define BTYPE(x) ((x) & N_BTMASK) ! 95: ! 96: /* Is x a pointer ? */ ! 97: ! 98: #define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT)) ! 99: ! 100: /* Is x a function ? */ ! 101: ! 102: #define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT)) ! 103: ! 104: /* Is x an array ? */ ! 105: ! 106: #define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT)) ! 107: ! 108: /* Is x a structure, union, or enumeration TAG? */ ! 109: ! 110: #define ISTAG(x) ((x)==C_STRTAG || (x)==C_UNTAG || (x)==C_ENTAG) ! 111: ! 112: #define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(DT_PTR<<N_BTSHFT)|(x&N_BTMASK)) ! 113: ! 114: #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK)) ! 115: ! 116: /* ! 117: * AUXILIARY ENTRY FORMAT ! 118: */ ! 119: ! 120: union auxent ! 121: { ! 122: struct ! 123: { ! 124: long x_tagndx; /* str, un, or enum tag indx */ ! 125: union ! 126: { ! 127: struct ! 128: { ! 129: unsigned short x_lnno; /* declaration line number */ ! 130: unsigned short x_size; /* str, union, array size */ ! 131: } x_lnsz; ! 132: long x_fsize; /* size of function */ ! 133: } x_misc; ! 134: union ! 135: { ! 136: struct /* if ISFCN, tag, or .bb */ ! 137: { ! 138: long x_lnnoptr; /* ptr to fcn line # */ ! 139: long x_endndx; /* entry ndx past block end */ ! 140: } x_fcn; ! 141: struct /* if ISARY, up to 4 dimen. */ ! 142: { ! 143: unsigned short x_dimen[DIMNUM]; ! 144: } x_ary; ! 145: } x_fcnary; ! 146: unsigned short x_tvndx; /* tv index */ ! 147: } x_sym; ! 148: struct ! 149: { ! 150: char x_fname[FILNMLEN]; ! 151: } x_file; ! 152: struct ! 153: { ! 154: long x_scnlen; /* section length */ ! 155: unsigned short x_nreloc; /* number of relocation entries */ ! 156: unsigned short x_nlinno; /* number of line numbers */ ! 157: } x_scn; ! 158: ! 159: struct ! 160: { ! 161: unsigned short x_tvlen; /* length of .tv */ ! 162: unsigned short x_tvran[2]; /* tv range */ ! 163: short x_tvfill; /* tv fill value */ ! 164: } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ ! 165: }; ! 166: ! 167: #define SYMENT struct syment ! 168: #define SYMESZ 18 /* sizeof(SYMENT) */ ! 169: ! 170: #define AUXENT union auxent ! 171: #define AUXESZ 18 /* sizeof(AUXENT) */ ! 172: ! 173: /* Defines for "special" symbols */ ! 174: ! 175: #define _ETEXT "_etext" ! 176: #define _EDATA "_edata" ! 177: #define _END "_end" ! 178: ! 179: #define _START "_start"
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.