Reorder it.
[binutils.git] / bfd / coff-tic54x.c
blob316768e2dc646db95e0a26cc29d7d78e8e9c9b5b
1 /* BFD back-end for TMS320C54X coff binaries.
2 Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
3 Contributed by Timothy Wall (twall@cygnus.com)
5 This file is part of BFD, the Binary File Descriptor library.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
22 #include "bfd.h"
23 #include "sysdep.h"
24 #include "libbfd.h"
25 #include "bfdlink.h"
26 #include "coff/tic54x.h"
27 #include "coff/internal.h"
28 #include "libcoff.h"
30 #undef F_LSYMS
31 #define F_LSYMS F_LSYMS_TICOFF
33 static void tic54x_reloc_processing
34 PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
35 static bfd_reloc_status_type tic54x_relocation
36 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
37 static bfd_boolean tic54x_set_section_contents
38 PARAMS ((bfd *, sec_ptr, const PTR, file_ptr, bfd_size_type));
39 static reloc_howto_type *coff_tic54x_rtype_to_howto
40 PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *));
41 static bfd_boolean tic54x_set_arch_mach
42 PARAMS ((bfd *, enum bfd_architecture, unsigned long));
43 static reloc_howto_type * tic54x_coff_reloc_type_lookup
44 PARAMS ((bfd *, bfd_reloc_code_real_type));
45 static void tic54x_lookup_howto
46 PARAMS ((arelent *, struct internal_reloc *));
47 static bfd_boolean ticoff_bfd_is_local_label_name
48 PARAMS ((bfd *, const char *));
50 /* 32-bit operations
51 The octet order is screwy. words are LSB first (LS octet, actually), but
52 longwords are MSW first. For example, 0x12345678 is encoded 0x5678 in the
53 first word and 0x1234 in the second. When looking at the data as stored in
54 the COFF file, you would see the octets ordered as 0x78, 0x56, 0x34, 0x12.
55 Don't bother with 64-bits, as there aren't any. */
57 static bfd_vma
58 tic54x_getl32 (const void *p)
60 const bfd_byte *addr = p;
61 unsigned long v;
63 v = (unsigned long) addr[2];
64 v |= (unsigned long) addr[3] << 8;
65 v |= (unsigned long) addr[0] << 16;
66 v |= (unsigned long) addr[1] << 24;
67 return v;
70 static void
71 tic54x_putl32 (bfd_vma data, void *p)
73 bfd_byte *addr = p;
74 addr[2] = data & 0xff;
75 addr[3] = (data >> 8) & 0xff;
76 addr[0] = (data >> 16) & 0xff;
77 addr[1] = (data >> 24) & 0xff;
80 static bfd_signed_vma
81 tic54x_getl_signed_32 (const void *p)
83 const bfd_byte *addr = p;
84 unsigned long v;
86 v = (unsigned long) addr[2];
87 v |= (unsigned long) addr[3] << 8;
88 v |= (unsigned long) addr[0] << 16;
89 v |= (unsigned long) addr[1] << 24;
90 #define COERCE32(x) \
91 ((bfd_signed_vma) (long) (((unsigned long) (x) ^ 0x80000000) - 0x80000000))
92 return COERCE32 (v);
95 #define coff_get_section_load_page bfd_ticoff_get_section_load_page
96 #define coff_set_section_load_page bfd_ticoff_set_section_load_page
98 void
99 bfd_ticoff_set_section_load_page (sect, page)
100 asection *sect;
101 int page;
103 sect->lma = (sect->lma & ADDR_MASK) | PG_TO_FLAG(page);
107 bfd_ticoff_get_section_load_page (sect)
108 asection *sect;
110 int page;
112 /* Provide meaningful defaults for predefined sections. */
113 if (sect == &bfd_com_section)
114 page = PG_DATA;
116 else if (sect == &bfd_und_section
117 || sect == &bfd_abs_section
118 || sect == &bfd_ind_section)
119 page = PG_PROG;
121 else
122 page = FLAG_TO_PG (sect->lma);
124 return page;
127 /* Set the architecture appropriately. Allow unkown architectures
128 (e.g. binary). */
130 static bfd_boolean
131 tic54x_set_arch_mach (abfd, arch, machine)
132 bfd *abfd;
133 enum bfd_architecture arch;
134 unsigned long machine;
136 if (arch == bfd_arch_unknown)
137 arch = bfd_arch_tic54x;
139 else if (arch != bfd_arch_tic54x)
140 return FALSE;
142 return bfd_default_set_arch_mach (abfd, arch, machine);
145 static bfd_reloc_status_type
146 tic54x_relocation (abfd, reloc_entry, symbol, data, input_section,
147 output_bfd, error_message)
148 bfd *abfd ATTRIBUTE_UNUSED;
149 arelent *reloc_entry;
150 asymbol *symbol ATTRIBUTE_UNUSED;
151 PTR data ATTRIBUTE_UNUSED;
152 asection *input_section;
153 bfd *output_bfd;
154 char **error_message ATTRIBUTE_UNUSED;
156 if (output_bfd != (bfd *) NULL)
158 /* This is a partial relocation, and we want to apply the
159 relocation to the reloc entry rather than the raw data.
160 Modify the reloc inplace to reflect what we now know. */
161 reloc_entry->address += input_section->output_offset;
162 return bfd_reloc_ok;
164 return bfd_reloc_continue;
167 reloc_howto_type tic54x_howto_table[] =
169 /* type,rightshift,size (0=byte, 1=short, 2=long),
170 bit size, pc_relative, bitpos, dont complain_on_overflow,
171 special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset. */
173 /* NORMAL BANK */
174 /* 16-bit direct reference to symbol's address. */
175 HOWTO (R_RELWORD,0,1,16,FALSE,0,complain_overflow_dont,
176 tic54x_relocation,"REL16",FALSE,0xFFFF,0xFFFF,FALSE),
178 /* 7 LSBs of an address */
179 HOWTO (R_PARTLS7,0,1,7,FALSE,0,complain_overflow_dont,
180 tic54x_relocation,"LS7",FALSE,0x007F,0x007F,FALSE),
182 /* 9 MSBs of an address */
183 /* TI assembler doesn't shift its encoding, and is thus incompatible */
184 HOWTO (R_PARTMS9,7,1,9,FALSE,0,complain_overflow_dont,
185 tic54x_relocation,"MS9",FALSE,0x01FF,0x01FF,FALSE),
187 /* 23-bit relocation */
188 HOWTO (R_EXTWORD,0,2,23,FALSE,0,complain_overflow_dont,
189 tic54x_relocation,"RELEXT",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
191 /* 16 bits of 23-bit extended address */
192 HOWTO (R_EXTWORD16,0,1,16,FALSE,0,complain_overflow_dont,
193 tic54x_relocation,"RELEXT16",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
195 /* upper 7 bits of 23-bit extended address */
196 HOWTO (R_EXTWORDMS7,16,1,7,FALSE,0,complain_overflow_dont,
197 tic54x_relocation,"RELEXTMS7",FALSE,0x7F,0x7F,FALSE),
199 /* ABSOLUTE BANK */
200 /* 16-bit direct reference to symbol's address, absolute */
201 HOWTO (R_RELWORD,0,1,16,FALSE,0,complain_overflow_dont,
202 tic54x_relocation,"AREL16",FALSE,0xFFFF,0xFFFF,FALSE),
204 /* 7 LSBs of an address, absolute */
205 HOWTO (R_PARTLS7,0,1,7,FALSE,0,complain_overflow_dont,
206 tic54x_relocation,"ALS7",FALSE,0x007F,0x007F,FALSE),
208 /* 9 MSBs of an address, absolute */
209 /* TI assembler doesn't shift its encoding, and is thus incompatible */
210 HOWTO (R_PARTMS9,7,1,9,FALSE,0,complain_overflow_dont,
211 tic54x_relocation,"AMS9",FALSE,0x01FF,0x01FF,FALSE),
213 /* 23-bit direct reference, absolute */
214 HOWTO (R_EXTWORD,0,2,23,FALSE,0,complain_overflow_dont,
215 tic54x_relocation,"ARELEXT",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
217 /* 16 bits of 23-bit extended address, absolute */
218 HOWTO (R_EXTWORD16,0,1,16,FALSE,0,complain_overflow_dont,
219 tic54x_relocation,"ARELEXT16",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
221 /* upper 7 bits of 23-bit extended address, absolute */
222 HOWTO (R_EXTWORDMS7,16,1,7,FALSE,0,complain_overflow_dont,
223 tic54x_relocation,"ARELEXTMS7",FALSE,0x7F,0x7F,FALSE),
225 /* 32-bit relocation exclusively for stabs */
226 HOWTO (R_RELLONG,0,2,32,FALSE,0,complain_overflow_dont,
227 tic54x_relocation,"STAB",FALSE,0xFFFFFFFF,0xFFFFFFFF,FALSE),
230 #define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup
232 /* For the case statement use the code values used tc_gen_reloc (defined in
233 bfd/reloc.c) to map to the howto table entries. */
235 reloc_howto_type *
236 tic54x_coff_reloc_type_lookup (abfd, code)
237 bfd *abfd ATTRIBUTE_UNUSED;
238 bfd_reloc_code_real_type code;
240 switch (code)
242 case BFD_RELOC_16:
243 return &tic54x_howto_table[0];
244 case BFD_RELOC_TIC54X_PARTLS7:
245 return &tic54x_howto_table[1];
246 case BFD_RELOC_TIC54X_PARTMS9:
247 return &tic54x_howto_table[2];
248 case BFD_RELOC_TIC54X_23:
249 return &tic54x_howto_table[3];
250 case BFD_RELOC_TIC54X_16_OF_23:
251 return &tic54x_howto_table[4];
252 case BFD_RELOC_TIC54X_MS7_OF_23:
253 return &tic54x_howto_table[5];
254 case BFD_RELOC_32:
255 return &tic54x_howto_table[12];
256 default:
257 return (reloc_howto_type *) NULL;
261 /* Code to turn a r_type into a howto ptr, uses the above howto table.
262 Called after some initial checking by the tic54x_rtype_to_howto fn below. */
264 static void
265 tic54x_lookup_howto (internal, dst)
266 arelent *internal;
267 struct internal_reloc *dst;
269 unsigned i;
270 int bank = (dst->r_symndx == -1) ? HOWTO_BANK : 0;
272 for (i = 0; i < sizeof tic54x_howto_table/sizeof tic54x_howto_table[0]; i++)
274 if (tic54x_howto_table[i].type == dst->r_type)
276 internal->howto = tic54x_howto_table + i + bank;
277 return;
281 (*_bfd_error_handler) (_("Unrecognized reloc type 0x%x"),
282 (unsigned int) dst->r_type);
283 abort ();
286 #define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\
287 tic54x_reloc_processing(RELENT,RELOC,SYMS,ABFD,SECT)
289 #define coff_rtype_to_howto coff_tic54x_rtype_to_howto
291 static reloc_howto_type *
292 coff_tic54x_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
293 bfd *abfd ATTRIBUTE_UNUSED;
294 asection *sec;
295 struct internal_reloc *rel;
296 struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
297 struct internal_syment *sym ATTRIBUTE_UNUSED;
298 bfd_vma *addendp;
300 arelent genrel;
302 if (rel->r_symndx == -1 && addendp != NULL)
304 /* This is a TI "internal relocation", which means that the relocation
305 amount is the amount by which the current section is being relocated
306 in the output section. */
307 *addendp = (sec->output_section->vma + sec->output_offset) - sec->vma;
310 tic54x_lookup_howto (&genrel, rel);
312 return genrel.howto;
315 /* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
316 labels. */
318 static bfd_boolean
319 ticoff_bfd_is_local_label_name (abfd, name)
320 bfd *abfd ATTRIBUTE_UNUSED;
321 const char *name;
323 if (TICOFF_LOCAL_LABEL_P(name))
324 return TRUE;
325 return FALSE;
328 #define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
330 /* Customize coffcode.h; the default coff_ functions are set up to use COFF2;
331 coff_bad_format_hook uses BADMAG, so set that for COFF2. The COFF1
332 and COFF0 vectors use custom _bad_format_hook procs instead of setting
333 BADMAG. */
334 #define BADMAG(x) COFF2_BADMAG(x)
335 #include "coffcode.h"
337 static bfd_boolean
338 tic54x_set_section_contents (abfd, section, location, offset, bytes_to_do)
339 bfd *abfd;
340 sec_ptr section;
341 const PTR location;
342 file_ptr offset;
343 bfd_size_type bytes_to_do;
345 return coff_set_section_contents (abfd, section, location,
346 offset, bytes_to_do);
349 static void
350 tic54x_reloc_processing (relent, reloc, symbols, abfd, section)
351 arelent *relent;
352 struct internal_reloc *reloc;
353 asymbol **symbols;
354 bfd *abfd;
355 asection *section;
357 asymbol *ptr;
359 relent->address = reloc->r_vaddr;
361 if (reloc->r_symndx != -1)
363 if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd))
365 (*_bfd_error_handler)
366 (_("%s: warning: illegal symbol index %ld in relocs"),
367 bfd_archive_filename (abfd), reloc->r_symndx);
368 relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
369 ptr = NULL;
371 else
373 relent->sym_ptr_ptr = (symbols
374 + obj_convert (abfd)[reloc->r_symndx]);
375 ptr = *(relent->sym_ptr_ptr);
378 else
380 relent->sym_ptr_ptr = section->symbol_ptr_ptr;
381 ptr = *(relent->sym_ptr_ptr);
384 /* The symbols definitions that we have read in have been
385 relocated as if their sections started at 0. But the offsets
386 refering to the symbols in the raw data have not been
387 modified, so we have to have a negative addend to compensate.
389 Note that symbols which used to be common must be left alone. */
391 /* Calculate any reloc addend by looking at the symbol. */
392 CALC_ADDEND (abfd, ptr, *reloc, relent);
394 relent->address -= section->vma;
395 /* !! relent->section = (asection *) NULL;*/
397 /* Fill in the relent->howto field from reloc->r_type. */
398 tic54x_lookup_howto (relent, reloc);
401 /* TI COFF v0, DOS tools (little-endian headers). */
402 const bfd_target tic54x_coff0_vec =
404 "coff0-c54x", /* name */
405 bfd_target_coff_flavour,
406 BFD_ENDIAN_LITTLE, /* data byte order is little */
407 BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */
409 (HAS_RELOC | EXEC_P | /* object flags */
410 HAS_LINENO | HAS_DEBUG |
411 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
413 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
414 '_', /* leading symbol underscore */
415 '/', /* ar_pad_char */
416 15, /* ar_max_namelen */
417 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
418 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
419 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
420 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
421 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
422 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
424 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
425 bfd_generic_archive_p, _bfd_dummy_target},
426 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
427 bfd_false},
428 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
429 _bfd_write_archive_contents, bfd_false},
431 BFD_JUMP_TABLE_GENERIC (coff),
432 BFD_JUMP_TABLE_COPY (coff),
433 BFD_JUMP_TABLE_CORE (_bfd_nocore),
434 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
435 BFD_JUMP_TABLE_SYMBOLS (coff),
436 BFD_JUMP_TABLE_RELOCS (coff),
437 BFD_JUMP_TABLE_WRITE (tic54x),
438 BFD_JUMP_TABLE_LINK (coff),
439 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
440 NULL,
442 (PTR) & ticoff0_swap_table
445 /* TI COFF v0, SPARC tools (big-endian headers). */
446 const bfd_target tic54x_coff0_beh_vec =
448 "coff0-beh-c54x", /* name */
449 bfd_target_coff_flavour,
450 BFD_ENDIAN_LITTLE, /* data byte order is little */
451 BFD_ENDIAN_BIG, /* header byte order is big */
453 (HAS_RELOC | EXEC_P | /* object flags */
454 HAS_LINENO | HAS_DEBUG |
455 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
457 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
458 '_', /* leading symbol underscore */
459 '/', /* ar_pad_char */
460 15, /* ar_max_namelen */
461 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
462 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
463 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
464 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
465 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
466 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
468 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
469 bfd_generic_archive_p, _bfd_dummy_target},
470 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
471 bfd_false},
472 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
473 _bfd_write_archive_contents, bfd_false},
475 BFD_JUMP_TABLE_GENERIC (coff),
476 BFD_JUMP_TABLE_COPY (coff),
477 BFD_JUMP_TABLE_CORE (_bfd_nocore),
478 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
479 BFD_JUMP_TABLE_SYMBOLS (coff),
480 BFD_JUMP_TABLE_RELOCS (coff),
481 BFD_JUMP_TABLE_WRITE (tic54x),
482 BFD_JUMP_TABLE_LINK (coff),
483 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
485 & tic54x_coff0_vec,
487 (PTR) & ticoff0_swap_table
490 /* TI COFF v1, DOS tools (little-endian headers). */
491 const bfd_target tic54x_coff1_vec =
493 "coff1-c54x", /* name */
494 bfd_target_coff_flavour,
495 BFD_ENDIAN_LITTLE, /* data byte order is little */
496 BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */
498 (HAS_RELOC | EXEC_P | /* object flags */
499 HAS_LINENO | HAS_DEBUG |
500 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
502 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
503 '_', /* leading symbol underscore */
504 '/', /* ar_pad_char */
505 15, /* ar_max_namelen */
506 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
507 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
508 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
509 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
510 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
511 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
513 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
514 bfd_generic_archive_p, _bfd_dummy_target},
515 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
516 bfd_false},
517 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
518 _bfd_write_archive_contents, bfd_false},
520 BFD_JUMP_TABLE_GENERIC (coff),
521 BFD_JUMP_TABLE_COPY (coff),
522 BFD_JUMP_TABLE_CORE (_bfd_nocore),
523 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
524 BFD_JUMP_TABLE_SYMBOLS (coff),
525 BFD_JUMP_TABLE_RELOCS (coff),
526 BFD_JUMP_TABLE_WRITE (tic54x),
527 BFD_JUMP_TABLE_LINK (coff),
528 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
530 & tic54x_coff0_beh_vec,
532 (PTR) & ticoff1_swap_table
535 /* TI COFF v1, SPARC tools (big-endian headers). */
536 const bfd_target tic54x_coff1_beh_vec =
538 "coff1-beh-c54x", /* name */
539 bfd_target_coff_flavour,
540 BFD_ENDIAN_LITTLE, /* data byte order is little */
541 BFD_ENDIAN_BIG, /* header byte order is big */
543 (HAS_RELOC | EXEC_P | /* object flags */
544 HAS_LINENO | HAS_DEBUG |
545 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
547 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
548 '_', /* leading symbol underscore */
549 '/', /* ar_pad_char */
550 15, /* ar_max_namelen */
551 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
552 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
553 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
554 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
555 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
556 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
558 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
559 bfd_generic_archive_p, _bfd_dummy_target},
560 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
561 bfd_false},
562 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
563 _bfd_write_archive_contents, bfd_false},
565 BFD_JUMP_TABLE_GENERIC (coff),
566 BFD_JUMP_TABLE_COPY (coff),
567 BFD_JUMP_TABLE_CORE (_bfd_nocore),
568 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
569 BFD_JUMP_TABLE_SYMBOLS (coff),
570 BFD_JUMP_TABLE_RELOCS (coff),
571 BFD_JUMP_TABLE_WRITE (tic54x),
572 BFD_JUMP_TABLE_LINK (coff),
573 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
575 & tic54x_coff1_vec,
577 (PTR) & ticoff1_swap_table
580 /* TI COFF v2, TI DOS tools output (little-endian headers). */
581 const bfd_target tic54x_coff2_vec =
583 "coff2-c54x", /* name */
584 bfd_target_coff_flavour,
585 BFD_ENDIAN_LITTLE, /* data byte order is little */
586 BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */
588 (HAS_RELOC | EXEC_P | /* object flags */
589 HAS_LINENO | HAS_DEBUG |
590 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
592 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
593 '_', /* leading symbol underscore */
594 '/', /* ar_pad_char */
595 15, /* ar_max_namelen */
596 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
597 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
598 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
599 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
600 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
601 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
603 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
604 bfd_generic_archive_p, _bfd_dummy_target},
605 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
606 bfd_false},
607 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
608 _bfd_write_archive_contents, bfd_false},
610 BFD_JUMP_TABLE_GENERIC (coff),
611 BFD_JUMP_TABLE_COPY (coff),
612 BFD_JUMP_TABLE_CORE (_bfd_nocore),
613 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
614 BFD_JUMP_TABLE_SYMBOLS (coff),
615 BFD_JUMP_TABLE_RELOCS (coff),
616 BFD_JUMP_TABLE_WRITE (tic54x),
617 BFD_JUMP_TABLE_LINK (coff),
618 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
620 & tic54x_coff1_beh_vec,
622 COFF_SWAP_TABLE
625 /* TI COFF v2, TI SPARC tools output (big-endian headers). */
626 const bfd_target tic54x_coff2_beh_vec =
628 "coff2-beh-c54x", /* name */
629 bfd_target_coff_flavour,
630 BFD_ENDIAN_LITTLE, /* data byte order is little */
631 BFD_ENDIAN_BIG, /* header byte order is big */
633 (HAS_RELOC | EXEC_P | /* object flags */
634 HAS_LINENO | HAS_DEBUG |
635 HAS_SYMS | HAS_LOCALS | WP_TEXT ),
637 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
638 '_', /* leading symbol underscore */
639 '/', /* ar_pad_char */
640 15, /* ar_max_namelen */
641 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
642 tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
643 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
644 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
645 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
646 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
648 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
649 bfd_generic_archive_p, _bfd_dummy_target},
650 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
651 bfd_false},
652 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
653 _bfd_write_archive_contents, bfd_false},
655 BFD_JUMP_TABLE_GENERIC (coff),
656 BFD_JUMP_TABLE_COPY (coff),
657 BFD_JUMP_TABLE_CORE (_bfd_nocore),
658 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
659 BFD_JUMP_TABLE_SYMBOLS (coff),
660 BFD_JUMP_TABLE_RELOCS (coff),
661 BFD_JUMP_TABLE_WRITE (tic54x),
662 BFD_JUMP_TABLE_LINK (coff),
663 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
665 & tic54x_coff2_vec,
667 COFF_SWAP_TABLE