* readelf.c (byte_get_little_endian): Comment typo fix.
[binutils.git] / bfd / coff-tic4x.c
blob561d161f82f3f4f1a286094a2649761204c050e8
1 /* BFD back-end for TMS320C4X coff binaries.
2 Copyright 1996, 1997, 1998, 1999, 2000, 2002
3 Free Software Foundation, Inc.
4 Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
6 This file is part of BFD, the Binary File Descriptor library.
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
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
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.
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
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 02111-1307, USA. */
23 #include "bfd.h"
24 #include "sysdep.h"
25 #include "libbfd.h"
26 #include "bfdlink.h"
27 #include "coff/tic4x.h"
28 #include "coff/internal.h"
29 #include "libcoff.h"
31 #undef F_LSYMS
32 #define F_LSYMS F_LSYMS_TICOFF
34 static boolean ticoff0_bad_format_hook
35 PARAMS ((bfd *, PTR ));
36 static boolean ticoff1_bad_format_hook
37 PARAMS ((bfd *, PTR ));
38 static boolean ticoff_bfd_is_local_label_name
39 PARAMS ((bfd *, const char *));
40 static bfd_reloc_status_type tic4x_relocation
41 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char ** ));
42 static reloc_howto_type *tic4x_coff_reloc_type_lookup
43 PARAMS ((bfd *, bfd_reloc_code_real_type ));
44 static void tic4x_lookup_howto
45 PARAMS ((arelent *, struct internal_reloc * ));
46 static reloc_howto_type *coff_tic4x_rtype_to_howto
47 PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma * ));
48 static void tic4x_reloc_processing
49 PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection * ));
52 static boolean
53 ticoff0_bad_format_hook (abfd, filehdr)
54 bfd *abfd ATTRIBUTE_UNUSED;
55 PTR filehdr;
57 struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
59 if (COFF0_BADMAG (*internal_f))
60 return false;
62 return true;
65 static boolean
66 ticoff1_bad_format_hook (abfd, filehdr)
67 bfd *abfd ATTRIBUTE_UNUSED;
68 PTR filehdr;
70 struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
72 if (COFF1_BADMAG (*internal_f))
73 return false;
75 return true;
78 /* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
79 labels. */
80 static boolean
81 ticoff_bfd_is_local_label_name (abfd, name)
82 bfd *abfd ATTRIBUTE_UNUSED;
83 const char *name;
85 if (TICOFF_LOCAL_LABEL_P(name))
86 return true;
87 return false;
90 #define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
92 #define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\
93 tic4x_reloc_processing (RELENT,RELOC,SYMS,ABFD,SECT)
95 /* Customize coffcode.h; the default coff_ functions are set up to use
96 COFF2; coff_bad_format_hook uses BADMAG, so set that for COFF2.
97 The COFF1 and COFF0 vectors use custom _bad_format_hook procs
98 instead of setting BADMAG. */
99 #define BADMAG(x) COFF2_BADMAG(x)
100 #include "coffcode.h"
102 static bfd_reloc_status_type
103 tic4x_relocation (abfd, reloc_entry, symbol, data, input_section,
104 output_bfd, error_message)
105 bfd *abfd ATTRIBUTE_UNUSED;
106 arelent *reloc_entry;
107 asymbol *symbol ATTRIBUTE_UNUSED;
108 PTR data ATTRIBUTE_UNUSED;
109 asection *input_section;
110 bfd *output_bfd;
111 char **error_message ATTRIBUTE_UNUSED;
113 if (output_bfd != (bfd *) NULL)
115 /* This is a partial relocation, and we want to apply the
116 relocation to the reloc entry rather than the raw data.
117 Modify the reloc inplace to reflect what we now know. */
118 reloc_entry->address += input_section->output_offset;
119 return bfd_reloc_ok;
121 return bfd_reloc_continue;
124 reloc_howto_type tic4x_howto_table[] =
126 HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "RELWORD", true, 0x0000ffff, 0x0000ffff, false),
127 HOWTO(R_REL24, 0, 2, 24, false, 0, complain_overflow_bitfield, tic4x_relocation, "REL24", true, 0x00ffffff, 0x00ffffff, false),
128 HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_dont, tic4x_relocation, "RELLONG", true, 0xffffffff, 0xffffffff, false),
129 HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "PCRWORD", true, 0x0000ffff, 0x0000ffff, false),
130 HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "PCR24", true, 0x00ffffff, 0x00ffffff, false),
131 HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTLS16", true, 0x0000ffff, 0x0000ffff, false),
132 HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTMS8", true, 0x0000ffff, 0x0000ffff, false),
133 HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "ARELWORD", true, 0x0000ffff, 0x0000ffff, false),
134 HOWTO(R_REL24, 0, 2, 24, false, 0, complain_overflow_signed, tic4x_relocation, "AREL24", true, 0x00ffffff, 0x00ffffff, false),
135 HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_signed, tic4x_relocation, "ARELLONG", true, 0xffffffff, 0xffffffff, false),
136 HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "APCRWORD", true, 0x0000ffff, 0x0000ffff, false),
137 HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "APCR24", true, 0x00ffffff, 0x00ffffff, false),
138 HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTLS16", true, 0x0000ffff, 0x0000ffff, false),
139 HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTMS8", true, 0x0000ffff, 0x0000ffff, false),
141 #define HOWTO_SIZE (sizeof(tic4x_howto_table) / sizeof(tic4x_howto_table[0]))
143 #undef coff_bfd_reloc_type_lookup
144 #define coff_bfd_reloc_type_lookup tic4x_coff_reloc_type_lookup
146 /* For the case statement use the code values used tc_gen_reloc (defined in
147 bfd/reloc.c) to map to the howto table entries. */
149 static reloc_howto_type *
150 tic4x_coff_reloc_type_lookup (abfd, code)
151 bfd *abfd ATTRIBUTE_UNUSED;
152 bfd_reloc_code_real_type code;
154 unsigned int type;
155 unsigned int i;
157 switch (code)
159 case BFD_RELOC_32: type = R_RELLONG; break;
160 case BFD_RELOC_24: type = R_REL24; break;
161 case BFD_RELOC_16: type = R_RELWORD; break;
162 case BFD_RELOC_24_PCREL: type = R_PCR24; break;
163 case BFD_RELOC_16_PCREL: type = R_PCRWORD; break;
164 case BFD_RELOC_HI16: type = R_PARTMS8; break;
165 case BFD_RELOC_LO16: type = R_PARTLS16; break;
166 default:
167 return NULL;
170 for (i = 0; i < HOWTO_SIZE; i++)
172 if (tic4x_howto_table[i].type == type)
173 return tic4x_howto_table + i;
175 return NULL;
179 /* Code to turn a r_type into a howto ptr, uses the above howto table.
180 Called after some initial checking by the tic4x_rtype_to_howto fn
181 below. */
182 static void
183 tic4x_lookup_howto (internal, dst)
184 arelent *internal;
185 struct internal_reloc *dst;
187 unsigned int i;
188 int bank = (dst->r_symndx == -1) ? HOWTO_BANK : 0;
190 for (i = 0; i < HOWTO_SIZE; i++)
192 if (tic4x_howto_table[i].type == dst->r_type)
194 internal->howto = tic4x_howto_table + i + bank;
195 return;
199 (*_bfd_error_handler) (_("Unrecognized reloc type 0x%x"),
200 (unsigned int) dst->r_type);
201 abort();
204 #undef coff_rtype_to_howto
205 #define coff_rtype_to_howto coff_tic4x_rtype_to_howto
207 static reloc_howto_type *
208 coff_tic4x_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
209 bfd *abfd ATTRIBUTE_UNUSED;
210 asection *sec;
211 struct internal_reloc *rel;
212 struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
213 struct internal_syment *sym ATTRIBUTE_UNUSED;
214 bfd_vma *addendp;
216 arelent genrel;
218 if (rel->r_symndx == -1 && addendp != NULL)
219 /* This is a TI "internal relocation", which means that the relocation
220 amount is the amount by which the current section is being relocated
221 in the output section. */
222 *addendp = (sec->output_section->vma + sec->output_offset) - sec->vma;
224 tic4x_lookup_howto (&genrel, rel);
226 return genrel.howto;
230 static void
231 tic4x_reloc_processing (relent, reloc, symbols, abfd, section)
232 arelent *relent;
233 struct internal_reloc *reloc;
234 asymbol **symbols;
235 bfd *abfd;
236 asection *section;
238 asymbol *ptr;
240 relent->address = reloc->r_vaddr;
242 if (reloc->r_symndx != -1)
244 if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd))
246 (*_bfd_error_handler)
247 (_("%s: warning: illegal symbol index %ld in relocs"),
248 bfd_get_filename (abfd), reloc->r_symndx);
249 relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
250 ptr = NULL;
252 else
254 relent->sym_ptr_ptr = (symbols
255 + obj_convert (abfd)[reloc->r_symndx]);
256 ptr = *(relent->sym_ptr_ptr);
259 else
261 relent->sym_ptr_ptr = section->symbol_ptr_ptr;
262 ptr = *(relent->sym_ptr_ptr);
265 /* The symbols definitions that we have read in have been relocated
266 as if their sections started at 0. But the offsets refering to
267 the symbols in the raw data have not been modified, so we have to
268 have a negative addend to compensate.
270 Note that symbols which used to be common must be left alone. */
272 /* Calculate any reloc addend by looking at the symbol. */
273 CALC_ADDEND (abfd, ptr, *reloc, relent);
275 relent->address -= section->vma;
276 /* !! relent->section = (asection *) NULL; */
278 /* Fill in the relent->howto field from reloc->r_type. */
279 tic4x_lookup_howto (relent, reloc);
283 static const bfd_coff_backend_data ticoff0_swap_table =
285 coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
286 coff_SWAP_aux_out, coff_SWAP_sym_out,
287 coff_SWAP_lineno_out, coff_SWAP_reloc_out,
288 coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out,
289 coff_SWAP_scnhdr_out,
290 FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN,
291 #ifdef COFF_LONG_FILENAMES
292 true,
293 #else
294 false,
295 #endif
296 #ifdef COFF_LONG_SECTION_NAMES
297 true,
298 #else
299 false,
300 #endif
301 #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
302 true,
303 #else
304 false,
305 #endif
306 #ifdef COFF_DEBUG_STRING_WIDE_PREFIX
308 #else
310 #endif
311 COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
312 coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
313 coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook,
314 coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
315 coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
316 coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
317 coff_classify_symbol, coff_compute_section_file_positions,
318 coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
319 coff_adjust_symndx, coff_link_add_one_symbol,
320 coff_link_output_has_begun, coff_final_link_postscript
323 /* COFF1 differs in section header size. */
324 static const bfd_coff_backend_data ticoff1_swap_table =
326 coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
327 coff_SWAP_aux_out, coff_SWAP_sym_out,
328 coff_SWAP_lineno_out, coff_SWAP_reloc_out,
329 coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out,
330 coff_SWAP_scnhdr_out,
331 FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN,
332 #ifdef COFF_LONG_FILENAMES
333 true,
334 #else
335 false,
336 #endif
337 #ifdef COFF_LONG_SECTION_NAMES
338 true,
339 #else
340 false,
341 #endif
342 #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
343 true,
344 #else
345 false,
346 #endif
347 #ifdef COFF_DEBUG_STRING_WIDE_PREFIX
349 #else
351 #endif
352 COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
353 coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
354 coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook,
355 coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
356 coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
357 coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
358 coff_classify_symbol, coff_compute_section_file_positions,
359 coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
360 coff_adjust_symndx, coff_link_add_one_symbol,
361 coff_link_output_has_begun, coff_final_link_postscript
365 /* TI COFF v0, DOS tools (little-endian headers). */
366 const bfd_target tic4x_coff0_vec =
368 "coff0-c4x", /* Name. */
369 bfd_target_coff_flavour,
370 BFD_ENDIAN_LITTLE, /* Data byte order is little. */
371 BFD_ENDIAN_LITTLE, /* Header byte order is little (DOS tools). */
373 (HAS_RELOC | EXEC_P | /* Object flags. */
374 HAS_LINENO | HAS_DEBUG |
375 HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ),
377 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
378 '_', /* Leading symbol underscore. */
379 '/', /* ar_pad_char. */
380 15, /* ar_max_namelen. */
381 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
382 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
383 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
384 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
385 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
386 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
388 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
389 bfd_generic_archive_p, _bfd_dummy_target},
390 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
391 bfd_false},
392 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
393 _bfd_write_archive_contents, bfd_false},
395 BFD_JUMP_TABLE_GENERIC (coff),
396 BFD_JUMP_TABLE_COPY (coff),
397 BFD_JUMP_TABLE_CORE (_bfd_nocore),
398 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
399 BFD_JUMP_TABLE_SYMBOLS (coff),
400 BFD_JUMP_TABLE_RELOCS (coff),
401 BFD_JUMP_TABLE_WRITE (coff),
402 BFD_JUMP_TABLE_LINK (coff),
403 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
404 NULL,
406 (PTR)&ticoff0_swap_table
409 /* TI COFF v0, SPARC tools (big-endian headers). */
410 const bfd_target tic4x_coff0_beh_vec =
412 "coff0-beh-c4x", /* Name. */
413 bfd_target_coff_flavour,
414 BFD_ENDIAN_LITTLE, /* Data byte order is little. */
415 BFD_ENDIAN_BIG, /* Header byte order is big. */
417 (HAS_RELOC | EXEC_P | /* Object flags. */
418 HAS_LINENO | HAS_DEBUG |
419 HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ),
421 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
422 '_', /* Leading symbol underscore. */
423 '/', /* ar_pad_char */
424 15, /* ar_max_namelen */
425 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
426 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
427 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
428 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
429 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
430 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
432 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
433 bfd_generic_archive_p, _bfd_dummy_target},
434 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
435 bfd_false},
436 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
437 _bfd_write_archive_contents, bfd_false},
439 BFD_JUMP_TABLE_GENERIC (coff),
440 BFD_JUMP_TABLE_COPY (coff),
441 BFD_JUMP_TABLE_CORE (_bfd_nocore),
442 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
443 BFD_JUMP_TABLE_SYMBOLS (coff),
444 BFD_JUMP_TABLE_RELOCS (coff),
445 BFD_JUMP_TABLE_WRITE (coff),
446 BFD_JUMP_TABLE_LINK (coff),
447 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
449 &tic4x_coff0_vec,
451 (PTR)&ticoff0_swap_table
454 /* TI COFF v1, DOS tools (little-endian headers). */
455 const bfd_target tic4x_coff1_vec =
457 "coff1-c4x", /* Name. */
458 bfd_target_coff_flavour,
459 BFD_ENDIAN_LITTLE, /* Data byte order is little. */
460 BFD_ENDIAN_LITTLE, /* Header byte order is little (DOS tools). */
462 (HAS_RELOC | EXEC_P | /* Object flags. */
463 HAS_LINENO | HAS_DEBUG |
464 HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ),
466 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
467 '_', /* Leading symbol underscore. */
468 '/', /* ar_pad_char */
469 15, /* ar_max_namelen */
470 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
471 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
472 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
473 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
474 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
475 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
477 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
478 bfd_generic_archive_p, _bfd_dummy_target},
479 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
480 bfd_false},
481 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
482 _bfd_write_archive_contents, bfd_false},
484 BFD_JUMP_TABLE_GENERIC (coff),
485 BFD_JUMP_TABLE_COPY (coff),
486 BFD_JUMP_TABLE_CORE (_bfd_nocore),
487 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
488 BFD_JUMP_TABLE_SYMBOLS (coff),
489 BFD_JUMP_TABLE_RELOCS (coff),
490 BFD_JUMP_TABLE_WRITE (coff),
491 BFD_JUMP_TABLE_LINK (coff),
492 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
494 &tic4x_coff0_beh_vec,
496 (PTR)&ticoff1_swap_table
499 /* TI COFF v1, SPARC tools (big-endian headers). */
500 const bfd_target tic4x_coff1_beh_vec =
502 "coff1-beh-c4x", /* Name. */
503 bfd_target_coff_flavour,
504 BFD_ENDIAN_LITTLE, /* Data byte order is little. */
505 BFD_ENDIAN_BIG, /* Header byte order is big. */
507 (HAS_RELOC | EXEC_P | /* Object flags. */
508 HAS_LINENO | HAS_DEBUG |
509 HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ),
511 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
512 '_', /* Leading symbol underscore. */
513 '/', /* ar_pad_char */
514 15, /* ar_max_namelen */
515 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
516 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
517 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
518 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
519 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
520 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
522 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
523 bfd_generic_archive_p, _bfd_dummy_target},
524 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
525 bfd_false},
526 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
527 _bfd_write_archive_contents, bfd_false},
529 BFD_JUMP_TABLE_GENERIC (coff),
530 BFD_JUMP_TABLE_COPY (coff),
531 BFD_JUMP_TABLE_CORE (_bfd_nocore),
532 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
533 BFD_JUMP_TABLE_SYMBOLS (coff),
534 BFD_JUMP_TABLE_RELOCS (coff),
535 BFD_JUMP_TABLE_WRITE (coff),
536 BFD_JUMP_TABLE_LINK (coff),
537 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
539 &tic4x_coff1_vec,
541 (PTR)&ticoff1_swap_table
544 /* TI COFF v2, TI DOS tools output (little-endian headers). */
545 const bfd_target tic4x_coff2_vec =
547 "coff2-c4x", /* Name. */
548 bfd_target_coff_flavour,
549 BFD_ENDIAN_LITTLE, /* Data byte order is little. */
550 BFD_ENDIAN_LITTLE, /* Header byte order is little (DOS tools). */
552 (HAS_RELOC | EXEC_P | /* Object flags. */
553 HAS_LINENO | HAS_DEBUG |
554 HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ),
556 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
557 '_', /* Leading symbol underscore. */
558 '/', /* ar_pad_char */
559 15, /* ar_max_namelen */
560 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
561 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
562 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
563 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
564 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
565 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
567 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
568 bfd_generic_archive_p, _bfd_dummy_target},
569 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
570 bfd_false},
571 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
572 _bfd_write_archive_contents, bfd_false},
574 BFD_JUMP_TABLE_GENERIC (coff),
575 BFD_JUMP_TABLE_COPY (coff),
576 BFD_JUMP_TABLE_CORE (_bfd_nocore),
577 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
578 BFD_JUMP_TABLE_SYMBOLS (coff),
579 BFD_JUMP_TABLE_RELOCS (coff),
580 BFD_JUMP_TABLE_WRITE (coff),
581 BFD_JUMP_TABLE_LINK (coff),
582 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
584 &tic4x_coff1_beh_vec,
586 COFF_SWAP_TABLE
589 /* TI COFF v2, TI SPARC tools output (big-endian headers). */
590 const bfd_target tic4x_coff2_beh_vec =
592 "coff2-beh-c4x", /* Name. */
593 bfd_target_coff_flavour,
594 BFD_ENDIAN_LITTLE, /* Data byte order is little. */
595 BFD_ENDIAN_BIG, /* Header byte order is big. */
597 (HAS_RELOC | EXEC_P | /* Object flags. */
598 HAS_LINENO | HAS_DEBUG |
599 HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ),
601 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
602 '_', /* Leading symbol underscore. */
603 '/', /* ar_pad_char */
604 15, /* ar_max_namelen */
605 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
606 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
607 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
608 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
609 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
610 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
612 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
613 bfd_generic_archive_p, _bfd_dummy_target},
614 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
615 bfd_false},
616 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
617 _bfd_write_archive_contents, bfd_false},
619 BFD_JUMP_TABLE_GENERIC (coff),
620 BFD_JUMP_TABLE_COPY (coff),
621 BFD_JUMP_TABLE_CORE (_bfd_nocore),
622 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
623 BFD_JUMP_TABLE_SYMBOLS (coff),
624 BFD_JUMP_TABLE_RELOCS (coff),
625 BFD_JUMP_TABLE_WRITE (coff),
626 BFD_JUMP_TABLE_LINK (coff),
627 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
629 &tic4x_coff2_vec,
631 COFF_SWAP_TABLE