|
|
Power 6/32 Unix version 1.2b
/* @(#)sym.h 2.3 */
#define isymNil -1L
#define isym0 0L
#define bitHigh (0x80000000)
/* magic number definitions */
#define magicImpure 0407 /* impure format */
#define magicReadOnly 0410 /* read-only text */
#define magicDemand 0413 /* demand load format */
#define magicLpd 0401 /* lpd (UNIX/RT) */
#define magicSplit 0411 /* separated I&D */
#define magicOverlay 0405 /* overlay */
#ifdef SYSIII
#ifndef REGULUS
/* stuff directly related to the symbol table */
struct exec { /* a.out header */
short a_magic; /* magic number */
uint a_text; /* size of text segment */
uint a_data; /* size of initialized data */
uint a_bss; /* size of uninitialized data */
uint a_syms; /* size of symbol table */
uint a_entry; /* entry point */
uint a_stamp; /* system environment stamp */
uint a_flag; /* relocation info stripped */
};
/* ***** in invocation of BADMAG macro, argument should not be a function.***/
#define FBadMagic(X) (X.a_magic!=magicReadOnly && X.a_magic!=magicImpure \
&& X.a_magic!=magicLpd && X.a_magic!=magicSplit \
&& X.a_magic!=magicOverlay)
#define CbTextOffset(x) (cbEXECR)
#define CbSymOffset(x) ((x).a_text + (x).a_data + CbTextOffset(x))
/* values for type flag */
#define N_UNDF 0 /* undefined */
#define N_ABS 01 /* absolute */
#define N_TEXT 02 /* text symbol */
#define N_DATA 03 /* data symbol */
#define N_BSS 04 /* bss symbol */
#define N_TYPE 037 /* gets JUST the type bits (removes N_EXT) */
#define N_REG 024 /* register name */
#define N_FN 037 /* file name symbol */
#define N_EXT 040 /* external bit, or'ed in */
typedef struct SYMS { /* same record as `nlist, but with my names */
char sbSym[8]; /* symbol name */
short type; /* type flag */
uint value; /* something appropriate to the type */
} SYMR, *pSYMR;
#define cbSYMR sizeof(SYMR)
/* then following is replaced by a procedure for BSD41 - see sym.c */
#define SbInCore(sb) (sb)
/* end of normal SYSIII */
#else
/* stuff directly related to the symbol table */
struct exec { /* a.out header */
short a_magic; /* magic number */
long a_text; /* size of text segment */
long a_data; /* size of initialized data */
long a_bss; /* size of uninitialized data */
long a_syms; /* size of symbol table */
long a_stksize; /* stack size */
long a_entry; /* entry point */
short a_flag; /* relocation info stripped */
};
#define A_MAGIC1 0x601a /* normal */
#define A_MAGIC0 0x601c /* shared text - 2k boundaries */
#define A_MAGIC2 0x601d /* separated I&D */
#define A_MAGIC3 0x601e /* shared text - 4k boundaries */
/* ***** in invocation of BADMAG macro, argument should not be a function.***/
#define FBadMagic(X) (X.a_magic!=A_MAGIC1 && X.a_magic!=A_MAGIC2 \
&& X.a_magic!=A_MAGIC3 && X.a_magic!=A_MAGIC0)
#define CbTextOffset(x) (cbEXECR)
#define CbSymOffset(x) (CbTextOffset(x) + (x).a_text + (x).a_data)
/* values for type flag */
#define N_UNDF 0 /* undefined */
#define N_ABS 040000 /* absolute */
#define N_TEXT 01000 /* text symbol */
#define N_DATA 02000 /* data symbol */
#define N_BSS 0400 /* bss symbol */
#define N_TYPE 053600 /* gets JUST the type bits (removes N_EXT) */
#define N_REG 010000 /* register name */
#define N_FN 0200 /* file name symbol */
#define N_EXT 020000 /* external bit, or'ed in */
typedef struct SYMS { /* same record as `nlist, but with my names */
char sbSym[8]; /* symbol name */
short type; /* type flag */
ulong value; /* something appropriate to the type */
} SYMR, *pSYMR;
#define cbSYMR sizeof(SYMR)
/* then following is replaced by a procedure for BSD41 - see sym.c */
#define SbInCore(sb) (sb)
/* end of REGULUS */
#endif
/* end of SYSIII stuff */
#endif
#ifdef BSD41
extern char * SbInCore();
struct exec {
long a_magic; /* magic number */
ulong a_text; /* size of text segment */
ulong a_data; /* size of initialized data */
ulong a_bss; /* size of uninitialized data */
ulong a_syms; /* size of symbol table */
ulong a_entry; /* entry point */
ulong a_trsize; /* size of text relocation */
ulong a_drsize; /* size of data relocation */
};
#define FBadMagic(x) \
(((x).a_magic)!=magicImpure \
&& ((x).a_magic)!=magicReadOnly \
&& ((x).a_magic)!=magicDemand)
#ifdef SUN
#define CbTextOffset(x) ((x).a_magic==magicDemand ? 2048 : cbEXECR)
#else
#define CbTextOffset(x) ((x).a_magic==magicDemand ? 1024 : cbEXECR)
#endif
#define CbSymOffset(x) \
(CbTextOffset(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize)
#define CbStrOffset(x) (CbSymOffset(x) + (x).a_syms)
typedef struct SYMS { /* berkeley `nlist', almost */
long sbSym; /* not an `sb', an index into string space */
uchar type; /* type flag, i.e. N_TEXT etc; see below */
char other; /* unused */
short desc; /* see <stab.h> */
ulong value; /* value of this symbol (or sdb offset) */
} SYMR, *pSYMR;
#define cbSYMR sizeof(SYMR)
/*
* Simple values for n_type.
*/
#define N_UNDF 0x0 /* undefined */
#define N_ABS 0x2 /* absolute */
#define N_TEXT 0x4 /* text */
#define N_DATA 0x6 /* data */
#define N_BSS 0x8 /* bss */
#define N_FN 0x1f /* file name symbol */
#define N_EXT 01 /* external bit, or'ed in */
#define N_TYPE 0x1e /* mask for all the type bits */
#define N_STAB 0xe0 /* if any of these bits set, a SDB entry */
/* end of BSD41 */
#endif
#define symNil ((pSYMR)0)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.