|
|
1.1 root 1: #ident "@(#)/usr/include/a.out.h.sl 1.2 4.1 09/02/86 63821 AT&T-SF"
2:
3: #include <nlist.h> /* included for all machines */
4:
5: #if u3b || vax || M32 || u3b15 || u3b5 || u3b2
6:
7: /* COMMON OBJECT FILE FORMAT
8:
9: For a description of the common object file format (COFF) see
10: the Common Object File Format chapter of the UNIX System V Support
11: Tools Guide
12:
13: OBJECT FILE COMPONENTS
14:
15: HEADER FILES:
16: /usr/include/filehdr.h
17: /usr/include/aouthdr.h
18: /usr/include/scnhdr.h
19: /usr/include/reloc.h
20: /usr/include/linenum.h
21: /usr/include/syms.h
22: /usr/include/storclass.h
23:
24: STANDARD FILE:
25: /usr/include/a.out.h "object file"
26: */
27:
28: #include "filehdr.h"
29: #include "aouthdr.h"
30: #include "scnhdr.h"
31: #include "reloc.h"
32: #include "linenum.h"
33: #include "syms.h"
34:
35:
36: #else /* u370 || pdp11 */
37:
38:
39: /*
40: * Format of an a.out header
41: */
42:
43:
44: struct exec { /* a.out header */
45: #if u370
46: int a_magic; /* magic number */
47: int a_stamp; /* The version of a.out */
48: /* format of this file. */
49: #else
50: short a_magic; /* magic number */
51: #endif
52: unsigned a_text; /* size of text segment */
53: /* in bytes */
54: /* padded out to next */
55: /* page boundary with */
56: /* binary zeros. */
57: unsigned a_data; /* size of initialized data */
58: /* segment in bytes */
59: /* padded out to next */
60: /* page boundary with */
61: /* binary zeros. */
62: unsigned a_bss; /* Actual size of */
63: /* uninitialized data */
64: /* segment in bytes. */
65: unsigned a_syms; /* size of symbol table */
66: unsigned a_entry; /* entry point */
67: #if u370
68: unsigned a_trsize; /* size of text relocation */
69: unsigned a_drsize; /* size of data relocation */
70: unsigned a_origin; /* The origin to which */
71: /* this file was */
72: /* relocated. */
73: unsigned a_actext; /* The actual size of */
74: /* the text segment in */
75: /* bytes. */
76: unsigned a_acdata; /* The actual size of */
77: /* the data segment in */
78: /* bytes. */
79: #endif
80: #if pdp11
81: char a_unused; /* not used */
82: unsigned char a_hitext; /* high order text bits */
83: char a_flag; /* reloc info stripped */
84: char a_stamp; /* environment stamp */
85: #endif
86: };
87:
88: #define A_MAGIC1 0407 /* normal */
89: #define A_MAGIC0 0401 /* lpd (UNIX/RT) */
90: #define A_MAGIC2 0410 /* read-only text */
91: #define A_MAGIC3 0411 /* separated I&D */
92: #define A_MAGIC4 0405 /* overlay */
93: #define A_MAGIC5 0437 /* system overlay, separated I&D */
94:
95: #if u370
96: struct relocation_info {
97: long r_address; /* relative to current segment */
98: unsigned int
99: r_symbolnum:24, /* if extern then symbol table */
100: /* ordinal (0, 1, 2, ...) else */
101: /* segment number (same as symbol types) */
102: r_pcrel:1, /* if so, segment offset has already */
103: /* been subtracted */
104: r_length:2, /* 0=byte, 1=word, 2=long */
105: r_extern:1, /* does not include value */
106: /* of symbol referenced */
107: r_offset:1, /* already includes origin */
108: /* of this segment (?) */
109: r_pad:3; /* nothing, yet */
110: };
111: #endif
112:
113: /* in invocation of BADMAG macro, argument should not be a function. */
114:
115: #define BADMAG(X) (X.a_magic != A_MAGIC1 &&\
116: X.a_magic != A_MAGIC2 &&\
117: X.a_magic != A_MAGIC3 &&\
118: X.a_magic != A_MAGIC4 &&\
119: X.a_magic != A_MAGIC5 &&\
120: X.a_magic != A_MAGIC0)
121:
122: /* values for type flag */
123:
124: #define N_UNDF 0 /* undefined */
125: #define N_TYPE 037
126: #define N_FN 037 /* file name symbol */
127:
128: #if pdp11
129: #define N_ABS 01 /* absolute */
130: #define N_TEXT 02 /* text symbol */
131: #define N_DATA 03 /* data symbol */
132: #define N_BSS 04 /* bss symbol */
133: #define N_REG 024 /* register name */
134: #define N_EXT 040 /* external bit, or'ed in */
135: #define FORMAT "%.6o" /* to print a value */
136: #else
137: #define N_ABS 02 /* absolute */
138: #define N_TEXT 04 /* text */
139: #define N_DATA 06 /* data */
140: #define N_BSS 010
141: #define N_GSYM 0040 /* global sym: name,,type,0 */
142: #define N_FNAME 0042 /* procedure name (f77 kludge): name,,,0 */
143: #define N_FUN 0044 /* procedure: name,,linenumber,address */
144: #define N_STSYM 0046 /* static symbol: name,,type,address */
145: #define N_LCSYM 0050 /* .lcomm symbol: name,,type,address */
146: #define N_BSTR 0060 /* begin structure: name,,, */
147: #define N_RSYM 0100 /* register sym: name,,register,offset */
148: #define N_SLINE 0104 /* src line: ,,linenumber,address */
149: #define N_ESTR 0120 /* end structure: name,,, */
150: #define N_SSYM 0140 /* structure elt: name,,type,struct_offset */
151: #define N_SO 0144 /* source file name: name,,,address */
152: #define N_BENUM 0160 /* begin enum: name,,, */
153: #define N_LSYM 0200 /* local sym: name,,type,offset */
154: #define N_SOL 0204 /* #line source filename: name,,,address */
155: #define N_ENUM 0220 /* enum element: name,,,value */
156: #define N_PSYM 0240 /* parameter: name,,type,offset */
157: #define N_ENTRY 0244 /* alternate entry: name,,linenumber,address */
158: #define N_EENUM 0260 /* end enum: name,,, */
159: #define N_LBRAC 0300 /* left bracket: ,,nesting level,address */
160: #define N_RBRAC 0340 /* right bracket: ,,nesting level,address */
161: #define N_BCOMM 0342 /* begin common: name,,, */
162: #define N_ECOMM 0344 /* end common: name,,, */
163: #define N_ECOML 0350 /* end common (local name): ,,,address */
164: #define N_STRU 0374 /* 2nd entry for structure: str tag,,,length */
165: #define N_LENG 0376 /* second stab entry with length information */
166: #define N_EXT 01 /* external bit, or'ed in */
167: #define FORMAT "%.8x"
168: #define STABTYPES 0340
169: #endif
170:
171: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.