nlist.h revision 23037
158314Sache/*- 221308Sache * Copyright (c) 1991, 1993 321308Sache * The Regents of the University of California. All rights reserved. 421308Sache * (c) UNIX System Laboratories, Inc. 521308Sache * All or some portions of this file are derived from material licensed 621308Sache * to the University of California by American Telephone and Telegraph 721308Sache * Co. or Unix System Laboratories, Inc. and are reproduced herein with 821308Sache * the permission of UNIX System Laboratories, Inc. 921308Sache * 1021308Sache * Redistribution and use in source and binary forms, with or without 1158314Sache * modification, are permitted provided that the following conditions 1221308Sache * are met: 1321308Sache * 1. Redistributions of source code must retain the above copyright 1421308Sache * notice, this list of conditions and the following disclaimer. 1521308Sache * 2. Redistributions in binary form must reproduce the above copyright 1621308Sache * notice, this list of conditions and the following disclaimer in the 1721308Sache * documentation and/or other materials provided with the distribution. 1821308Sache * 3. All advertising materials mentioning features or use of this software 1921308Sache * must display the following acknowledgement: 2021308Sache * This product includes software developed by the University of 2121308Sache * California, Berkeley and its contributors. 2258314Sache * 4. Neither the name of the University nor the names of its contributors 2321308Sache * may be used to endorse or promote products derived from this software 2421308Sache * without specific prior written permission. 2521308Sache * 2621308Sache * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2721308Sache * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2821308Sache * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2921308Sache * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 3021308Sache * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3121308Sache * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3221308Sache * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3321308Sache * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3421308Sache * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3526497Sache * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3626497Sache * SUCH DAMAGE. 3721308Sache * 3821308Sache * @(#)nlist.h 8.2 (Berkeley) 1/21/94 3921308Sache * 4021308Sache * $Id$ 4121308Sache */ 4221308Sache 4326497Sache#ifndef _NLIST_H_ 4421308Sache#define _NLIST_H_ 4521308Sache 4621308Sache/* 4721308Sache * Symbol table entry format. The #ifdef's are so that programs including 4821308Sache * nlist.h can initialize nlist structures statically. 4921308Sache */ 5021308Sachestruct nlist { 5121308Sache#ifdef _AOUT_INCLUDE_ 5221308Sache union { 5321308Sache char *n_name; /* symbol name (in memory) */ 5421308Sache long n_strx; /* file string table offset (on disk) */ 5558314Sache } n_un; 5658314Sache#else 5758314Sache char *n_name; /* symbol name (in memory) */ 5821308Sache#endif 5921308Sache 6021308Sache#define N_UNDF 0x00 /* undefined */ 6121308Sache#define N_ABS 0x02 /* absolute address */ 6258314Sache#define N_TEXT 0x04 /* text segment */ 6375409Sache#define N_DATA 0x06 /* data segment */ 6435486Sache#define N_BSS 0x08 /* bss segment */ 6521308Sache#define N_INDR 0x0a /* alias definition */ 6658314Sache#define N_SIZE 0x0c /* pseudo type, defines a symbol's size */ 6758314Sache#define N_COMM 0x12 /* common reference */ 6858314Sache/* GNU extensions */ 6958314Sache#define N_SETA 0x14 /* Absolute set element symbol */ 7058314Sache#define N_SETT 0x16 /* Text set element symbol */ 7121308Sache#define N_SETD 0x18 /* Data set element symbol */ 7221308Sache#define N_SETB 0x1a /* Bss set element symbol */ 7358314Sache#define N_SETV 0x1c /* Pointer to set vector in data area. */ 7421308Sache/* end GNU extensions */ 7521308Sache#define N_FN 0x1e /* file name (N_EXT on) */ 7621308Sache#define N_WARN 0x1e /* warning message (N_EXT off) */ 7721308Sache 7821308Sache#define N_EXT 0x01 /* external (global) bit, OR'ed in */ 7921308Sache#define N_TYPE 0x1e /* mask for all the type bits */ 8021308Sache unsigned char n_type; /* type defines */ 8121308Sache 8221308Sache char n_other; /* spare */ 8321308Sache#define n_hash n_desc /* used internally by ld(1); XXX */ 8421308Sache short n_desc; /* used by stab entries */ 8521308Sache unsigned long n_value; /* address/value of the symbol */ 8621308Sache}; 8721308Sache 8821308Sache#define N_FORMAT "%08x" /* namelist value format; XXX */ 8921308Sache#define N_STAB 0x0e0 /* mask for debugger symbols -- stab(5) */ 9021308Sache 9121308Sache#include <sys/cdefs.h> 9221308Sache 9321308Sache__BEGIN_DECLS 9421308Sacheint nlist __P((const char *, struct nlist *)); 9521308Sache__END_DECLS 9621308Sache 9721308Sache#endif /* !_NLIST_H_ */ 9821308Sache