]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/gdb/include/coff/arm.h
System Perl is now 5.00503! There is support for threads, but this is
[FreeBSD/FreeBSD.git] / contrib / gdb / include / coff / arm.h
1 /*** coff information for the ARM */
2
3
4 /********************** FILE HEADER **********************/
5
6 struct external_filehdr {
7         char f_magic[2];        /* magic number                 */
8         char f_nscns[2];        /* number of sections           */
9         char f_timdat[4];       /* time & date stamp            */
10         char f_symptr[4];       /* file pointer to symtab       */
11         char f_nsyms[4];        /* number of symtab entries     */
12         char f_opthdr[2];       /* sizeof(optional hdr)         */
13         char f_flags[2];        /* flags                        */
14 };
15
16 /* Bits for f_flags:
17  *      F_RELFLG        relocation info stripped from file
18  *      F_EXEC          file is executable (no unresolved external references)
19  *      F_LNNO          line numbers stripped from file
20  *      F_LSYMS         local symbols stripped from file
21  *      F_AR32WR        file has byte ordering of an AR32WR machine (e.g. vax)
22  */
23
24 #define F_RELFLG        (0x0001)
25 #define F_EXEC          (0x0002)
26 #define F_LNNO          (0x0004)
27 #define F_LSYMS         (0x0008)
28
29
30
31 #define ARMMAGIC        0xa00  /* I just made these up */
32
33 #define ARMBADMAG(x) (((x).f_magic != ARMMAGIC))
34
35 #define FILHDR  struct external_filehdr
36 #define FILHSZ  sizeof(FILHDR)
37
38
39 /********************** AOUT "OPTIONAL HEADER" **********************/
40
41
42 typedef struct 
43 {
44   char  magic[2];               /* type of file                         */
45   char  vstamp[2];              /* version stamp                        */
46   char  tsize[4];               /* text size in bytes, padded to FW bdry*/
47   char  dsize[4];               /* initialized data "  "                */
48   char  bsize[4];               /* uninitialized data "   "             */
49   char  entry[4];               /* entry pt.                            */
50   char  text_start[4];          /* base of text used for this file */
51   char  data_start[4];          /* base of data used for this file */
52
53
54 }
55 AOUTHDR;
56
57
58 #define AOUTSZ (sizeof(AOUTHDR))
59
60 #define OMAGIC          0404    /* object files, eg as output */
61 #define ZMAGIC          0413    /* demand load format, eg normal ld output */
62 #define STMAGIC         0401    /* target shlib */
63 #define SHMAGIC         0443    /* host   shlib */
64
65
66 /* define some NT default values */
67 /*  #define NT_IMAGE_BASE        0x400000 moved to internal.h */
68 #define NT_SECTION_ALIGNMENT 0x1000
69 #define NT_FILE_ALIGNMENT    0x200  
70 #define NT_DEF_RESERVE       0x100000
71 #define NT_DEF_COMMIT        0x1000
72
73 /********************** SECTION HEADER **********************/
74
75
76 struct external_scnhdr {
77         char            s_name[8];      /* section name                 */
78         char            s_paddr[4];     /* physical address, aliased s_nlib */
79         char            s_vaddr[4];     /* virtual address              */
80         char            s_size[4];      /* section size                 */
81         char            s_scnptr[4];    /* file ptr to raw data for section */
82         char            s_relptr[4];    /* file ptr to relocation       */
83         char            s_lnnoptr[4];   /* file ptr to line numbers     */
84         char            s_nreloc[2];    /* number of relocation entries */
85         char            s_nlnno[2];     /* number of line number entries*/
86         char            s_flags[4];     /* flags                        */
87 };
88
89 #define SCNHDR  struct external_scnhdr
90 #define SCNHSZ  sizeof(SCNHDR)
91
92 /*
93  * names of "special" sections
94  */
95 #define _TEXT   ".text"
96 #define _DATA   ".data"
97 #define _BSS    ".bss"
98 #define _COMMENT ".comment"
99 #define _LIB ".lib"
100
101 /********************** LINE NUMBERS **********************/
102
103 /* 1 line number entry for every "breakpointable" source line in a section.
104  * Line numbers are grouped on a per function basis; first entry in a function
105  * grouping will have l_lnno = 0 and in place of physical address will be the
106  * symbol table index of the function name.
107  */
108 struct external_lineno {
109         union {
110                 char l_symndx[4];       /* function name symbol index, iff l_lnno == 0*/
111                 char l_paddr[4];        /* (physical) address of line number    */
112         } l_addr;
113         char l_lnno[2]; /* line number          */
114 };
115
116
117 #define LINENO  struct external_lineno
118 #define LINESZ  6
119
120
121 /********************** SYMBOLS **********************/
122
123 #define E_SYMNMLEN      8       /* # characters in a symbol name        */
124 #define E_FILNMLEN      14      /* # characters in a file name          */
125 #define E_DIMNUM        4       /* # array dimensions in auxiliary entry */
126
127 struct external_syment 
128 {
129   union {
130     char e_name[E_SYMNMLEN];
131     struct {
132       char e_zeroes[4];
133       char e_offset[4];
134     } e;
135   } e;
136   char e_value[4];
137   char e_scnum[2];
138   char e_type[2];
139   char e_sclass[1];
140   char e_numaux[1];
141 };
142
143 #define N_BTMASK        (0xf)
144 #define N_TMASK         (0x30)
145 #define N_BTSHFT        (4)
146 #define N_TSHIFT        (2)
147   
148 union external_auxent {
149         struct {
150                 char x_tagndx[4];       /* str, un, or enum tag indx */
151                 union {
152                         struct {
153                             char  x_lnno[2]; /* declaration line number */
154                             char  x_size[2]; /* str/union/array size */
155                         } x_lnsz;
156                         char x_fsize[4];        /* size of function */
157                 } x_misc;
158                 union {
159                         struct {                /* if ISFCN, tag, or .bb */
160                             char x_lnnoptr[4];  /* ptr to fcn line # */
161                             char x_endndx[4];   /* entry ndx past block end */
162                         } x_fcn;
163                         struct {                /* if ISARY, up to 4 dimen. */
164                             char x_dimen[E_DIMNUM][2];
165                         } x_ary;
166                 } x_fcnary;
167                 char x_tvndx[2];                /* tv index */
168         } x_sym;
169
170         union {
171                 char x_fname[E_FILNMLEN];
172                 struct {
173                         char x_zeroes[4];
174                         char x_offset[4];
175                 } x_n;
176         } x_file;
177
178         struct {
179                 char x_scnlen[4];                       /* section length */
180                 char x_nreloc[2];       /* # relocation entries */
181                 char x_nlinno[2];       /* # line numbers */
182         } x_scn;
183
184         struct {
185                 char x_tvfill[4];       /* tv fill value */
186                 char x_tvlen[2];        /* length of .tv */
187                 char x_tvran[2][2];     /* tv range */
188         } x_tv;         /* info about .tv section (in auxent of symbol .tv)) */
189
190
191 };
192
193 #define SYMENT  struct external_syment
194 #define SYMESZ  18      
195 #define AUXENT  union external_auxent
196 #define AUXESZ  18
197
198
199 #       define _ETEXT   "etext"
200
201
202 /********************** RELOCATION DIRECTIVES **********************/
203
204
205
206 struct external_reloc {
207   char r_vaddr[4];
208   char r_symndx[4];
209   char r_type[2];
210   char r_offset[4];
211 };
212
213
214 #define RELOC struct external_reloc
215 #define RELSZ sizeof (RELOC)