PR ld/14357
[deliverable/binutils-gdb.git] / bfd / coff-tic54x.c
CommitLineData
81635ce4 1/* BFD back-end for TMS320C54X coff binaries.
45dfa85a 2 Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2011, 2012
d003868e 3 Free Software Foundation, Inc.
a44f2895 4 Contributed by Timothy Wall (twall@cygnus.com)
81635ce4
TW
5
6 This file is part of BFD, the Binary File Descriptor library.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
cd123cb7 10 the Free Software Foundation; either version 3 of the License, or
81635ce4
TW
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
3e110533 20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
53e09e0a 21 02110-1301, USA. */
81635ce4 22
81635ce4 23#include "sysdep.h"
3db64b00 24#include "bfd.h"
81635ce4
TW
25#include "libbfd.h"
26#include "bfdlink.h"
27#include "coff/tic54x.h"
28#include "coff/internal.h"
29#include "libcoff.h"
30
f4ffd778 31#undef F_LSYMS
81635ce4
TW
32#define F_LSYMS F_LSYMS_TICOFF
33
b34976b6
AM
34static void tic54x_reloc_processing
35 PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
36static bfd_reloc_status_type tic54x_relocation
37 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
38static bfd_boolean tic54x_set_section_contents
0f867abe 39 PARAMS ((bfd *, sec_ptr, const PTR, file_ptr, bfd_size_type));
b34976b6
AM
40static reloc_howto_type *coff_tic54x_rtype_to_howto
41 PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *));
b34976b6
AM
42static bfd_boolean tic54x_set_arch_mach
43 PARAMS ((bfd *, enum bfd_architecture, unsigned long));
44static reloc_howto_type * tic54x_coff_reloc_type_lookup
45 PARAMS ((bfd *, bfd_reloc_code_real_type));
46static void tic54x_lookup_howto
47 PARAMS ((arelent *, struct internal_reloc *));
b34976b6
AM
48static bfd_boolean ticoff_bfd_is_local_label_name
49 PARAMS ((bfd *, const char *));
f4ffd778
NC
50
51/* 32-bit operations
52 The octet order is screwy. words are LSB first (LS octet, actually), but
53 longwords are MSW first. For example, 0x12345678 is encoded 0x5678 in the
54 first word and 0x1234 in the second. When looking at the data as stored in
55 the COFF file, you would see the octets ordered as 0x78, 0x56, 0x34, 0x12.
56 Don't bother with 64-bits, as there aren't any. */
57
81635ce4 58static bfd_vma
edeb6e24 59tic54x_getl32 (const void *p)
81635ce4 60{
edeb6e24 61 const bfd_byte *addr = p;
81635ce4 62 unsigned long v;
f4ffd778
NC
63
64 v = (unsigned long) addr[2];
81635ce4
TW
65 v |= (unsigned long) addr[3] << 8;
66 v |= (unsigned long) addr[0] << 16;
67 v |= (unsigned long) addr[1] << 24;
edeb6e24 68 return v;
81635ce4
TW
69}
70
71static void
edeb6e24 72tic54x_putl32 (bfd_vma data, void *p)
81635ce4 73{
edeb6e24
AM
74 bfd_byte *addr = p;
75 addr[2] = data & 0xff;
76 addr[3] = (data >> 8) & 0xff;
77 addr[0] = (data >> 16) & 0xff;
78 addr[1] = (data >> 24) & 0xff;
81635ce4
TW
79}
80
edeb6e24
AM
81static bfd_signed_vma
82tic54x_getl_signed_32 (const void *p)
81635ce4 83{
edeb6e24 84 const bfd_byte *addr = p;
81635ce4
TW
85 unsigned long v;
86
f4ffd778 87 v = (unsigned long) addr[2];
81635ce4
TW
88 v |= (unsigned long) addr[3] << 8;
89 v |= (unsigned long) addr[0] << 16;
90 v |= (unsigned long) addr[1] << 24;
91#define COERCE32(x) \
92 ((bfd_signed_vma) (long) (((unsigned long) (x) ^ 0x80000000) - 0x80000000))
93 return COERCE32 (v);
94}
95
b9af77f5
TW
96#define coff_get_section_load_page bfd_ticoff_get_section_load_page
97#define coff_set_section_load_page bfd_ticoff_set_section_load_page
98
cbfe05c4 99void
b9af77f5
TW
100bfd_ticoff_set_section_load_page (sect, page)
101 asection *sect;
102 int page;
103{
104 sect->lma = (sect->lma & ADDR_MASK) | PG_TO_FLAG(page);
105}
106
b9af77f5
TW
107int
108bfd_ticoff_get_section_load_page (sect)
109 asection *sect;
110{
111 int page;
112
cbfe05c4 113 /* Provide meaningful defaults for predefined sections. */
45dfa85a 114 if (sect == bfd_com_section_ptr)
b9af77f5
TW
115 page = PG_DATA;
116
45dfa85a
AM
117 else if (bfd_is_und_section (sect)
118 || bfd_is_abs_section (sect)
119 || bfd_is_ind_section (sect))
b9af77f5
TW
120 page = PG_PROG;
121
122 else
123 page = FLAG_TO_PG (sect->lma);
124
125 return page;
126}
127
128/* Set the architecture appropriately. Allow unkown architectures
cbfe05c4 129 (e.g. binary). */
f4ffd778 130
b34976b6 131static bfd_boolean
b9af77f5
TW
132tic54x_set_arch_mach (abfd, arch, machine)
133 bfd *abfd;
134 enum bfd_architecture arch;
135 unsigned long machine;
136{
137 if (arch == bfd_arch_unknown)
138 arch = bfd_arch_tic54x;
139
140 else if (arch != bfd_arch_tic54x)
b34976b6 141 return FALSE;
b9af77f5
TW
142
143 return bfd_default_set_arch_mach (abfd, arch, machine);
144}
145
81635ce4 146static bfd_reloc_status_type
cbfe05c4 147tic54x_relocation (abfd, reloc_entry, symbol, data, input_section,
81635ce4
TW
148 output_bfd, error_message)
149 bfd *abfd ATTRIBUTE_UNUSED;
150 arelent *reloc_entry;
151 asymbol *symbol ATTRIBUTE_UNUSED;
152 PTR data ATTRIBUTE_UNUSED;
153 asection *input_section;
154 bfd *output_bfd;
155 char **error_message ATTRIBUTE_UNUSED;
156{
81635ce4
TW
157 if (output_bfd != (bfd *) NULL)
158 {
159 /* This is a partial relocation, and we want to apply the
160 relocation to the reloc entry rather than the raw data.
161 Modify the reloc inplace to reflect what we now know. */
162 reloc_entry->address += input_section->output_offset;
163 return bfd_reloc_ok;
164 }
165 return bfd_reloc_continue;
166}
167
168reloc_howto_type tic54x_howto_table[] =
f4ffd778
NC
169 {
170 /* type,rightshift,size (0=byte, 1=short, 2=long),
171 bit size, pc_relative, bitpos, dont complain_on_overflow,
172 special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset. */
173
174 /* NORMAL BANK */
175 /* 16-bit direct reference to symbol's address. */
b34976b6
AM
176 HOWTO (R_RELWORD,0,1,16,FALSE,0,complain_overflow_dont,
177 tic54x_relocation,"REL16",FALSE,0xFFFF,0xFFFF,FALSE),
f4ffd778
NC
178
179 /* 7 LSBs of an address */
b34976b6
AM
180 HOWTO (R_PARTLS7,0,1,7,FALSE,0,complain_overflow_dont,
181 tic54x_relocation,"LS7",FALSE,0x007F,0x007F,FALSE),
f4ffd778
NC
182
183 /* 9 MSBs of an address */
184 /* TI assembler doesn't shift its encoding, and is thus incompatible */
b34976b6
AM
185 HOWTO (R_PARTMS9,7,1,9,FALSE,0,complain_overflow_dont,
186 tic54x_relocation,"MS9",FALSE,0x01FF,0x01FF,FALSE),
f4ffd778
NC
187
188 /* 23-bit relocation */
b34976b6
AM
189 HOWTO (R_EXTWORD,0,2,23,FALSE,0,complain_overflow_dont,
190 tic54x_relocation,"RELEXT",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
f4ffd778
NC
191
192 /* 16 bits of 23-bit extended address */
b34976b6
AM
193 HOWTO (R_EXTWORD16,0,1,16,FALSE,0,complain_overflow_dont,
194 tic54x_relocation,"RELEXT16",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
f4ffd778
NC
195
196 /* upper 7 bits of 23-bit extended address */
b34976b6
AM
197 HOWTO (R_EXTWORDMS7,16,1,7,FALSE,0,complain_overflow_dont,
198 tic54x_relocation,"RELEXTMS7",FALSE,0x7F,0x7F,FALSE),
f4ffd778
NC
199
200 /* ABSOLUTE BANK */
201 /* 16-bit direct reference to symbol's address, absolute */
b34976b6
AM
202 HOWTO (R_RELWORD,0,1,16,FALSE,0,complain_overflow_dont,
203 tic54x_relocation,"AREL16",FALSE,0xFFFF,0xFFFF,FALSE),
f4ffd778
NC
204
205 /* 7 LSBs of an address, absolute */
b34976b6
AM
206 HOWTO (R_PARTLS7,0,1,7,FALSE,0,complain_overflow_dont,
207 tic54x_relocation,"ALS7",FALSE,0x007F,0x007F,FALSE),
f4ffd778
NC
208
209 /* 9 MSBs of an address, absolute */
210 /* TI assembler doesn't shift its encoding, and is thus incompatible */
b34976b6
AM
211 HOWTO (R_PARTMS9,7,1,9,FALSE,0,complain_overflow_dont,
212 tic54x_relocation,"AMS9",FALSE,0x01FF,0x01FF,FALSE),
f4ffd778
NC
213
214 /* 23-bit direct reference, absolute */
b34976b6
AM
215 HOWTO (R_EXTWORD,0,2,23,FALSE,0,complain_overflow_dont,
216 tic54x_relocation,"ARELEXT",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
f4ffd778
NC
217
218 /* 16 bits of 23-bit extended address, absolute */
b34976b6
AM
219 HOWTO (R_EXTWORD16,0,1,16,FALSE,0,complain_overflow_dont,
220 tic54x_relocation,"ARELEXT16",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
f4ffd778
NC
221
222 /* upper 7 bits of 23-bit extended address, absolute */
b34976b6
AM
223 HOWTO (R_EXTWORDMS7,16,1,7,FALSE,0,complain_overflow_dont,
224 tic54x_relocation,"ARELEXTMS7",FALSE,0x7F,0x7F,FALSE),
f4ffd778
NC
225
226 /* 32-bit relocation exclusively for stabs */
b34976b6
AM
227 HOWTO (R_RELLONG,0,2,32,FALSE,0,complain_overflow_dont,
228 tic54x_relocation,"STAB",FALSE,0xFFFFFFFF,0xFFFFFFFF,FALSE),
f4ffd778 229 };
81635ce4
TW
230
231#define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup
157090f7 232#define coff_bfd_reloc_name_lookup tic54x_coff_reloc_name_lookup
81635ce4
TW
233
234/* For the case statement use the code values used tc_gen_reloc (defined in
f4ffd778
NC
235 bfd/reloc.c) to map to the howto table entries. */
236
81635ce4
TW
237reloc_howto_type *
238tic54x_coff_reloc_type_lookup (abfd, code)
239 bfd *abfd ATTRIBUTE_UNUSED;
240 bfd_reloc_code_real_type code;
241{
242 switch (code)
243 {
244 case BFD_RELOC_16:
245 return &tic54x_howto_table[0];
246 case BFD_RELOC_TIC54X_PARTLS7:
247 return &tic54x_howto_table[1];
248 case BFD_RELOC_TIC54X_PARTMS9:
249 return &tic54x_howto_table[2];
250 case BFD_RELOC_TIC54X_23:
251 return &tic54x_howto_table[3];
252 case BFD_RELOC_TIC54X_16_OF_23:
253 return &tic54x_howto_table[4];
254 case BFD_RELOC_TIC54X_MS7_OF_23:
255 return &tic54x_howto_table[5];
256 case BFD_RELOC_32:
257 return &tic54x_howto_table[12];
258 default:
259 return (reloc_howto_type *) NULL;
260 }
261}
262
157090f7
AM
263static reloc_howto_type *
264tic54x_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
265 const char *r_name)
266{
267 unsigned int i;
268
269 for (i = 0;
270 i < sizeof (tic54x_howto_table) / sizeof (tic54x_howto_table[0]);
271 i++)
272 if (tic54x_howto_table[i].name != NULL
273 && strcasecmp (tic54x_howto_table[i].name, r_name) == 0)
274 return &tic54x_howto_table[i];
275
276 return NULL;
277}
278
cbfe05c4 279/* Code to turn a r_type into a howto ptr, uses the above howto table.
f4ffd778
NC
280 Called after some initial checking by the tic54x_rtype_to_howto fn below. */
281
81635ce4
TW
282static void
283tic54x_lookup_howto (internal, dst)
284 arelent *internal;
285 struct internal_reloc *dst;
286{
287 unsigned i;
288 int bank = (dst->r_symndx == -1) ? HOWTO_BANK : 0;
f4ffd778 289
81635ce4
TW
290 for (i = 0; i < sizeof tic54x_howto_table/sizeof tic54x_howto_table[0]; i++)
291 {
292 if (tic54x_howto_table[i].type == dst->r_type)
293 {
294 internal->howto = tic54x_howto_table + i + bank;
295 return;
296 }
297 }
298
299 (*_bfd_error_handler) (_("Unrecognized reloc type 0x%x"),
300 (unsigned int) dst->r_type);
cbfe05c4 301 abort ();
81635ce4
TW
302}
303
304#define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\
305 tic54x_reloc_processing(RELENT,RELOC,SYMS,ABFD,SECT)
306
81635ce4
TW
307#define coff_rtype_to_howto coff_tic54x_rtype_to_howto
308
309static reloc_howto_type *
310coff_tic54x_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
311 bfd *abfd ATTRIBUTE_UNUSED;
312 asection *sec;
313 struct internal_reloc *rel;
314 struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
315 struct internal_syment *sym ATTRIBUTE_UNUSED;
316 bfd_vma *addendp;
317{
318 arelent genrel;
319
320 if (rel->r_symndx == -1 && addendp != NULL)
321 {
322 /* This is a TI "internal relocation", which means that the relocation
323 amount is the amount by which the current section is being relocated
cbfe05c4 324 in the output section. */
81635ce4
TW
325 *addendp = (sec->output_section->vma + sec->output_offset) - sec->vma;
326 }
327
328 tic54x_lookup_howto (&genrel, rel);
329
330 return genrel.howto;
331}
332
f4ffd778
NC
333/* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
334 labels. */
335
b34976b6 336static bfd_boolean
81635ce4
TW
337ticoff_bfd_is_local_label_name (abfd, name)
338 bfd *abfd ATTRIBUTE_UNUSED;
339 const char *name;
340{
341 if (TICOFF_LOCAL_LABEL_P(name))
b34976b6
AM
342 return TRUE;
343 return FALSE;
81635ce4
TW
344}
345
346#define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
347
9a5d8e72
L
348/* Clear the r_reserved field in relocs. */
349#define SWAP_OUT_RELOC_EXTRA(abfd,src,dst) \
350 do \
351 { \
352 dst->r_reserved[0] = 0; \
353 dst->r_reserved[1] = 0; \
354 } \
355 while (0)
356
cbfe05c4 357/* Customize coffcode.h; the default coff_ functions are set up to use COFF2;
81635ce4
TW
358 coff_bad_format_hook uses BADMAG, so set that for COFF2. The COFF1
359 and COFF0 vectors use custom _bad_format_hook procs instead of setting
f4ffd778 360 BADMAG. */
81635ce4 361#define BADMAG(x) COFF2_BADMAG(x)
2b5c217d
NC
362
363#ifndef bfd_pe_print_pdata
364#define bfd_pe_print_pdata NULL
365#endif
366
81635ce4
TW
367#include "coffcode.h"
368
b34976b6 369static bfd_boolean
b9af77f5
TW
370tic54x_set_section_contents (abfd, section, location, offset, bytes_to_do)
371 bfd *abfd;
372 sec_ptr section;
0f867abe 373 const PTR location;
b9af77f5
TW
374 file_ptr offset;
375 bfd_size_type bytes_to_do;
376{
cbfe05c4 377 return coff_set_section_contents (abfd, section, location,
b9af77f5
TW
378 offset, bytes_to_do);
379}
380
81635ce4
TW
381static void
382tic54x_reloc_processing (relent, reloc, symbols, abfd, section)
383 arelent *relent;
384 struct internal_reloc *reloc;
385 asymbol **symbols;
386 bfd *abfd;
387 asection *section;
388{
389 asymbol *ptr;
390
391 relent->address = reloc->r_vaddr;
cbfe05c4 392
81635ce4
TW
393 if (reloc->r_symndx != -1)
394 {
395 if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd))
396 {
397 (*_bfd_error_handler)
d003868e
AM
398 (_("%B: warning: illegal symbol index %ld in relocs"),
399 abfd, reloc->r_symndx);
81635ce4
TW
400 relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
401 ptr = NULL;
402 }
403 else
404 {
405 relent->sym_ptr_ptr = (symbols
406 + obj_convert (abfd)[reloc->r_symndx]);
407 ptr = *(relent->sym_ptr_ptr);
408 }
409 }
410 else
411 {
412 relent->sym_ptr_ptr = section->symbol_ptr_ptr;
413 ptr = *(relent->sym_ptr_ptr);
414 }
cbfe05c4 415
81635ce4
TW
416 /* The symbols definitions that we have read in have been
417 relocated as if their sections started at 0. But the offsets
418 refering to the symbols in the raw data have not been
419 modified, so we have to have a negative addend to compensate.
cbfe05c4 420
f4ffd778 421 Note that symbols which used to be common must be left alone. */
cbfe05c4 422
f4ffd778 423 /* Calculate any reloc addend by looking at the symbol. */
81635ce4 424 CALC_ADDEND (abfd, ptr, *reloc, relent);
cbfe05c4 425
81635ce4
TW
426 relent->address -= section->vma;
427 /* !! relent->section = (asection *) NULL;*/
cbfe05c4 428
f4ffd778 429 /* Fill in the relent->howto field from reloc->r_type. */
81635ce4
TW
430 tic54x_lookup_howto (relent, reloc);
431}
432
f4ffd778 433/* TI COFF v0, DOS tools (little-endian headers). */
81635ce4 434const bfd_target tic54x_coff0_vec =
f4ffd778
NC
435 {
436 "coff0-c54x", /* name */
437 bfd_target_coff_flavour,
438 BFD_ENDIAN_LITTLE, /* data byte order is little */
439 BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */
440
441 (HAS_RELOC | EXEC_P | /* object flags */
442 HAS_LINENO | HAS_DEBUG |
443 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
444
445 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
446 '_', /* leading symbol underscore */
447 '/', /* ar_pad_char */
448 15, /* ar_max_namelen */
0aabe54e 449 0, /* match priority. */
f4ffd778
NC
450 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
451 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
452 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
453 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
454 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
455 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
456
457 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
458 bfd_generic_archive_p, _bfd_dummy_target},
459 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
460 bfd_false},
461 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
462 _bfd_write_archive_contents, bfd_false},
463
464 BFD_JUMP_TABLE_GENERIC (coff),
465 BFD_JUMP_TABLE_COPY (coff),
466 BFD_JUMP_TABLE_CORE (_bfd_nocore),
467 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
468 BFD_JUMP_TABLE_SYMBOLS (coff),
469 BFD_JUMP_TABLE_RELOCS (coff),
470 BFD_JUMP_TABLE_WRITE (tic54x),
471 BFD_JUMP_TABLE_LINK (coff),
472 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
473 NULL,
474
475 (PTR) & ticoff0_swap_table
476 };
477
478/* TI COFF v0, SPARC tools (big-endian headers). */
81635ce4 479const bfd_target tic54x_coff0_beh_vec =
f4ffd778
NC
480 {
481 "coff0-beh-c54x", /* name */
482 bfd_target_coff_flavour,
483 BFD_ENDIAN_LITTLE, /* data byte order is little */
484 BFD_ENDIAN_BIG, /* header byte order is big */
485
486 (HAS_RELOC | EXEC_P | /* object flags */
487 HAS_LINENO | HAS_DEBUG |
488 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
489
490 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
491 '_', /* leading symbol underscore */
492 '/', /* ar_pad_char */
493 15, /* ar_max_namelen */
0aabe54e 494 0, /* match priority. */
f4ffd778
NC
495 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
496 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
497 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
498 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
499 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
500 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
501
502 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
503 bfd_generic_archive_p, _bfd_dummy_target},
504 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
505 bfd_false},
506 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
507 _bfd_write_archive_contents, bfd_false},
508
509 BFD_JUMP_TABLE_GENERIC (coff),
510 BFD_JUMP_TABLE_COPY (coff),
511 BFD_JUMP_TABLE_CORE (_bfd_nocore),
512 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
513 BFD_JUMP_TABLE_SYMBOLS (coff),
514 BFD_JUMP_TABLE_RELOCS (coff),
515 BFD_JUMP_TABLE_WRITE (tic54x),
516 BFD_JUMP_TABLE_LINK (coff),
517 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
518
519 & tic54x_coff0_vec,
520
521 (PTR) & ticoff0_swap_table
522 };
523
524/* TI COFF v1, DOS tools (little-endian headers). */
81635ce4 525const bfd_target tic54x_coff1_vec =
f4ffd778
NC
526 {
527 "coff1-c54x", /* name */
528 bfd_target_coff_flavour,
529 BFD_ENDIAN_LITTLE, /* data byte order is little */
530 BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */
531
532 (HAS_RELOC | EXEC_P | /* object flags */
533 HAS_LINENO | HAS_DEBUG |
534 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
535
536 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
537 '_', /* leading symbol underscore */
538 '/', /* ar_pad_char */
539 15, /* ar_max_namelen */
0aabe54e 540 0, /* match priority. */
f4ffd778
NC
541 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
542 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
543 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
544 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
545 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
546 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
547
548 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
549 bfd_generic_archive_p, _bfd_dummy_target},
550 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
551 bfd_false},
552 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
553 _bfd_write_archive_contents, bfd_false},
554
555 BFD_JUMP_TABLE_GENERIC (coff),
556 BFD_JUMP_TABLE_COPY (coff),
557 BFD_JUMP_TABLE_CORE (_bfd_nocore),
558 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
559 BFD_JUMP_TABLE_SYMBOLS (coff),
560 BFD_JUMP_TABLE_RELOCS (coff),
561 BFD_JUMP_TABLE_WRITE (tic54x),
562 BFD_JUMP_TABLE_LINK (coff),
563 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
564
565 & tic54x_coff0_beh_vec,
566
567 (PTR) & ticoff1_swap_table
81635ce4
TW
568};
569
f4ffd778 570/* TI COFF v1, SPARC tools (big-endian headers). */
81635ce4 571const bfd_target tic54x_coff1_beh_vec =
f4ffd778
NC
572 {
573 "coff1-beh-c54x", /* name */
574 bfd_target_coff_flavour,
575 BFD_ENDIAN_LITTLE, /* data byte order is little */
576 BFD_ENDIAN_BIG, /* header byte order is big */
577
578 (HAS_RELOC | EXEC_P | /* object flags */
579 HAS_LINENO | HAS_DEBUG |
580 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
581
582 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
583 '_', /* leading symbol underscore */
584 '/', /* ar_pad_char */
585 15, /* ar_max_namelen */
0aabe54e 586 0, /* match priority. */
f4ffd778
NC
587 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
588 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
589 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
590 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
591 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
592 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
593
594 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
595 bfd_generic_archive_p, _bfd_dummy_target},
596 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
597 bfd_false},
598 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
599 _bfd_write_archive_contents, bfd_false},
600
601 BFD_JUMP_TABLE_GENERIC (coff),
602 BFD_JUMP_TABLE_COPY (coff),
603 BFD_JUMP_TABLE_CORE (_bfd_nocore),
604 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
605 BFD_JUMP_TABLE_SYMBOLS (coff),
606 BFD_JUMP_TABLE_RELOCS (coff),
607 BFD_JUMP_TABLE_WRITE (tic54x),
608 BFD_JUMP_TABLE_LINK (coff),
609 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
610
611 & tic54x_coff1_vec,
612
613 (PTR) & ticoff1_swap_table
614 };
615
616/* TI COFF v2, TI DOS tools output (little-endian headers). */
81635ce4 617const bfd_target tic54x_coff2_vec =
f4ffd778
NC
618 {
619 "coff2-c54x", /* name */
620 bfd_target_coff_flavour,
621 BFD_ENDIAN_LITTLE, /* data byte order is little */
622 BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */
623
624 (HAS_RELOC | EXEC_P | /* object flags */
625 HAS_LINENO | HAS_DEBUG |
626 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
627
628 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
629 '_', /* leading symbol underscore */
630 '/', /* ar_pad_char */
631 15, /* ar_max_namelen */
0aabe54e 632 0, /* match priority. */
f4ffd778
NC
633 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
634 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
635 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
636 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
637 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
638 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
639
640 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
641 bfd_generic_archive_p, _bfd_dummy_target},
642 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
643 bfd_false},
644 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
645 _bfd_write_archive_contents, bfd_false},
646
647 BFD_JUMP_TABLE_GENERIC (coff),
648 BFD_JUMP_TABLE_COPY (coff),
649 BFD_JUMP_TABLE_CORE (_bfd_nocore),
650 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
651 BFD_JUMP_TABLE_SYMBOLS (coff),
652 BFD_JUMP_TABLE_RELOCS (coff),
653 BFD_JUMP_TABLE_WRITE (tic54x),
654 BFD_JUMP_TABLE_LINK (coff),
655 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
656
657 & tic54x_coff1_beh_vec,
658
659 COFF_SWAP_TABLE
660 };
661
662/* TI COFF v2, TI SPARC tools output (big-endian headers). */
81635ce4 663const bfd_target tic54x_coff2_beh_vec =
f4ffd778
NC
664 {
665 "coff2-beh-c54x", /* name */
666 bfd_target_coff_flavour,
667 BFD_ENDIAN_LITTLE, /* data byte order is little */
668 BFD_ENDIAN_BIG, /* header byte order is big */
669
670 (HAS_RELOC | EXEC_P | /* object flags */
671 HAS_LINENO | HAS_DEBUG |
672 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
673
674 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
675 '_', /* leading symbol underscore */
676 '/', /* ar_pad_char */
677 15, /* ar_max_namelen */
0aabe54e 678 0, /* match priority. */
f4ffd778
NC
679 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
680 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
681 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
682 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
683 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
684 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
685
686 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
687 bfd_generic_archive_p, _bfd_dummy_target},
688 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
689 bfd_false},
690 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
691 _bfd_write_archive_contents, bfd_false},
692
693 BFD_JUMP_TABLE_GENERIC (coff),
694 BFD_JUMP_TABLE_COPY (coff),
695 BFD_JUMP_TABLE_CORE (_bfd_nocore),
696 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
697 BFD_JUMP_TABLE_SYMBOLS (coff),
698 BFD_JUMP_TABLE_RELOCS (coff),
699 BFD_JUMP_TABLE_WRITE (tic54x),
700 BFD_JUMP_TABLE_LINK (coff),
701 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
702
703 & tic54x_coff2_vec,
704
705 COFF_SWAP_TABLE
706 };
This page took 0.65683 seconds and 4 git commands to generate.