Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

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