1 /* aout.h - parse and load the contents of a UNIX a.out file, for
2 * several flavours of PDP-11 UNIX
5 * $Date: 2008/05/19 13:42:39 $
10 /* UNIX magic numbers for the a.out header */
11 #define V1_NORMAL 0405 /* normal: 1st Edition, six words long */
12 #define ANY_NORMAL 0407 /* normal: V5,V6,V7,2.11BSD */
13 #define ANY_ROTEXT 0410 /* read-only text: V5,V6,V7,2.11BSD */
14 #define ANY_SPLITID 0411 /* seperated I&D: V5,V6,V7,2.11BSD */
15 #define BSD_OVERLAY 0430 /* 2.11BSD overlay, non-separate */
16 #define BSD_ROVERLAY 0431 /* 2.11BSD overlay, separate */
17 #define ANY_SCRIPT 020443 /* Shell script, i.e #! */
18 #define A68_MAGIC 0 /* Algol68 binaries have these magic nums */
19 #define A68_DATA 0107116 /* Algol68 binaries have these magic nums */
20 #define V1_RAW 0104421 /* V1 'raw' binary: rm, ln, chmod from s2
23 #define UNKNOWN_AOUT 034567 /* An unknown a.out header */
25 /* a.out header for nearly all UNIX flavours */
27 u_int16_t a_magic; /* magic number */
28 u_int16_t a_text; /* size of text segment */
29 u_int16_t a_data; /* size of initialised data */
30 u_int16_t a_bss; /* size of initialised bss */
31 u_int16_t a_syms; /* size of symbol table */
32 u_int16_t a_entry; /* entry point */
33 u_int16_t a_unused; /* unused */
34 u_int16_t a_flag; /* relocation info stripped */
35 /* 16 bytes up to here */
37 /* 2.11BSD overlay files have the following */
39 int16_t max_ovl; /* maximum overlay size */
40 u_int16_t ov_siz[NOVL]; /* size of the i'th overlay */
41 /* Note that if the file isn't a 2.11BSD */
42 /* overlay, we have to rewind to undo */
43 /* the read of this section */
46 /* Because V5, V6, V7 and 2.11BSD share several magic numbers
47 * in their a.out headers, we must distinguish them so as to
48 * set up the correct emulated environment. This is done by
49 * observing the differences in their crt0.s code: they all
50 * differ at position 021
52 #define a_magic2 ov_siz[0]
53 #define V2_M2 0177304 /* Doesn't apply to all, tho */
56 #define BSD_M2 0162706