__LDPGSZ moves out to <sys/exec.h>
[unix-history] / usr / src / include / a.out.h
/*-
* Copyright (c) 1991 The Regents of the University of California.
* All rights reserved.
*
* %sccs.include.redist.c%
*
* @(#)a.out.h 5.9 (Berkeley) %G%
*/
#ifndef _AOUT_H_
#define _AOUT_H_
#include <sys/exec.h>
/* Valid magic number check. */
#define N_BADMAG(ex) \
((ex).a_magic != NMAGIC && (ex).a_magic != OMAGIC && \
(ex).a_magic != ZMAGIC)
/* Address of the bottom of the text segment. */
#ifndef mips
#define N_TXTADDR(X) 0
/* Address of the bottom of the data segment. */
#define N_DATADDR(ex) \
(N_TXTADDR(ex) + ((ex).a_magic == OMAGIC ? (ex).a_text \
: __LDPGSZ + ((ex).a_text - 1 & ~(__LDPGSZ - 1))))
/* Text segment offset. */
#define N_TXTOFF(ex) \
((ex).a_magic == ZMAGIC ? __LDPGSZ : sizeof(struct exec))
/* Data segment offset. */
#define N_DATOFF(ex) \
(N_TXTOFF(ex) + ((ex).a_magic != ZMAGIC ? (ex).a_text : \
__LDPGSZ + ((ex).a_text - 1 & ~(__LDPGSZ - 1))))
/* Symbol table offset. */
#define N_SYMOFF(ex) \
(N_TXTOFF(ex) + (ex).a_text + (ex).a_data + (ex).a_trsize + \
(ex).a_drsize)
/* String table offset. */
#define N_STROFF(ex) (N_SYMOFF(ex) + (ex).a_syms)
/* Relocation format. */
struct relocation_info {
int r_address; /* offset in text or data segment */
unsigned int r_symbolnum : 24, /* ordinal number of add symbol */
r_pcrel : 1, /* 1 if value should be pc-relative */
r_length : 2, /* log base 2 of value's width */
r_extern : 1, /* 1 if need to add symbol to value */
: 4; /* reserved */
};
#else /* mips */
#define N_TXTADDR(X) 0x400000
#endif /* mips */
#define _AOUT_INCLUDE_
#include <nlist.h>
#endif /* !_AOUT_H_ */