6a677bc939102db27537986b2692be6d12cc800b
1 /*** coff information for TI TMS320C80 (MVP) */
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 */
13 char f_target_id
[2]; /* target id (TIc80 specific) */
18 #define TIC80_ARCH_MAGIC 0x0C1 /* Goes in the file header magic number field */
19 #define TIC80MAGIC 0x108 /* Goes in the optional file header magic number field */
22 #define TIC80BADMAG(x) ((x).f_magic != TIC80_ARCH_MAGIC)
24 #define FILHDR struct external_filehdr
28 /********************** AOUT "OPTIONAL HEADER" **********************/
33 char magic
[2]; /* type of file */
34 char vstamp
[2]; /* version stamp */
35 char tsize
[4]; /* text size in bytes, padded to FW bdry*/
36 char dsize
[4]; /* initialized data " " */
37 char bsize
[4]; /* uninitialized data " " */
38 char entry
[4]; /* entry pt. */
39 char text_start
[4]; /* base of text used for this file */
40 char data_start
[4]; /* base of data used for this file */
51 /********************** SECTION HEADER **********************/
54 struct external_scnhdr
{
55 char s_name
[8]; /* section name */
56 char s_paddr
[4]; /* physical address, aliased s_nlib */
57 char s_vaddr
[4]; /* virtual address */
58 char s_size
[4]; /* section size */
59 char s_scnptr
[4]; /* file ptr to raw data for section */
60 char s_relptr
[4]; /* file ptr to relocation */
61 char s_lnnoptr
[4]; /* file ptr to line numbers */
62 char s_nreloc
[2]; /* number of relocation entries */
63 char s_nlnno
[2]; /* number of line number entries*/
64 char s_flags
[2]; /* flags */
65 char s_reserved
[1]; /* reserved (TIc80 specific) */
66 char s_mempage
[1]; /* memory page number (TIc80) */
70 * names of "special" sections
75 #define _CINIT ".cinit"
76 #define _CONST ".const"
77 #define _SWITCH ".switch"
78 #define _STACK ".stack"
79 #define _SYSMEM ".sysmem"
82 #define SCNHDR struct external_scnhdr
86 /********************** LINE NUMBERS **********************/
88 /* 1 line number entry for every "breakpointable" source line in a section.
89 * Line numbers are grouped on a per function basis; first entry in a function
90 * grouping will have l_lnno = 0 and in place of physical address will be the
91 * symbol table index of the function name.
93 struct external_lineno
{
95 char l_symndx
[4]; /* function name symbol index, iff l_lnno == 0*/
96 char l_paddr
[4]; /* (physical) address of line number */
98 char l_lnno
[2]; /* line number */
101 #define GET_LINENO_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) (ext->l_lnno));
102 #define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_16(abfd,val, (bfd_byte *) (ext->l_lnno));
104 #define LINENO struct external_lineno
108 /********************** SYMBOLS **********************/
110 #define E_SYMNMLEN 8 /* # characters in a symbol name */
111 #define E_FILNMLEN 14 /* # characters in a file name */
112 #define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
114 struct external_syment
117 char e_name
[E_SYMNMLEN
];
132 #define N_BTMASK (017)
133 #define N_TMASK (060)
137 /* FIXME - need to correlate with TIc80 Code Generation Tools User's Guide, CG:A-25 */
138 union external_auxent
{
140 char x_tagndx
[4]; /* str, un, or enum tag indx */
143 char x_lnno
[2]; /* declaration line number */
144 char x_size
[2]; /* str/union/array size */
146 char x_fsize
[4]; /* size of function */
149 struct { /* if ISFCN, tag, or .bb */
150 char x_lnnoptr
[4]; /* ptr to fcn line # */
151 char x_endndx
[4]; /* entry ndx past block end */
153 struct { /* if ISARY, up to 4 dimen. */
154 char x_dimen
[E_DIMNUM
][2];
157 char x_tvndx
[2]; /* tv index */
161 char x_fname
[E_FILNMLEN
];
169 char x_scnlen
[4]; /* section length */
170 char x_nreloc
[2]; /* # relocation entries */
171 char x_nlinno
[2]; /* # line numbers */
175 char x_tvfill
[4]; /* tv fill value */
176 char x_tvlen
[2]; /* length of .tv */
177 char x_tvran
[2][2]; /* tv range */
178 } x_tv
; /* info about .tv section (in auxent of symbol .tv)) */
183 #define SYMENT struct external_syment
185 #define AUXENT union external_auxent
190 /********************** RELOCATION DIRECTIVES **********************/
192 /* The external reloc has an offset field, because some of the reloc
193 types on the h8 don't have room in the instruction for the entire
194 offset - eg the strange jump and high page addressing modes */
196 struct external_reloc
{
204 #define RELOC struct external_reloc
207 /* TIc80 relocation types. */
209 #define R_ABS 0x00 /* Absolute address - no relocation */
210 #define R_RELLONGX 0x11 /* PP: 32 bits, direct */
211 #define R_PPBASE 0x34 /* PP: Global base address type */
212 #define R_PPLBASE 0x35 /* PP: Local base address type */
213 #define R_PP15 0x38 /* PP: Global 15 bit offset */
214 #define R_PP15W 0x39 /* PP: Global 15 bit offset divided by 4 */
215 #define R_PP15H 0x3A /* PP: Global 15 bit offset divided by 2 */
216 #define R_PP16B 0x3B /* PP: Global 16 bit offset for bytes */
217 #define R_PPL15 0x3C /* PP: Local 15 bit offset */
218 #define R_PPL15W 0x3D /* PP: Local 15 bit offset divided by 4 */
219 #define R_PPL15H 0x3E /* PP: Local 15 bit offset divided by 2 */
220 #define R_PPL16B 0x03 /* PP: Local 16 bit offset for bytes */
221 #define R_PPN15 0x40 /* PP: Global 15 bit negative offset */
222 #define R_PPN15W 0x41 /* PP: Global 15 bit negative offset divided by 4 */
223 #define R_PPN15H 0x42 /* PP: Global 15 bit negative offset divided by 2 */
224 #define R_PPN16B 0x43 /* PP: Global 16 bit negative byte offset */
225 #define R_PPLN15 0x44 /* PP: Local 15 bit negative offset */
226 #define R_PPLN15W 0x45 /* PP: Local 15 bit negative offset divided by 4 */
227 #define R_PPLN15H 0x46 /* PP: Local 15 bit negative offset divided by 2 */
228 #define R_PPLN16B 0x47 /* PP: Local 16 bit negative byte offset */
229 #define R_MPPCR 0x4F /* MP: 32 bit PC-relative divided by 4 */
This page took 0.034242 seconds and 4 git commands to generate.