4 /* XCOFF executable loader */
6 typedef struct COFF_filehdr_t {
7 uint16_t f_magic; /* magic number */
8 uint16_t f_nscns; /* number of sections */
9 uint32_t f_timdat; /* time & date stamp */
10 uint32_t f_symptr; /* file pointer to symtab */
11 uint32_t f_nsyms; /* number of symtab entries */
12 uint16_t f_opthdr; /* sizeof(optional hdr) */
13 uint16_t f_flags; /* flags */
18 #define U802WRMAGIC 0x02DA /* writeable text segments **chh** */
19 #define U802ROMAGIC 0x02DF /* readonly sharable text segments */
20 #define U802TOCMAGIC 0x02E1 /* readonly text segments and TOC */
21 #define U802TOMAGIC 0x01DF
26 * F_RELFLG relocation info stripped from file
27 * F_EXEC file is executable (i.e. no unresolved external
29 * F_LNNO line numbers stripped from file
30 * F_LSYMS local symbols stripped from file
31 * F_MINMAL this is a minimal object file (".m") output of fextract
32 * F_UPDATE this is a fully bound update file, output of ogen
33 * F_SWABD this file has had its bytes swabbed (in names)
34 * F_AR16WR this file has the byte ordering of an AR16WR
35 * (e.g. 11/70) machine
36 * F_AR32WR this file has the byte ordering of an AR32WR machine
37 * (e.g. vax and iNTEL 386)
38 * F_AR32W this file has the byte ordering of an AR32W machine
40 * F_PATCH file contains "patch" list in optional header
41 * F_NODF (minimal file only) no decision functions for
45 #define COFF_F_RELFLG 0000001
46 #define COFF_F_EXEC 0000002
47 #define COFF_F_LNNO 0000004
48 #define COFF_F_LSYMS 0000010
49 #define COFF_F_MINMAL 0000020
50 #define COFF_F_UPDATE 0000040
51 #define COFF_F_SWABD 0000100
52 #define COFF_F_AR16WR 0000200
53 #define COFF_F_AR32WR 0000400
54 #define COFF_F_AR32W 0001000
55 #define COFF_F_PATCH 0002000
56 #define COFF_F_NODF 0002000
58 typedef struct COFF_aouthdr_t {
59 uint16_t magic; /* type of file */
60 uint16_t vstamp; /* version stamp */
61 uint32_t tsize; /* text size in bytes, padded to FW bdry */
62 uint32_t dsize; /* initialized data " " */
63 uint32_t bsize; /* uninitialized data " " */
64 uint32_t entry; /* entry pt. */
65 uint32_t text_start; /* base of text used for this file */
66 uint32_t data_start; /* base of data used for this file */
67 uint32_t o_toc; /* address of TOC */
68 uint16_t o_snentry; /* section number of entry point */
69 uint16_t o_sntext; /* section number of .text section */
70 uint16_t o_sndata; /* section number of .data section */
71 uint16_t o_sntoc; /* section number of TOC */
72 uint16_t o_snloader; /* section number of .loader section */
73 uint16_t o_snbss; /* section number of .bss section */
74 uint16_t o_algntext; /* .text alignment */
75 uint16_t o_algndata; /* .data alignment */
76 uint16_t o_modtype; /* module type (??) */
77 uint16_t o_cputype; /* cpu type */
78 uint32_t o_maxstack; /* max stack size (??) */
79 uint32_t o_maxdata; /* max data size (??) */
80 char o_resv2[12]; /* reserved */
83 #define AOUT_MAGIC 0x010b
85 typedef struct COFF_scnhdr_t {
86 char s_name[8]; /* section name */
87 uint32_t s_paddr; /* physical address, aliased s_nlib */
88 uint32_t s_vaddr; /* virtual address */
89 uint32_t s_size; /* section size */
90 uint32_t s_scnptr; /* file ptr to raw data for section */
91 uint32_t s_relptr; /* file ptr to relocation */
92 uint32_t s_lnnoptr; /* file ptr to line numbers */
93 uint16_t s_nreloc; /* number of relocation entries */
94 uint16_t s_nlnno; /* number of line number entries */
95 uint32_t s_flags; /* flags */