xref: /original-bsd/include/nlist.h (revision 42c7e7a1)
1 /*-
2  * Copyright (c) 1991 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)nlist.h	5.6 (Berkeley) 04/04/91
8  */
9 
10 #ifndef _NLIST_H_
11 #define	_NLIST_H_
12 
13 /*
14  * Symbol table entry format.  The #ifdef's are so that programs including
15  * nlist.h can initialize nlist structures statically.
16  */
17 struct nlist {
18 #ifdef _AOUT_INCLUDE_
19 	union {
20 		char *n_name;	/* symbol name (in memory) */
21 		long n_strx;	/* file string table offset (on disk) */
22 	} n_un;
23 #else
24 	char *n_name;		/* symbol name (in memory) */
25 #endif
26 
27 #define	N_UNDF	0x00		/* undefined */
28 #define	N_ABS	0x02		/* absolute address */
29 #define	N_TEXT	0x04		/* text segment */
30 #define	N_DATA	0x06		/* data segment */
31 #define	N_BSS	0x08		/* bss segment */
32 #define	N_COMM	0x12		/* common reference */
33 #define	N_FN	0x1e		/* file name */
34 
35 #define	N_EXT	0x01		/* external (global) bit, OR'ed in */
36 #define	N_TYPE	0x1e		/* mask for all the type bits */
37 	unsigned char n_type;	/* type defines */
38 
39 	char n_other;		/* spare */
40 #define	n_hash	n_desc		/* used internally by ld(1); XXX */
41 	short n_desc;		/* used by stab entries */
42 	unsigned long n_value;	/* address/value of the symbol */
43 };
44 
45 #define	N_FORMAT	"%08x"	/* namelist value format; XXX */
46 #define	N_STAB		0x0e0	/* mask for debugger symbols -- stab(5) */
47 
48 #include <sys/cdefs.h>
49 
50 __BEGIN_DECLS
51 int nlist __P((const char *, struct nlist *));
52 __END_DECLS
53 
54 #endif /* !_NLIST_H_ */
55