Support for accessing arbitrary MIPS stack frames in memory.
[deliverable/binutils-gdb.git] / include / coff-mips.h
1 /* Rudimentary ECOFF support on MIPS machines.
2 This lacks symbol information, normally provided on MIPS Unix systems
3 in the files <sym.h> and <symconst.h>. */
4
5 /********************** FILE HEADER **********************/
6
7 struct external_filehdr {
8 char f_magic[2]; /* magic number */
9 char f_nscns[2]; /* number of sections */
10 char f_timdat[4]; /* time & date stamp */
11 char f_symptr[4]; /* file pointer to symtab */
12 char f_nsyms[4]; /* number of symtab entries */
13 char f_opthdr[2]; /* sizeof(optional hdr) */
14 char f_flags[2]; /* flags */
15 };
16
17
18 /* Mips magics */
19 #define MIPS_MAGIC_1 0x0180
20 #define MIPS_MAGIC_2 0x0162
21 #define MIPS_MAGIC_3 0x0160
22
23 #define ECOFFBADMAG(x) (((x).f_magic!=MIPS_MAGIC_1) && \
24 ((x).f_magic!=MIPS_MAGIC_2) &&\
25 ((x).f_magic!=MIPS_MAGIC_3))
26
27
28 #define FILHDR struct external_filehdr
29 #define FILHSZ 20
30
31 /********************** AOUT "OPTIONAL HEADER" **********************/
32
33
34 typedef struct external_aouthdr
35 {
36 char magic[2]; /* type of file */
37 char vstamp[2]; /* version stamp */
38 char tsize[4]; /* text size in bytes, padded to FW bdry*/
39 char dsize[4]; /* initialized data " " */
40 char bsize[4]; /* uninitialized data " " */
41 char entry[4]; /* entry pt. */
42 char text_start[4]; /* base of text used for this file */
43 char data_start[4]; /* base of data used for this file */
44 } AOUTHDR;
45
46 /* compute size of a header */
47
48 #define AOUTSZ (sizeof(AOUTHDR))
49
50
51 /********************** SECTION HEADER **********************/
52
53 struct external_scnhdr {
54 char s_name[8]; /* section name */
55 char s_paddr[4]; /* physical address, aliased s_nlib */
56 char s_vaddr[4]; /* virtual address */
57 char s_size[4]; /* section size */
58 char s_scnptr[4]; /* file ptr to raw data for section */
59 char s_relptr[4]; /* file ptr to relocation */
60 char s_lnnoptr[4]; /* file ptr to line numbers */
61 char s_nreloc[2]; /* number of relocation entries */
62 char s_nlnno[2]; /* number of line number entries*/
63 char s_flags[4]; /* flags */
64 };
65
66 #define SCNHDR struct external_scnhdr
67 #define SCNHSZ sizeof(SCNHDR)
68
69 /*
70 * names of "special" sections
71 */
72 #define _TEXT ".text"
73 #define _DATA ".data"
74 #define _BSS ".bss"
75
76 #define DEFAULT_DATA_SECTION_ALIGNMENT 4
77 #define DEFAULT_BSS_SECTION_ALIGNMENT 4
78 #define DEFAULT_TEXT_SECTION_ALIGNMENT 16
79 /* For new sections we havn't heard of before */
80 #define DEFAULT_SECTION_ALIGNMENT 4
81
82 /********************** RELOCATION DIRECTIVES **********************/
83
84 struct external_reloc {
85 char r_vaddr[4];
86 char r_symndx[4];
87 char r_type[2];
88 char pad[2];
89 };
90
91
92 /* Relevent values for r_type and ecoff. Would someone please document them */
93
94 #define RELOC struct external_reloc
95 #define RELSZ 12
This page took 0.036948 seconds and 4 git commands to generate.