Commit | Line | Data |
---|---|---|
19ef9aae KB |
1 | /*- |
2 | * Copyright (c) 1991 The Regents of the University of California. | |
3 | * All rights reserved. | |
bb0cfa24 | 4 | * |
19ef9aae KB |
5 | * %sccs.include.redist.c% |
6 | * | |
6b039c11 | 7 | * @(#)a.out.h 5.7 (Berkeley) %G% |
bb0cfa24 | 8 | */ |
6f86c72f | 9 | |
19ef9aae KB |
10 | #ifndef _AOUT_H_ |
11 | #define _AOUT_H_ | |
12 | ||
8715e60f | 13 | #include <sys/exec.h> |
6f86c72f | 14 | |
7c7b8a0c KB |
15 | #if defined(hp300) || defined(i386) |
16 | #define __LDPGSZ 4096 | |
17 | #endif | |
18 | #if defined(tahoe) || defined(vax) | |
19 | #define __LDPGSZ 1024 | |
20 | #endif | |
21 | ||
19ef9aae KB |
22 | /* Valid magic number check. */ |
23 | #define N_BADMAG(ex) \ | |
24 | ((ex).a_magic != NMAGIC && (ex).a_magic != OMAGIC && \ | |
25 | (ex).a_magic != ZMAGIC) | |
6f86c72f | 26 | |
7c7b8a0c KB |
27 | /* Address of the bottom of the text segment. */ |
28 | #define N_TXTADDR(X) 0 | |
29 | ||
30 | /* Address of the bottom of the data segment. */ | |
31 | #define N_DATADDR(ex) \ | |
32 | (N_TXTADDR(ex) + ((ex).a_magic == OMAGIC ? (ex).a_text \ | |
33 | : __LDPGSZ + ((ex).a_text - 1 & ~(__LDPGSZ - 1)))) | |
34 | ||
19ef9aae | 35 | /* Text segment offset. */ |
19ef9aae | 36 | #define N_TXTOFF(ex) \ |
7c7b8a0c | 37 | ((ex).a_magic == ZMAGIC ? __LDPGSZ : sizeof(struct exec)) |
bad2f352 | 38 | |
7c7b8a0c KB |
39 | /* Data segment offset. */ |
40 | #define N_DATOFF(ex) \ | |
41 | (N_TXTOFF(ex) + ((ex).a_magic != ZMAGIC ? (ex).a_text : \ | |
6b039c11 | 42 | __LDPGSZ + ((ex).a_text - 1 & ~(__LDPGSZ - 1)))) |
bad2f352 | 43 | |
19ef9aae KB |
44 | /* Symbol table offset. */ |
45 | #define N_SYMOFF(ex) \ | |
46 | (N_TXTOFF(ex) + (ex).a_text + (ex).a_data + (ex).a_trsize + \ | |
47 | (ex).a_drsize) | |
bad2f352 | 48 | |
19ef9aae | 49 | /* String table offset. */ |
7c7b8a0c | 50 | #define N_STROFF(ex) (N_SYMOFF(ex) + (ex).a_syms) |
6f86c72f | 51 | |
19ef9aae | 52 | /* Relocation format. */ |
6f86c72f | 53 | struct relocation_info { |
19ef9aae KB |
54 | int r_address; /* offset in text or data segment */ |
55 | unsigned int r_symbolnum : 24, /* ordinal number of add symbol */ | |
56 | r_pcrel : 1, /* 1 if value should be pc-relative */ | |
57 | r_length : 2, /* log base 2 of value's width */ | |
58 | r_extern : 1, /* 1 if need to add symbol to value */ | |
59 | : 4; /* reserved */ | |
6f86c72f SL |
60 | }; |
61 | ||
19ef9aae KB |
62 | #define _AOUT_INCLUDE_ |
63 | #include <nlist.h> | |
6f86c72f | 64 | |
19ef9aae | 65 | #endif /* !_AOUT_H_ */ |