1 /*** coff information for Windows CE with MIPS VR4111 */
3 /********************** FILE HEADER **********************/
5 struct external_filehdr
{
6 char f_magic
[2]; /* magic number */
7 char f_nscns
[2]; /* number of sections */
8 char f_timdat
[4]; /* time & date stamp */
9 char f_symptr
[4]; /* file pointer to symtab */
10 char f_nsyms
[4]; /* number of symtab entries */
11 char f_opthdr
[2]; /* sizeof(optional hdr) */
12 char f_flags
[2]; /* flags */
17 #define MIPS_ARCH_MAGIC_WINCE 0x0166 /* Windows CE - little endian */
20 #define MIPSBADMAG(x) \
21 ((x).f_magic!=MIPS_ARCH_MAGIC_WINCE)
23 #define FILHDR struct external_filehdr
27 /********************** AOUT "OPTIONAL HEADER" **********************/
32 char magic
[2]; /* type of file */
33 char vstamp
[2]; /* version stamp */
34 char tsize
[4]; /* text size in bytes, padded to FW bdry*/
35 char dsize
[4]; /* initialized data " " */
36 char bsize
[4]; /* uninitialized data " " */
37 char entry
[4]; /* entry pt. */
38 char text_start
[4]; /* base of text used for this file */
39 char data_start
[4]; /* base of data used for this file */
50 /* define some NT default values */
51 /* #define NT_IMAGE_BASE 0x400000 moved to internal.h */
52 #define NT_SECTION_ALIGNMENT 0x1000
53 #define NT_FILE_ALIGNMENT 0x200
54 #define NT_DEF_RESERVE 0x100000
55 #define NT_DEF_COMMIT 0x1000
57 /********************** SECTION HEADER **********************/
60 struct external_scnhdr
{
61 char s_name
[8]; /* section name */
62 char s_paddr
[4]; /* physical address, aliased s_nlib */
63 char s_vaddr
[4]; /* virtual address */
64 char s_size
[4]; /* section size */
65 char s_scnptr
[4]; /* file ptr to raw data for section */
66 char s_relptr
[4]; /* file ptr to relocation */
67 char s_lnnoptr
[4]; /* file ptr to line numbers */
68 char s_nreloc
[2]; /* number of relocation entries */
69 char s_nlnno
[2]; /* number of line number entries*/
70 char s_flags
[4]; /* flags */
74 * names of "special" sections
81 #define SCNHDR struct external_scnhdr
85 /********************** LINE NUMBERS **********************/
87 /* 1 line number entry for every "breakpointable" source line in a section.
88 * Line numbers are grouped on a per function basis; first entry in a function
89 * grouping will have l_lnno = 0 and in place of physical address will be the
90 * symbol table index of the function name.
92 struct external_lineno
{
94 char l_symndx
[4]; /* function name symbol index, iff l_lnno == 0*/
95 char l_paddr
[4]; /* (physical) address of line number */
97 char l_lnno
[2]; /* line number */
100 #define GET_LINENO_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) (ext->l_lnno));
101 #define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_16(abfd,val, (bfd_byte *) (ext->l_lnno));
103 #define LINENO struct external_lineno
107 /********************** SYMBOLS **********************/
109 #define E_SYMNMLEN 8 /* # characters in a symbol name */
110 #define E_FILNMLEN 14 /* # characters in a file name */
111 #define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
113 struct external_syment
116 char e_name
[E_SYMNMLEN
];
131 #define N_BTMASK (017)
132 #define N_TMASK (060)
137 union external_auxent
{
139 char x_tagndx
[4]; /* str, un, or enum tag indx */
142 char x_lnno
[2]; /* declaration line number */
143 char x_size
[2]; /* str/union/array size */
145 char x_fsize
[4]; /* size of function */
148 struct { /* if ISFCN, tag, or .bb */
149 char x_lnnoptr
[4]; /* ptr to fcn line # */
150 char x_endndx
[4]; /* entry ndx past block end */
152 struct { /* if ISARY, up to 4 dimen. */
153 char x_dimen
[E_DIMNUM
][2];
156 char x_tvndx
[2]; /* tv index */
160 char x_fname
[E_FILNMLEN
];
168 char x_scnlen
[4]; /* section length */
169 char x_nreloc
[2]; /* # relocation entries */
170 char x_nlinno
[2]; /* # line numbers */
171 char x_checksum
[4]; /* section COMDAT checksum */
172 char x_associated
[2]; /* COMDAT associated section index */
173 char x_comdat
[1]; /* COMDAT selection number */
177 char x_tvfill
[4]; /* tv fill value */
178 char x_tvlen
[2]; /* length of .tv */
179 char x_tvran
[2][2]; /* tv range */
180 } x_tv
; /* info about .tv section (in auxent of symbol .tv)) */
185 #define SYMENT struct external_syment
187 #define AUXENT union external_auxent
192 /********************** RELOCATION DIRECTIVES **********************/
194 /* The external reloc has an offset field, because some of the reloc
195 types on the h8 don't have room in the instruction for the entire
196 offset - eg the strange jump and high page addressing modes */
198 struct external_reloc
{
205 #define RELOC struct external_reloc
208 /* MIPS PE relocation types. */
210 #define MIPS_R_ABSOLUTE 0 /* ignored */
211 #define MIPS_R_REFHALF 1
212 #define MIPS_R_REFWORD 2
213 #define MIPS_R_JMPADDR 3
214 #define MIPS_R_REFHI 4 /* PAIR follows */
215 #define MIPS_R_REFLO 5
216 #define MIPS_R_GPREL 6
217 #define MIPS_R_LITERAL 7 /* same as GPREL */
218 #define MIPS_R_SECTION 10
219 #define MIPS_R_SECREL 11
220 #define MIPS_R_SECRELLO 12
221 #define MIPS_R_SECRELHI 13 /* PAIR follows */
222 #define MIPS_R_RVA 34 /* 0x22 */
223 #define MIPS_R_PAIR 37 /* 0x25 - symndx is really a signed 16-bit addend */