|
|
1.1 root 1: #ident "@(#)/usr/include/filehdr.h.sl 1.2 4.1 09/02/86 29161 AT&T-SF"
2: /*
3: */
4:
5: struct filehdr {
6: unsigned short f_magic; /* magic number */
7: unsigned short f_nscns; /* number of sections */
8: long f_timdat; /* time & date stamp */
9: long f_symptr; /* file pointer to symtab */
10: long f_nsyms; /* number of symtab entries */
11: unsigned short f_opthdr; /* sizeof(optional hdr) */
12: unsigned short f_flags; /* flags */
13: };
14:
15:
16: /*
17: * Bits for f_flags:
18: *
19: * F_RELFLG relocation info stripped from file
20: * F_EXEC file is executable (i.e. no unresolved
21: * externel references)
22: * F_LNNO line nunbers stripped from file
23: * F_LSYMS local symbols stripped from file
24: * F_MINMAL this is a minimal object file (".m") output of fextract
25: * F_UPDATE this is a fully bound update file, output of ogen
26: * F_SWABD this file has had its bytes swabbed (in names)
27: * F_AR16WR this file has the byte ordering of an AR16WR (e.g. 11/70) machine
28: * (it was created there, or was produced by conv)
29: * F_AR32WR this file has the byte ordering of an AR32WR machine(e.g. vax)
30: * F_AR32W this file has the byte ordering of an AR32W machine (e.g. 3b,maxi)
31: * F_PATCH file contains "patch" list in optional header
32: * F_NODF (minimal file only) no decision functions for
33: * replaced functions
34: */
35:
36: #define F_RELFLG 0000001
37: #define F_EXEC 0000002
38: #define F_LNNO 0000004
39: #define F_LSYMS 0000010
40: #define F_MINMAL 0000020
41: #define F_UPDATE 0000040
42: #define F_SWABD 0000100
43: #define F_AR16WR 0000200
44: #define F_AR32WR 0000400
45: #define F_AR32W 0001000
46: #define F_PATCH 0002000
47: #define F_NODF 0002000
48:
49: /*
50: * BELLMAC-32 Identification field
51: * F_BM32B file contains BM32B code (as opposed to strictly BM32A)
52: * F_BM32MAU file requires MAU (math arith unit) to execute
53: */
54:
55: #define F_BM32ID 0160000
56: #define F_BM32MAU 0040000
57: #define F_BM32B 0020000
58:
59: /* F_BM32RST file has RESTORE work-around */
60:
61: #define F_BM32RST 0010000
62:
63: /*
64: * Flags for the INTEL chips. If the magic number of the object file
65: * is IAPX16 or IAPX16TV or IAPX20 or IAPX20TV then if F_80186
66: * is set, there are some 80186 instructions in the code, and hence
67: * and 80186 or 80286 chip must be used to run the code.
68: * If F_80286 is set, then the code has to be run on an 80286 chip.
69: * And if neither are set, then the code can run on an 8086, 80186, or
70: * 80286 chip.
71: *
72: */
73:
74: #define F_80186 010000
75: #define F_80286 020000
76:
77: /*
78: * Magic Numbers
79: */
80:
81: /* iAPX - the stack frame and return registers differ from
82: * Basic-16 and x86 C compilers, hence new magic numbers
83: * are required. These are cross compilers.
84: */
85:
86: /* Intel */
87: #define IAPX16 0504
88: #define IAPX16TV 0505
89: #define IAPX20 0506
90: #define IAPX20TV 0507
91: /* 0514, 0516 and 0517 reserved for Intel */
92:
93: /* Basic-16 */
94:
95: #define B16MAGIC 0502
96: #define BTVMAGIC 0503
97:
98:
99: /* x86 */
100:
101: #define X86MAGIC 0510
102: #define XTVMAGIC 0511
103:
104: /* Intel 286 */
105: #define I286SMAGIC 0512
106: #define I286LMAGIC 0522 /* used by mc68000 (UNIX PC) and iAPX 286 */
107:
108: /* n3b */
109: /*
110: * NOTE: For New 3B, the old values of magic numbers
111: * will be in the optional header in the structure
112: * "aouthdr" (identical to old 3B aouthdr).
113: */
114: #define N3BMAGIC 0550 /* 3B20 executable, no TV */
115: #define NTVMAGIC 0551 /* 3B20 executable with TV */
116:
117: /* MAC-32, 3B15, 3B5 */
118:
119: #define WE32MAGIC 0560 /* WE 32000, no TV */
120: #define FBOMAGIC 0560 /* WE 32000, no TV */
121: #define RBOMAGIC 0562 /* reserved for WE 32000 */
122: #define MTVMAGIC 0561 /* WE 32000 with TV */
123:
124:
125: /* VAX 11/780 and VAX 11/750 */
126:
127: /* writeable text segments */
128: #define VAXWRMAGIC 0570
129: /* readonly sharable text segments */
130: #define VAXROMAGIC 0575
131:
132: /* pdp11 */
133: /* 0401 UNIX-rt ldp */
134: /* 0405 pdp11 overlay */
135: /* 0407 pdp11/pre System V vax executable */
136: /* 0410 pdp11/pre System V vax pure executable */
137: /* 0411 pdp11 seperate I&D */
138: /* 0437 pdp11 kernel overlay */
139:
140:
141: /* Motorola 68000/68008/68010/68020 */
142: #define MC68MAGIC 0520
143: #define MC68KWRMAGIC 0520 /* writeable text segments */
144: #define MC68TVMAGIC 0521
145: #define MC68KROMAGIC 0521 /* readonly shareable text segments */
146: #define MC68KPGMAGIC 0522 /* demand paged text segments */
147: #define M68MAGIC 0210
148: #define M68TVMAGIC 0211
149:
150:
151: /* IBM 370 */
152: #define U370WRMAGIC 0530 /* writeble text segments */
153: #define U370ROMAGIC 0535 /* readonly sharable text segments */
154: /* 0532 and 0533 reserved for u370 */
155:
156: /* Amdahl 470/580 */
157: #define AMDWRMAGIC 0531 /* writable text segments */
158: #define AMDROMAGIC 0534 /* readonly sharable text segments */
159:
160: /* NSC */
161: /* 0524 and 0525 reserved for NSC */
162:
163: /* Zilog */
164: /* 0544 and 0545 reserved for Zilog */
165:
166: #define FILHDR struct filehdr
167: #define FILHSZ sizeof(FILHDR)
168:
169: #define ISCOFF(x) \
170: (((x)==B16MAGIC) || ((x)==BTVMAGIC) || ((x)==X86MAGIC) \
171: || ((x)==XTVMAGIC) || ((x)==N3BMAGIC) || ((x)==NTVMAGIC) \
172: || ((x)==FBOMAGIC) || ((x)==VAXROMAGIC) || ((x)==VAXWRMAGIC) \
173: || ((x)==RBOMAGIC) || ((x)==MC68TVMAGIC) \
174: || ((x)==MC68MAGIC) || ((x)==M68MAGIC) || ((x)==M68TVMAGIC) \
175: || ((x)==IAPX16) || ((x)==IAPX16TV) \
176: || ((x)==IAPX20) || ((x)==IAPX20TV) \
177: || ((x)==U370WRMAGIC) || ((x)==U370ROMAGIC) || ((x)==MTVMAGIC) \
178: || ((x)==I286SMAGIC) || ((x)==I286LMAGIC) \
179: || ((x)==MC68KWRMAGIC) || ((x)==MC68KROMAGIC) \
180: || ((x)==MC68KPGMAGIC))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.