syms.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#ifndef _SYMS_H
#define _SYMS_H
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 2.8 */
/* Storage Classes are defined in storclass.h */
#include <storclass.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Number of characters in a symbol name */
#define SYMNMLEN 8
/* Number of characters in a file name */
#define FILNMLEN 14
/* Number of array dimensions in auxiliary entry */
#define DIMNUM 4
struct syment
{
union
{
struct
{
long _n_zeroes; /* new == 0 */
long _n_offset; /* offset into string table */
} _n_n;
} _n;
unsigned long n_value; /* value of symbol */
short n_scnum; /* section number */
unsigned short n_type; /* type and derived type */
char n_sclass; /* storage class */
char n_numaux; /* number of aux. entries */
};
/*
* Relocatable symbols have a section number of the
* section in which they are defined. Otherwise, section
* numbers have the following meanings:
*/
/* undefined symbol */
#define N_UNDEF 0
/* value of symbol is absolute */
#define N_ABS -1
/* special debugging symbol -- value of symbol is meaningless */
#define N_DEBUG -2
/* indicates symbol needs transfer vector (preload) */
#define N_TV (unsigned short)-3
/* indicates symbol needs transfer vector (postload) */
#define P_TV (unsigned short)-4
/*
* The fundamental type of a symbol packed into the low
* 4 bits of the word.
*/
#define _EF ".ef"
#define T_NULL 0
/*
* derived types are:
*/
#define DT_NON 0 /* no derived type */
/*
* type packing constants
*/
#define N_BTMASK 017
#define N_TMASK 060
#define N_TMASK1 0300
#define N_TMASK2 0360
#define N_BTSHFT 4
#define N_TSHIFT 2
/*
* MACROS
*/
/* Basic Type of x */
/* Is x a pointer ? */
/* Is x a function ? */
/* Is x an array ? */
/* Is x a structure, union, or enumeration TAG? */
/*
* AUXILIARY ENTRY FORMAT
*/
union auxent
{
struct
{
long x_tagndx; /* str, un, or enum tag indx */
union
{
struct
{
unsigned short x_lnno; /* declaration line */
/* number */
unsigned short x_size; /* str, union, array */
/* size */
} x_lnsz;
long x_fsize; /* size of function */
} x_misc;
union
{
struct /* if ISFCN, tag, or .bb */
{
long x_lnnoptr; /* ptr to fcn line # */
long x_endndx; /* entry ndx past */
/* block end */
} x_fcn;
struct /* if ISARY, up to 4 dimen. */
{
} x_ary;
} x_fcnary;
unsigned short x_tvndx; /* tv index */
} x_sym;
struct
{
} x_file;
struct
{
long x_scnlen; /* section length */
unsigned short x_nreloc; /* number of reloc entries */
unsigned short x_nlinno; /* number of line numbers */
} x_scn;
struct
{
long x_tvfill; /* tv fill value */
unsigned short x_tvlen; /* length of .tv */
} x_tv; /* info about .tv section (in auxent of symbol .tv)) */
};
/* Defines for "special" symbols */
#define _ETEXT "etext"
#define _EDATA "edata"
#define _END "end"
#define _START "_start"
#ifdef __cplusplus
}
#endif
#endif /* _SYMS_H */