1 /* BFD back-end for TMS320C54X coff binaries.
2 Copyright (C) 1999, 2000 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
26 #include "coff/tic54x.h"
27 #include "coff/internal.h"
31 #define F_LSYMS F_LSYMS_TICOFF
35 The octet order is screwy. words are LSB first (LS octet, actually), but
36 longwords are MSW first. For example, 0x12345678 is encoded 0x5678 in the
37 first word and 0x1234 in the second. When looking at the data as stored in
38 the COFF file, you would see the octets ordered as 0x78, 0x56, 0x34, 0x12.
39 Don't bother with 64-bits, as there aren't any.
43 register const bfd_byte
*addr
;
46 v
= (unsigned long) addr
[2];
47 v
|= (unsigned long) addr
[3] << 8;
48 v
|= (unsigned long) addr
[0] << 16;
49 v
|= (unsigned long) addr
[1] << 24;
54 tic54x_putl32 (data
, addr
)
56 register bfd_byte
*addr
;
58 addr
[2] = (bfd_byte
)data
;
59 addr
[3] = (bfd_byte
)(data
>> 8);
60 addr
[0] = (bfd_byte
)(data
>> 16);
61 addr
[1] = (bfd_byte
)(data
>> 24);
65 tic54x_getl_signed_32 (addr
)
66 register const bfd_byte
*addr
;
70 v
= (unsigned long) addr
[2];
71 v
|= (unsigned long) addr
[3] << 8;
72 v
|= (unsigned long) addr
[0] << 16;
73 v
|= (unsigned long) addr
[1] << 24;
75 ((bfd_signed_vma) (long) (((unsigned long) (x) ^ 0x80000000) - 0x80000000))
79 #define coff_get_section_load_page bfd_ticoff_get_section_load_page
80 #define coff_set_section_load_page bfd_ticoff_set_section_load_page
83 bfd_ticoff_set_section_load_page (sect
, page
)
87 sect
->lma
= (sect
->lma
& ADDR_MASK
) | PG_TO_FLAG(page
);
92 bfd_ticoff_get_section_load_page (sect
)
97 /* Provide meaningful defaults for predefined sections. */
98 if (sect
== &bfd_com_section
)
101 else if (sect
== &bfd_und_section
102 || sect
== &bfd_abs_section
103 || sect
== &bfd_ind_section
)
107 page
= FLAG_TO_PG (sect
->lma
);
112 /* Set the architecture appropriately. Allow unkown architectures
115 tic54x_set_arch_mach (abfd
, arch
, machine
)
117 enum bfd_architecture arch
;
118 unsigned long machine
;
120 if (arch
== bfd_arch_unknown
)
121 arch
= bfd_arch_tic54x
;
123 else if (arch
!= bfd_arch_tic54x
)
126 return bfd_default_set_arch_mach (abfd
, arch
, machine
);
129 static bfd_reloc_status_type
130 tic54x_relocation (abfd
, reloc_entry
, symbol
, data
, input_section
,
131 output_bfd
, error_message
)
132 bfd
*abfd ATTRIBUTE_UNUSED
;
133 arelent
*reloc_entry
;
134 asymbol
*symbol ATTRIBUTE_UNUSED
;
135 PTR data ATTRIBUTE_UNUSED
;
136 asection
*input_section
;
138 char **error_message ATTRIBUTE_UNUSED
;
141 if (output_bfd
!= (bfd
*) NULL
)
143 /* This is a partial relocation, and we want to apply the
144 relocation to the reloc entry rather than the raw data.
145 Modify the reloc inplace to reflect what we now know. */
146 reloc_entry
->address
+= input_section
->output_offset
;
149 return bfd_reloc_continue
;
152 reloc_howto_type tic54x_howto_table
[] =
154 /* type,rightshift,size (0=byte, 1=short, 2=long),
155 bit size, pc_relative, bitpos, dont complain_on_overflow,
156 special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset */
159 /* 16-bit direct reference to symbol's address */
160 HOWTO (R_RELWORD
,0,1,16,false,0,complain_overflow_dont
,
161 tic54x_relocation
,"REL16",false,0xFFFF,0xFFFF,false),
163 /* 7 LSBs of an address */
164 HOWTO (R_PARTLS7
,0,1,7,false,0,complain_overflow_dont
,
165 tic54x_relocation
,"LS7",false,0x007F,0x007F,false),
167 /* 9 MSBs of an address */
168 /* TI assembler doesn't shift its encoding, and is thus incompatible */
169 HOWTO (R_PARTMS9
,7,1,9,false,0,complain_overflow_dont
,
170 tic54x_relocation
,"MS9",false,0x01FF,0x01FF,false),
172 /* 23-bit relocation */
173 HOWTO (R_EXTWORD
,0,2,23,false,0,complain_overflow_dont
,
174 tic54x_relocation
,"RELEXT",false,0x7FFFFF,0x7FFFFF,false),
176 /* 16 bits of 23-bit extended address */
177 HOWTO (R_EXTWORD16
,0,1,16,false,0,complain_overflow_dont
,
178 tic54x_relocation
,"RELEXT16",false,0x7FFFFF,0x7FFFFF,false),
180 /* upper 7 bits of 23-bit extended address */
181 HOWTO (R_EXTWORDMS7
,16,1,7,false,0,complain_overflow_dont
,
182 tic54x_relocation
,"RELEXTMS7",false,0x7F,0x7F,false),
185 /* 16-bit direct reference to symbol's address, absolute */
186 HOWTO (R_RELWORD
,0,1,16,false,0,complain_overflow_dont
,
187 tic54x_relocation
,"AREL16",false,0xFFFF,0xFFFF,false),
189 /* 7 LSBs of an address, absolute */
190 HOWTO (R_PARTLS7
,0,1,7,false,0,complain_overflow_dont
,
191 tic54x_relocation
,"ALS7",false,0x007F,0x007F,false),
193 /* 9 MSBs of an address, absolute */
194 /* TI assembler doesn't shift its encoding, and is thus incompatible */
195 HOWTO (R_PARTMS9
,7,1,9,false,0,complain_overflow_dont
,
196 tic54x_relocation
,"AMS9",false,0x01FF,0x01FF,false),
198 /* 23-bit direct reference, absolute */
199 HOWTO (R_EXTWORD
,0,2,23,false,0,complain_overflow_dont
,
200 tic54x_relocation
,"ARELEXT",false,0x7FFFFF,0x7FFFFF,false),
202 /* 16 bits of 23-bit extended address, absolute */
203 HOWTO (R_EXTWORD16
,0,1,16,false,0,complain_overflow_dont
,
204 tic54x_relocation
,"ARELEXT16",false,0x7FFFFF,0x7FFFFF,false),
206 /* upper 7 bits of 23-bit extended address, absolute */
207 HOWTO (R_EXTWORDMS7
,16,1,7,false,0,complain_overflow_dont
,
208 tic54x_relocation
,"ARELEXTMS7",false,0x7F,0x7F,false),
210 /* 32-bit relocation exclusively for stabs */
211 HOWTO (R_RELLONG
,0,2,32,false,0,complain_overflow_dont
,
212 tic54x_relocation
,"STAB",false,0xFFFFFFFF,0xFFFFFFFF,false),
216 #define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup
218 /* For the case statement use the code values used tc_gen_reloc (defined in
219 bfd/reloc.c) to map to the howto table entries */
221 tic54x_coff_reloc_type_lookup (abfd
, code
)
222 bfd
*abfd ATTRIBUTE_UNUSED
;
223 bfd_reloc_code_real_type code
;
228 return &tic54x_howto_table
[0];
229 case BFD_RELOC_TIC54X_PARTLS7
:
230 return &tic54x_howto_table
[1];
231 case BFD_RELOC_TIC54X_PARTMS9
:
232 return &tic54x_howto_table
[2];
233 case BFD_RELOC_TIC54X_23
:
234 return &tic54x_howto_table
[3];
235 case BFD_RELOC_TIC54X_16_OF_23
:
236 return &tic54x_howto_table
[4];
237 case BFD_RELOC_TIC54X_MS7_OF_23
:
238 return &tic54x_howto_table
[5];
240 return &tic54x_howto_table
[12];
242 return (reloc_howto_type
*) NULL
;
246 /* Code to turn a r_type into a howto ptr, uses the above howto table.
247 Called after some initial checking by the tic54x_rtype_to_howto fn below */
249 tic54x_lookup_howto (internal
, dst
)
251 struct internal_reloc
*dst
;
254 int bank
= (dst
->r_symndx
== -1) ? HOWTO_BANK
: 0;
255 for (i
= 0; i
< sizeof tic54x_howto_table
/sizeof tic54x_howto_table
[0]; i
++)
257 if (tic54x_howto_table
[i
].type
== dst
->r_type
)
259 internal
->howto
= tic54x_howto_table
+ i
+ bank
;
264 (*_bfd_error_handler
) (_("Unrecognized reloc type 0x%x"),
265 (unsigned int) dst
->r_type
);
269 #define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\
270 tic54x_reloc_processing(RELENT,RELOC,SYMS,ABFD,SECT)
272 static void tic54x_reloc_processing();
274 #define coff_rtype_to_howto coff_tic54x_rtype_to_howto
276 static reloc_howto_type
*
277 coff_tic54x_rtype_to_howto (abfd
, sec
, rel
, h
, sym
, addendp
)
278 bfd
*abfd ATTRIBUTE_UNUSED
;
280 struct internal_reloc
*rel
;
281 struct coff_link_hash_entry
*h ATTRIBUTE_UNUSED
;
282 struct internal_syment
*sym ATTRIBUTE_UNUSED
;
287 if (rel
->r_symndx
== -1 && addendp
!= NULL
)
289 /* This is a TI "internal relocation", which means that the relocation
290 amount is the amount by which the current section is being relocated
291 in the output section. */
292 *addendp
= (sec
->output_section
->vma
+ sec
->output_offset
) - sec
->vma
;
295 tic54x_lookup_howto (&genrel
, rel
);
301 ticoff0_bad_format_hook (abfd
, filehdr
)
302 bfd
* abfd ATTRIBUTE_UNUSED
;
305 struct internal_filehdr
*internal_f
= (struct internal_filehdr
*) filehdr
;
307 if (COFF0_BADMAG (*internal_f
))
314 ticoff1_bad_format_hook (abfd
, filehdr
)
315 bfd
* abfd ATTRIBUTE_UNUSED
;
318 struct internal_filehdr
*internal_f
= (struct internal_filehdr
*) filehdr
;
320 if (COFF1_BADMAG (*internal_f
))
326 /* replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
329 ticoff_bfd_is_local_label_name (abfd
, name
)
330 bfd
*abfd ATTRIBUTE_UNUSED
;
333 if (TICOFF_LOCAL_LABEL_P(name
))
338 #define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
340 /* Customize coffcode.h; the default coff_ functions are set up to use COFF2;
341 coff_bad_format_hook uses BADMAG, so set that for COFF2. The COFF1
342 and COFF0 vectors use custom _bad_format_hook procs instead of setting
345 #define BADMAG(x) COFF2_BADMAG(x)
346 #include "coffcode.h"
349 tic54x_set_section_contents (abfd
, section
, location
, offset
, bytes_to_do
)
354 bfd_size_type bytes_to_do
;
356 return coff_set_section_contents (abfd
, section
, location
,
357 offset
, bytes_to_do
);
361 tic54x_reloc_processing (relent
, reloc
, symbols
, abfd
, section
)
363 struct internal_reloc
*reloc
;
370 relent
->address
= reloc
->r_vaddr
;
372 if (reloc
->r_symndx
!= -1)
374 if (reloc
->r_symndx
< 0 || reloc
->r_symndx
>= obj_conv_table_size (abfd
))
376 (*_bfd_error_handler
)
377 (_("%s: warning: illegal symbol index %ld in relocs"),
378 bfd_get_filename (abfd
), reloc
->r_symndx
);
379 relent
->sym_ptr_ptr
= bfd_abs_section_ptr
->symbol_ptr_ptr
;
384 relent
->sym_ptr_ptr
= (symbols
385 + obj_convert (abfd
)[reloc
->r_symndx
]);
386 ptr
= *(relent
->sym_ptr_ptr
);
391 relent
->sym_ptr_ptr
= section
->symbol_ptr_ptr
;
392 ptr
= *(relent
->sym_ptr_ptr
);
395 /* The symbols definitions that we have read in have been
396 relocated as if their sections started at 0. But the offsets
397 refering to the symbols in the raw data have not been
398 modified, so we have to have a negative addend to compensate.
400 Note that symbols which used to be common must be left alone */
402 /* Calculate any reloc addend by looking at the symbol */
403 CALC_ADDEND (abfd
, ptr
, *reloc
, relent
);
405 relent
->address
-= section
->vma
;
406 /* !! relent->section = (asection *) NULL;*/
408 /* Fill in the relent->howto field from reloc->r_type */
409 tic54x_lookup_howto (relent
, reloc
);
412 /* COFF0 differs in file/section header size and relocation entry size */
413 static CONST bfd_coff_backend_data ticoff0_swap_table
=
415 coff_SWAP_aux_in
, coff_SWAP_sym_in
, coff_SWAP_lineno_in
,
416 coff_SWAP_aux_out
, coff_SWAP_sym_out
,
417 coff_SWAP_lineno_out
, coff_SWAP_reloc_out
,
418 coff_SWAP_filehdr_out
, coff_SWAP_aouthdr_out
,
419 coff_SWAP_scnhdr_out
,
420 FILHSZ_V0
, AOUTSZ
, SCNHSZ_V01
, SYMESZ
, AUXESZ
, RELSZ_V0
, LINESZ
, FILNMLEN
,
421 #ifdef COFF_LONG_FILENAMES
426 #ifdef COFF_LONG_SECTION_NAMES
431 COFF_DEFAULT_SECTION_ALIGNMENT_POWER
,
432 coff_SWAP_filehdr_in
, coff_SWAP_aouthdr_in
, coff_SWAP_scnhdr_in
,
433 coff_SWAP_reloc_in
, ticoff0_bad_format_hook
, coff_set_arch_mach_hook
,
434 coff_mkobject_hook
, styp_to_sec_flags
, coff_set_alignment_hook
,
435 coff_slurp_symbol_table
, symname_in_debug_hook
, coff_pointerize_aux_hook
,
436 coff_print_aux
, coff_reloc16_extra_cases
, coff_reloc16_estimate
,
437 coff_classify_symbol
, coff_compute_section_file_positions
,
438 coff_start_final_link
, coff_relocate_section
, coff_rtype_to_howto
,
439 coff_adjust_symndx
, coff_link_add_one_symbol
,
440 coff_link_output_has_begun
, coff_final_link_postscript
443 /* COFF1 differs in section header size */
444 static CONST bfd_coff_backend_data ticoff1_swap_table
=
446 coff_SWAP_aux_in
, coff_SWAP_sym_in
, coff_SWAP_lineno_in
,
447 coff_SWAP_aux_out
, coff_SWAP_sym_out
,
448 coff_SWAP_lineno_out
, coff_SWAP_reloc_out
,
449 coff_SWAP_filehdr_out
, coff_SWAP_aouthdr_out
,
450 coff_SWAP_scnhdr_out
,
451 FILHSZ
, AOUTSZ
, SCNHSZ_V01
, SYMESZ
, AUXESZ
, RELSZ
, LINESZ
, FILNMLEN
,
452 #ifdef COFF_LONG_FILENAMES
457 #ifdef COFF_LONG_SECTION_NAMES
462 COFF_DEFAULT_SECTION_ALIGNMENT_POWER
,
463 coff_SWAP_filehdr_in
, coff_SWAP_aouthdr_in
, coff_SWAP_scnhdr_in
,
464 coff_SWAP_reloc_in
, ticoff1_bad_format_hook
, coff_set_arch_mach_hook
,
465 coff_mkobject_hook
, styp_to_sec_flags
, coff_set_alignment_hook
,
466 coff_slurp_symbol_table
, symname_in_debug_hook
, coff_pointerize_aux_hook
,
467 coff_print_aux
, coff_reloc16_extra_cases
, coff_reloc16_estimate
,
468 coff_classify_symbol
, coff_compute_section_file_positions
,
469 coff_start_final_link
, coff_relocate_section
, coff_rtype_to_howto
,
470 coff_adjust_symndx
, coff_link_add_one_symbol
,
471 coff_link_output_has_begun
, coff_final_link_postscript
475 /* TI COFF v0, DOS tools (little-endian headers) */
476 const bfd_target tic54x_coff0_vec
=
478 "coff0-c54x", /* name */
479 bfd_target_coff_flavour
,
480 BFD_ENDIAN_LITTLE
, /* data byte order is little */
481 BFD_ENDIAN_LITTLE
, /* header byte order is little (DOS tools) */
483 (HAS_RELOC
| EXEC_P
| /* object flags */
484 HAS_LINENO
| HAS_DEBUG
|
485 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
487 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
488 '_', /* leading symbol underscore */
489 '/', /* ar_pad_char */
490 15, /* ar_max_namelen */
491 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
492 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
493 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
494 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
495 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
496 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* hdrs */
498 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
499 bfd_generic_archive_p
, _bfd_dummy_target
},
500 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
502 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
503 _bfd_write_archive_contents
, bfd_false
},
505 BFD_JUMP_TABLE_GENERIC (coff
),
506 BFD_JUMP_TABLE_COPY (coff
),
507 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
508 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
509 BFD_JUMP_TABLE_SYMBOLS (coff
),
510 BFD_JUMP_TABLE_RELOCS (coff
),
511 BFD_JUMP_TABLE_WRITE (tic54x
),
512 BFD_JUMP_TABLE_LINK (coff
),
513 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),
516 (PTR
)&ticoff0_swap_table
519 /* TI COFF v0, SPARC tools (big-endian headers) */
520 const bfd_target tic54x_coff0_beh_vec
=
522 "coff0-beh-c54x", /* name */
523 bfd_target_coff_flavour
,
524 BFD_ENDIAN_LITTLE
, /* data byte order is little */
525 BFD_ENDIAN_BIG
, /* header byte order is big */
527 (HAS_RELOC
| EXEC_P
| /* object flags */
528 HAS_LINENO
| HAS_DEBUG
|
529 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
531 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
532 '_', /* leading symbol underscore */
533 '/', /* ar_pad_char */
534 15, /* ar_max_namelen */
535 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
536 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
537 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
538 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
539 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
540 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
, /* hdrs */
542 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
543 bfd_generic_archive_p
, _bfd_dummy_target
},
544 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
546 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
547 _bfd_write_archive_contents
, bfd_false
},
549 BFD_JUMP_TABLE_GENERIC (coff
),
550 BFD_JUMP_TABLE_COPY (coff
),
551 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
552 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
553 BFD_JUMP_TABLE_SYMBOLS (coff
),
554 BFD_JUMP_TABLE_RELOCS (coff
),
555 BFD_JUMP_TABLE_WRITE (tic54x
),
556 BFD_JUMP_TABLE_LINK (coff
),
557 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),
561 (PTR
)&ticoff0_swap_table
564 /* TI COFF v1, DOS tools (little-endian headers) */
565 const bfd_target tic54x_coff1_vec
=
567 "coff1-c54x", /* name */
568 bfd_target_coff_flavour
,
569 BFD_ENDIAN_LITTLE
, /* data byte order is little */
570 BFD_ENDIAN_LITTLE
, /* header byte order is little (DOS tools) */
572 (HAS_RELOC
| EXEC_P
| /* object flags */
573 HAS_LINENO
| HAS_DEBUG
|
574 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
576 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
577 '_', /* leading symbol underscore */
578 '/', /* ar_pad_char */
579 15, /* ar_max_namelen */
580 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
581 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
582 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
583 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
584 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
585 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* hdrs */
587 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
588 bfd_generic_archive_p
, _bfd_dummy_target
},
589 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
591 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
592 _bfd_write_archive_contents
, bfd_false
},
594 BFD_JUMP_TABLE_GENERIC (coff
),
595 BFD_JUMP_TABLE_COPY (coff
),
596 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
597 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
598 BFD_JUMP_TABLE_SYMBOLS (coff
),
599 BFD_JUMP_TABLE_RELOCS (coff
),
600 BFD_JUMP_TABLE_WRITE (tic54x
),
601 BFD_JUMP_TABLE_LINK (coff
),
602 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),
604 &tic54x_coff0_beh_vec
,
606 (PTR
)&ticoff1_swap_table
609 /* TI COFF v1, SPARC tools (big-endian headers) */
610 const bfd_target tic54x_coff1_beh_vec
=
612 "coff1-beh-c54x", /* name */
613 bfd_target_coff_flavour
,
614 BFD_ENDIAN_LITTLE
, /* data byte order is little */
615 BFD_ENDIAN_BIG
, /* header byte order is big */
617 (HAS_RELOC
| EXEC_P
| /* object flags */
618 HAS_LINENO
| HAS_DEBUG
|
619 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
621 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
622 '_', /* leading symbol underscore */
623 '/', /* ar_pad_char */
624 15, /* ar_max_namelen */
625 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
626 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
627 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
628 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
629 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
630 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
, /* hdrs */
632 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
633 bfd_generic_archive_p
, _bfd_dummy_target
},
634 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
636 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
637 _bfd_write_archive_contents
, bfd_false
},
639 BFD_JUMP_TABLE_GENERIC (coff
),
640 BFD_JUMP_TABLE_COPY (coff
),
641 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
642 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
643 BFD_JUMP_TABLE_SYMBOLS (coff
),
644 BFD_JUMP_TABLE_RELOCS (coff
),
645 BFD_JUMP_TABLE_WRITE (tic54x
),
646 BFD_JUMP_TABLE_LINK (coff
),
647 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),
651 (PTR
)&ticoff1_swap_table
654 /* TI COFF v2, TI DOS tools output (little-endian headers) */
655 const bfd_target tic54x_coff2_vec
=
657 "coff2-c54x", /* name */
658 bfd_target_coff_flavour
,
659 BFD_ENDIAN_LITTLE
, /* data byte order is little */
660 BFD_ENDIAN_LITTLE
, /* header byte order is little (DOS tools) */
662 (HAS_RELOC
| EXEC_P
| /* object flags */
663 HAS_LINENO
| HAS_DEBUG
|
664 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
666 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
667 '_', /* leading symbol underscore */
668 '/', /* ar_pad_char */
669 15, /* ar_max_namelen */
670 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
671 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
672 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
673 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
674 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
675 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* hdrs */
677 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
678 bfd_generic_archive_p
, _bfd_dummy_target
},
679 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
681 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
682 _bfd_write_archive_contents
, bfd_false
},
684 BFD_JUMP_TABLE_GENERIC (coff
),
685 BFD_JUMP_TABLE_COPY (coff
),
686 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
687 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
688 BFD_JUMP_TABLE_SYMBOLS (coff
),
689 BFD_JUMP_TABLE_RELOCS (coff
),
690 BFD_JUMP_TABLE_WRITE (tic54x
),
691 BFD_JUMP_TABLE_LINK (coff
),
692 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),
694 &tic54x_coff1_beh_vec
,
699 /* TI COFF v2, TI SPARC tools output (big-endian headers) */
700 const bfd_target tic54x_coff2_beh_vec
=
702 "coff2-beh-c54x", /* name */
703 bfd_target_coff_flavour
,
704 BFD_ENDIAN_LITTLE
, /* data byte order is little */
705 BFD_ENDIAN_BIG
, /* header byte order is big */
707 (HAS_RELOC
| EXEC_P
| /* object flags */
708 HAS_LINENO
| HAS_DEBUG
|
709 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
711 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
712 '_', /* leading symbol underscore */
713 '/', /* ar_pad_char */
714 15, /* ar_max_namelen */
715 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
716 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
717 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
718 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
719 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
720 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
, /* hdrs */
722 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
723 bfd_generic_archive_p
, _bfd_dummy_target
},
724 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
726 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
727 _bfd_write_archive_contents
, bfd_false
},
729 BFD_JUMP_TABLE_GENERIC (coff
),
730 BFD_JUMP_TABLE_COPY (coff
),
731 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
732 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
733 BFD_JUMP_TABLE_SYMBOLS (coff
),
734 BFD_JUMP_TABLE_RELOCS (coff
),
735 BFD_JUMP_TABLE_WRITE (tic54x
),
736 BFD_JUMP_TABLE_LINK (coff
),
737 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),