nlist.h

Go to the documentation of this file.
00001 /*-
00002  * Copyright (c) 1991, 1993
00003  *      The Regents of the University of California.  All rights reserved.
00004  * (c) UNIX System Laboratories, Inc.
00005  * All or some portions of this file are derived from material licensed
00006  * to the University of California by American Telephone and Telegraph
00007  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
00008  * the permission of UNIX System Laboratories, Inc.
00009  *
00010  * Redistribution and use in source and binary forms, with or without
00011  * modification, are permitted provided that the following conditions
00012  * are met:
00013  * 1. Redistributions of source code must retain the above copyright
00014  *    notice, this list of conditions and the following disclaimer.
00015  * 2. Redistributions in binary form must reproduce the above copyright
00016  *    notice, this list of conditions and the following disclaimer in the
00017  *    documentation and/or other materials provided with the distribution.
00018  * 3. All advertising materials mentioning features or use of this software
00019  *    must display the following acknowledgement:
00020  *      This product includes software developed by the University of
00021  *      California, Berkeley and its contributors.
00022  * 4. Neither the name of the University nor the names of its contributors
00023  *    may be used to endorse or promote products derived from this software
00024  *    without specific prior written permission.
00025  *
00026  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00027  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00029  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00030  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00031  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00032  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00033  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00034  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00035  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00036  * SUCH DAMAGE.
00037  *
00038  *      @(#)nlist.h     8.2 (Berkeley) 1/21/94
00039  */
00040 #ifndef __POSIX_NLIST_H__
00041 #define __POSIX_NLIST_H__       1
00042 #include <libc.h>
00043 
00044 struct nlist 
00045 {
00046   char          *n_name;        /* symbol name (in memory) */
00047   unsigned char n_type;         /* type defines */
00048 #define N_UNDF  0x00            /* undefined */
00049 #define N_ABS   0x02            /* absolute address */
00050 #define N_TEXT  0x04            /* text segment */
00051 #define N_DATA  0x06            /* data segment */
00052 #define N_BSS   0x08            /* bss segment */
00053 #define N_INDR  0x0a            /* alias definition */
00054 #define N_SIZE  0x0c            /* pseudo type, defines a symbol's size */
00055 #define N_COMM  0x12            /* common reference */
00056 #define N_SETA  0x14            /* absolute set element symbol */
00057 #define N_SETT  0x16            /* text set element symbol */
00058 #define N_SETD  0x18            /* data set element symbol */
00059 #define N_SETB  0x1a            /* bss set element symbol */
00060 #define N_SETV  0x1c            /* set vector symbol */
00061 #define N_FN    0x1e            /* file name (N_EXT on) */
00062 #define N_WARN  0x1e            /* warning message (N_EXT off) */
00063 
00064 #define N_EXT   0x01            /* external (global) bit, OR'ed in */
00065 #define N_TYPE  0x1e            /* mask for all the type bits */
00066   char          n_other;        /* spare */
00067 #define n_hash  n_desc          /* used internally by ld(1); XXX */
00068   short         n_desc;         /* used by stab entries */
00069   unsigned long n_value;        /* address/value of the symbol */
00070 };
00071 
00072 #define NLIST_ISLAST(p)       (p->n_name == 0 || p->n_name[0] == 0)
00073 
00074 typedef int     (*t_elf_load_fn)(struct nlist *nl);
00075 
00076 /* PROTO nlist.c */
00077 /* nlist.c */
00078 int nlist(int fd, struct nlist *list);
00079 #endif

Generated on Wed May 24 23:04:17 2006 for LSE/OS by  doxygen 1.4.6