nlist.h revision 5207
1130803Smarcel/*-
2130803Smarcel * Copyright (c) 1991, 1993
3130803Smarcel *	The Regents of the University of California.  All rights reserved.
4130803Smarcel * (c) UNIX System Laboratories, Inc.
5130803Smarcel * All or some portions of this file are derived from material licensed
6130803Smarcel * to the University of California by American Telephone and Telegraph
7130803Smarcel * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8130803Smarcel * the permission of UNIX System Laboratories, Inc.
9130803Smarcel *
10130803Smarcel * Redistribution and use in source and binary forms, with or without
11130803Smarcel * modification, are permitted provided that the following conditions
12130803Smarcel * are met:
13130803Smarcel * 1. Redistributions of source code must retain the above copyright
14130803Smarcel *    notice, this list of conditions and the following disclaimer.
15130803Smarcel * 2. Redistributions in binary form must reproduce the above copyright
16130803Smarcel *    notice, this list of conditions and the following disclaimer in the
17130803Smarcel *    documentation and/or other materials provided with the distribution.
18130803Smarcel * 3. All advertising materials mentioning features or use of this software
19130803Smarcel *    must display the following acknowledgement:
20130803Smarcel *	This product includes software developed by the University of
21130803Smarcel *	California, Berkeley and its contributors.
22130803Smarcel * 4. Neither the name of the University nor the names of its contributors
23130803Smarcel *    may be used to endorse or promote products derived from this software
24130803Smarcel *    without specific prior written permission.
25130803Smarcel *
26130803Smarcel * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27130803Smarcel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28130803Smarcel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29130803Smarcel * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30130803Smarcel * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31130803Smarcel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32130803Smarcel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33130803Smarcel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34130803Smarcel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35130803Smarcel * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36130803Smarcel * SUCH DAMAGE.
37130803Smarcel *
38130803Smarcel *	@(#)nlist.h	8.2 (Berkeley) 1/21/94
39130803Smarcel *
40130803Smarcel *	$Id$
41130803Smarcel */
42130803Smarcel
43130803Smarcel#ifndef _NLIST_H_
44130803Smarcel#define	_NLIST_H_
45130803Smarcel
46130803Smarcel/*
47130803Smarcel * Symbol table entry format.  The #ifdef's are so that programs including
48130803Smarcel * nlist.h can initialize nlist structures statically.
49130803Smarcel */
50130803Smarcelstruct nlist {
51130803Smarcel#ifdef _AOUT_INCLUDE_
52130803Smarcel	union {
53130803Smarcel		char *n_name;	/* symbol name (in memory) */
54130803Smarcel		long n_strx;	/* file string table offset (on disk) */
55130803Smarcel	} n_un;
56130803Smarcel#else
57130803Smarcel	char *n_name;		/* symbol name (in memory) */
58130803Smarcel#endif
59130803Smarcel
60130803Smarcel#define	N_UNDF	0x00		/* undefined */
61130803Smarcel#define	N_ABS	0x02		/* absolute address */
62130803Smarcel#define	N_TEXT	0x04		/* text segment */
63130803Smarcel#define	N_DATA	0x06		/* data segment */
64130803Smarcel#define	N_BSS	0x08		/* bss segment */
65130803Smarcel#define	N_INDR	0x0a		/* alias definition */
66130803Smarcel#define	N_SIZE	0x0c		/* pseudo type, defines a symbol's size */
67130803Smarcel#define	N_COMM	0x12		/* common reference */
68130803Smarcel#define	N_FN	0x1e		/* file name (N_EXT on) */
69130803Smarcel#define	N_WARN	0x1e		/* warning message (N_EXT off) */
70130803Smarcel
71130803Smarcel#define	N_EXT	0x01		/* external (global) bit, OR'ed in */
72130803Smarcel#define	N_TYPE	0x1e		/* mask for all the type bits */
73130803Smarcel	unsigned char n_type;	/* type defines */
74130803Smarcel
75130803Smarcel	char n_other;		/* spare */
76130803Smarcel#define	n_hash	n_desc		/* used internally by ld(1); XXX */
77130803Smarcel	short n_desc;		/* used by stab entries */
78130803Smarcel	unsigned long n_value;	/* address/value of the symbol */
79130803Smarcel};
80130803Smarcel
81130803Smarcel#define	N_FORMAT	"%08x"	/* namelist value format; XXX */
82130803Smarcel#define	N_STAB		0x0e0	/* mask for debugger symbols -- stab(5) */
83130803Smarcel
84130803Smarcel#include <sys/cdefs.h>
85130803Smarcel
86130803Smarcel__BEGIN_DECLS
87130803Smarcelint nlist __P((const char *, struct nlist *));
88130803Smarcel__END_DECLS
89130803Smarcel
90130803Smarcel#endif /* !_NLIST_H_ */
91130803Smarcel