This is nlist.h in view mode; [Download] [Up]
#ifndef _MACHO_NLIST_H_ #define _MACHO_NLIST_H_ /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * * @(#)nlist.h 5.1 (Berkeley) 5/30/85 */ /* * Format of a symbol table entry of a Mach-O file. Modified from the 4.3BSD * format. The modifications from the original format were changing n_other * (an unused field) to n_sect and the addition of the N_SECT type. These * modifications are required to support symbols in an arbitrary number of * sections not just the three sections (text, data and bss) in a 4.3BSD file. */ struct nlist { union { char *n_name; /* for use when in-core */ long n_strx; /* index into the string table */ } n_un; unsigned char n_type; /* type flag, see below */ unsigned char n_sect; /* section number or NO_SECT */ short n_desc; /* see <mach-o/stab.h> */ unsigned long n_value; /* value of this symbol (or stab offset) */ }; /* * Symbols with a index into the string table of zero (n_un.n_strx == 0) are * defined to have a null, "", name. Therefore all string indexes to non null * names must not have a zero string index. This is bit historical information * that has never been well documented. */ /* * The n_type field really contains three fields: * unsigned char N_STAB:3, * N_TYPE:4, * N_EXT:1; * which are used via the following masks. */ #define N_STAB 0xe0 /* if any of these bits set, a symbolic debugging entry */ #define N_TYPE 0x1e /* mask for the type bits */ #define N_EXT 0x01 /* external symbol bit, set for external symbols */ /* * Only symbolic debugging entries have some of the N_STAB bits set and if any * of these bits are set then it is a symbolic debugging entry (a stab). In * which case then the values of the n_type field (the entire field) are given * in <mach-o/stab.h> */ /* * Values for N_TYPE bits of the n_type field. */ #define N_UNDF 0x0 /* undefined, n_sect == NO_SECT */ #define N_ABS 0x2 /* absolute, n_sect == NO_SECT */ #define N_SECT 0xe /* defined in section number n_sect */ #define N_INDR 0xa /* indirect */ /* * If the type is N_INDR then the symbol is defined to be the same as another * symbol. In this case the n_value field is an index into the string table * of the other symbol's name. When the other symbol is defined then they both * take on the defined type and value. */ /* * If the type is N_SECT then the n_sect field contains an ordinal of the * section the symbol is defined in. The sections are numbered from 1 and * refer to sections in order they appear in the load commands for the file * they are in. This means the same ordinal may very well refer to different * sections in different files. * * The n_value field for all symbol table entries (including N_STAB's) gets * updated by the link editor based on the value of it's n_sect field and where * the section n_sect references gets relocated. If the value of the n_sect * field is NO_SECT then it's n_value field is not changed by the link editor. */ #define NO_SECT 0 /* symbol is not in any section */ #define MAX_SECT 255 /* 1 thru 255 inclusive */ /* * Common symbols are represented by undefined (N_UNDF) external (N_EXT) types * who's values (n_value) are non-zero. In which case the value of the n_value * field is the size (in bytes) of the common symbol. The n_sect field is set * to NO_SECT. */ #ifndef __STRICT_BSD__ /* * The function nlist(3) from the C library. */ extern int nlist (const char *filename, struct nlist *list); #endif #endif
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.