1 /* @(#)stab.h 1.11 92/05/11 SMI */ 2 /* $Id: stab.h,v 1.2 2005/10/11 08:44:56 tobias-weber Exp $ */ 3 /* 4 * Copyright (c) 1990 by Sun Microsystems, Inc. 5 */ 6 7 /* This file gives definitions supplementing <a.out.h> 8 * for permanent symbol table entries. 9 * These must have one of the N_STAB bits on, 10 * and are subject to relocation according to the masks in <a.out.h>. */ 11 12 #ifndef _STAB_H 13 #define _STAB_H 14 15 16 #if !defined(_a_out_h) && !defined(_A_OUT_H) 17 /* this file contains fragments of a.out.h and stab.h relevant to 18 * support of stabX processing within ELF files - see the 19 * Format of a symbol table entry */ 20 struct nlist { 21 union { 22 char *n_name; /* for use when in-core */ 23 long n_strx; /* index into file string table */ 24 } n_un; 25 unsigned char n_type; /* type flag (N_TEXT,..) */ 26 char n_other; /* unused */ 27 short n_desc; /* see <stab.h> */ 28 unsigned long n_value; /* value of symbol (or sdb offset) */ 29 }; 30 31 /* Simple values for n_type. */ 32 #define N_UNDF 0x0 /* undefined */ 33 #define N_ABS 0x2 /* absolute */ 34 #define N_TEXT 0x4 /* text */ 35 #define N_DATA 0x6 /* data */ 36 #define N_BSS 0x8 /* bss */ 37 #define N_COMM 0x12 /* common (internal to ld) */ 38 #define N_FN 0x1f /* file name symbol */ 39 40 #define N_EXT 01 /* external bit, or'ed in */ 41 #define N_TYPE 0x1e /* mask for all the type bits */ 42 43 #endif 44 45 /* for symbolic debugger, sdb(1): */ 46 #define N_GSYM 0x20 /* global symbol: name,,0,type,0 */ 47 #define N_FNAME 0x22 /* procedure name (f77 kludge): name,,0 */ 48 #define N_FUN 0x24 /* procedure: name,,0,linenumber,address */ 49 #define N_STSYM 0x26 /* static symbol: name,,0,type,address */ 50 #define N_LCSYM 0x28 /* .lcomm symbol: name,,0,type,address */ 51 #define N_MAIN 0x2a /* name of main routine : name,,0,0,0 */ 52 #define N_ROSYM 0x2c /* ro_data objects */ 53 #define N_OBJ 0x38 /* object file path or name */ 54 #define N_OPT 0x3c /* compiler options */ 55 #define N_RSYM 0x40 /* register sym: name,,0,type,register */ 56 #define N_SLINE 0x44 /* src line: 0,,0,linenumber,address */ 57 #define N_FLINE 0x4c /* function start.end */ 58 #define N_SSYM 0x60 /* structure elt: name,,0,type,struct_offset */ 59 #define N_ENDM 0x62 /* last stab emitted for module */ 60 #define N_SO 0x64 /* source file name: name,,0,0,address */ 61 #define N_LSYM 0x80 /* local sym: name,,0,type,offset */ 62 #define N_BINCL 0x82 /* header file: name,,0,0,0 */ 63 #define N_SOL 0x84 /* #included file name: name,,0,0,address */ 64 #define N_PSYM 0xa0 /* parameter: name,,0,type,offset */ 65 #define N_EINCL 0xa2 /* end of include file */ 66 #define N_ENTRY 0xa4 /* alternate entry: name,linenumber,address */ 67 #define N_LBRAC 0xc0 /* left bracket: 0,,0,nesting level,address */ 68 #define N_EXCL 0xc2 /* excluded include file */ 69 #define N_RBRAC 0xe0 /* right bracket: 0,,0,nesting level,address */ 70 #define N_BCOMM 0xe2 /* begin common: name,, */ 71 #define N_ECOMM 0xe4 /* end common: name,, */ 72 #define N_ECOML 0xe8 /* end common (local name): ,,address */ 73 #define N_LENG 0xfe /* second stab entry with length information */ 74 75 /* for the berkeley pascal compiler, pc(1): */ 76 #define N_PC 0x30 /* global pascal symbol: name,,0,subtype,line */ 77 #define N_WITH 0xea /* pascal with statement: type,,0,0,offset */ 78 79 /* for code browser only */ 80 #define N_BROWS 0x48 /* path to associated .cb file */ 81 82 /* Optional langauge designations for N_SO */ 83 #define N_SO_AS 1 /* Assembler */ 84 #define N_SO_C 2 /* C */ 85 #define N_SO_ANSI_C 3 /* ANSI C */ 86 #define N_SO_CC 4 /* C++ */ 87 #define N_SO_FORTRAN 5 /* Fortran 77 */ 88 #define N_SO_PASCAL 6 /* Pascal */ 89 90 /* Floating point type values */ 91 #define NF_NONE 0 /* Undefined type */ 92 #define NF_SINGLE 1 /* IEEE 32 bit float */ 93 #define NF_DOUBLE 2 /* IEEE 64 bit float */ 94 #define NF_COMPLEX 3 /* Fortran complex */ 95 #define NF_COMPLEX16 4 /* Fortran double complex */ 96 #define NF_COMPLEX32 5 /* Fortran complex*16 */ 97 #define NF_LDOUBLE 6 /* Long double */ 98 99 #endif 100