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
26 #include "coff/tic54x.h"
27 #include "coff/internal.h"
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_vma tic54x_getl32
42 PARAMS ((const bfd_byte
*));
43 static void tic54x_putl32
44 PARAMS ((bfd_vma
, bfd_byte
*));
45 static bfd_signed_vma tic54x_getl_signed_32
46 PARAMS ((const bfd_byte
*));
47 static bfd_boolean tic54x_set_arch_mach
48 PARAMS ((bfd
*, enum bfd_architecture
, unsigned long));
49 static reloc_howto_type
* tic54x_coff_reloc_type_lookup
50 PARAMS ((bfd
*, bfd_reloc_code_real_type
));
51 static void tic54x_lookup_howto
52 PARAMS ((arelent
*, struct internal_reloc
*));
53 static bfd_boolean ticoff_bfd_is_local_label_name
54 PARAMS ((bfd
*, const char *));
57 The octet order is screwy. words are LSB first (LS octet, actually), but
58 longwords are MSW first. For example, 0x12345678 is encoded 0x5678 in the
59 first word and 0x1234 in the second. When looking at the data as stored in
60 the COFF file, you would see the octets ordered as 0x78, 0x56, 0x34, 0x12.
61 Don't bother with 64-bits, as there aren't any. */
69 v
= (unsigned long) addr
[2];
70 v
|= (unsigned long) addr
[3] << 8;
71 v
|= (unsigned long) addr
[0] << 16;
72 v
|= (unsigned long) addr
[1] << 24;
77 tic54x_putl32 (data
, addr
)
81 addr
[2] = (bfd_byte
)data
;
82 addr
[3] = (bfd_byte
) (data
>> 8);
83 addr
[0] = (bfd_byte
) (data
>> 16);
84 addr
[1] = (bfd_byte
) (data
>> 24);
88 tic54x_getl_signed_32 (addr
)
89 register const bfd_byte
*addr
;
93 v
= (unsigned long) addr
[2];
94 v
|= (unsigned long) addr
[3] << 8;
95 v
|= (unsigned long) addr
[0] << 16;
96 v
|= (unsigned long) addr
[1] << 24;
98 ((bfd_signed_vma) (long) (((unsigned long) (x) ^ 0x80000000) - 0x80000000))
102 #define coff_get_section_load_page bfd_ticoff_get_section_load_page
103 #define coff_set_section_load_page bfd_ticoff_set_section_load_page
106 bfd_ticoff_set_section_load_page (sect
, page
)
110 sect
->lma
= (sect
->lma
& ADDR_MASK
) | PG_TO_FLAG(page
);
114 bfd_ticoff_get_section_load_page (sect
)
119 /* Provide meaningful defaults for predefined sections. */
120 if (sect
== &bfd_com_section
)
123 else if (sect
== &bfd_und_section
124 || sect
== &bfd_abs_section
125 || sect
== &bfd_ind_section
)
129 page
= FLAG_TO_PG (sect
->lma
);
134 /* Set the architecture appropriately. Allow unkown architectures
138 tic54x_set_arch_mach (abfd
, arch
, machine
)
140 enum bfd_architecture arch
;
141 unsigned long machine
;
143 if (arch
== bfd_arch_unknown
)
144 arch
= bfd_arch_tic54x
;
146 else if (arch
!= bfd_arch_tic54x
)
149 return bfd_default_set_arch_mach (abfd
, arch
, machine
);
152 static bfd_reloc_status_type
153 tic54x_relocation (abfd
, reloc_entry
, symbol
, data
, input_section
,
154 output_bfd
, error_message
)
155 bfd
*abfd ATTRIBUTE_UNUSED
;
156 arelent
*reloc_entry
;
157 asymbol
*symbol ATTRIBUTE_UNUSED
;
158 PTR data ATTRIBUTE_UNUSED
;
159 asection
*input_section
;
161 char **error_message ATTRIBUTE_UNUSED
;
163 if (output_bfd
!= (bfd
*) NULL
)
165 /* This is a partial relocation, and we want to apply the
166 relocation to the reloc entry rather than the raw data.
167 Modify the reloc inplace to reflect what we now know. */
168 reloc_entry
->address
+= input_section
->output_offset
;
171 return bfd_reloc_continue
;
174 reloc_howto_type tic54x_howto_table
[] =
176 /* type,rightshift,size (0=byte, 1=short, 2=long),
177 bit size, pc_relative, bitpos, dont complain_on_overflow,
178 special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset. */
181 /* 16-bit direct reference to symbol's address. */
182 HOWTO (R_RELWORD
,0,1,16,FALSE
,0,complain_overflow_dont
,
183 tic54x_relocation
,"REL16",FALSE
,0xFFFF,0xFFFF,FALSE
),
185 /* 7 LSBs of an address */
186 HOWTO (R_PARTLS7
,0,1,7,FALSE
,0,complain_overflow_dont
,
187 tic54x_relocation
,"LS7",FALSE
,0x007F,0x007F,FALSE
),
189 /* 9 MSBs of an address */
190 /* TI assembler doesn't shift its encoding, and is thus incompatible */
191 HOWTO (R_PARTMS9
,7,1,9,FALSE
,0,complain_overflow_dont
,
192 tic54x_relocation
,"MS9",FALSE
,0x01FF,0x01FF,FALSE
),
194 /* 23-bit relocation */
195 HOWTO (R_EXTWORD
,0,2,23,FALSE
,0,complain_overflow_dont
,
196 tic54x_relocation
,"RELEXT",FALSE
,0x7FFFFF,0x7FFFFF,FALSE
),
198 /* 16 bits of 23-bit extended address */
199 HOWTO (R_EXTWORD16
,0,1,16,FALSE
,0,complain_overflow_dont
,
200 tic54x_relocation
,"RELEXT16",FALSE
,0x7FFFFF,0x7FFFFF,FALSE
),
202 /* upper 7 bits of 23-bit extended address */
203 HOWTO (R_EXTWORDMS7
,16,1,7,FALSE
,0,complain_overflow_dont
,
204 tic54x_relocation
,"RELEXTMS7",FALSE
,0x7F,0x7F,FALSE
),
207 /* 16-bit direct reference to symbol's address, absolute */
208 HOWTO (R_RELWORD
,0,1,16,FALSE
,0,complain_overflow_dont
,
209 tic54x_relocation
,"AREL16",FALSE
,0xFFFF,0xFFFF,FALSE
),
211 /* 7 LSBs of an address, absolute */
212 HOWTO (R_PARTLS7
,0,1,7,FALSE
,0,complain_overflow_dont
,
213 tic54x_relocation
,"ALS7",FALSE
,0x007F,0x007F,FALSE
),
215 /* 9 MSBs of an address, absolute */
216 /* TI assembler doesn't shift its encoding, and is thus incompatible */
217 HOWTO (R_PARTMS9
,7,1,9,FALSE
,0,complain_overflow_dont
,
218 tic54x_relocation
,"AMS9",FALSE
,0x01FF,0x01FF,FALSE
),
220 /* 23-bit direct reference, absolute */
221 HOWTO (R_EXTWORD
,0,2,23,FALSE
,0,complain_overflow_dont
,
222 tic54x_relocation
,"ARELEXT",FALSE
,0x7FFFFF,0x7FFFFF,FALSE
),
224 /* 16 bits of 23-bit extended address, absolute */
225 HOWTO (R_EXTWORD16
,0,1,16,FALSE
,0,complain_overflow_dont
,
226 tic54x_relocation
,"ARELEXT16",FALSE
,0x7FFFFF,0x7FFFFF,FALSE
),
228 /* upper 7 bits of 23-bit extended address, absolute */
229 HOWTO (R_EXTWORDMS7
,16,1,7,FALSE
,0,complain_overflow_dont
,
230 tic54x_relocation
,"ARELEXTMS7",FALSE
,0x7F,0x7F,FALSE
),
232 /* 32-bit relocation exclusively for stabs */
233 HOWTO (R_RELLONG
,0,2,32,FALSE
,0,complain_overflow_dont
,
234 tic54x_relocation
,"STAB",FALSE
,0xFFFFFFFF,0xFFFFFFFF,FALSE
),
237 #define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup
239 /* For the case statement use the code values used tc_gen_reloc (defined in
240 bfd/reloc.c) to map to the howto table entries. */
243 tic54x_coff_reloc_type_lookup (abfd
, code
)
244 bfd
*abfd ATTRIBUTE_UNUSED
;
245 bfd_reloc_code_real_type code
;
250 return &tic54x_howto_table
[0];
251 case BFD_RELOC_TIC54X_PARTLS7
:
252 return &tic54x_howto_table
[1];
253 case BFD_RELOC_TIC54X_PARTMS9
:
254 return &tic54x_howto_table
[2];
255 case BFD_RELOC_TIC54X_23
:
256 return &tic54x_howto_table
[3];
257 case BFD_RELOC_TIC54X_16_OF_23
:
258 return &tic54x_howto_table
[4];
259 case BFD_RELOC_TIC54X_MS7_OF_23
:
260 return &tic54x_howto_table
[5];
262 return &tic54x_howto_table
[12];
264 return (reloc_howto_type
*) NULL
;
268 /* Code to turn a r_type into a howto ptr, uses the above howto table.
269 Called after some initial checking by the tic54x_rtype_to_howto fn below. */
272 tic54x_lookup_howto (internal
, dst
)
274 struct internal_reloc
*dst
;
277 int bank
= (dst
->r_symndx
== -1) ? HOWTO_BANK
: 0;
279 for (i
= 0; i
< sizeof tic54x_howto_table
/sizeof tic54x_howto_table
[0]; i
++)
281 if (tic54x_howto_table
[i
].type
== dst
->r_type
)
283 internal
->howto
= tic54x_howto_table
+ i
+ bank
;
288 (*_bfd_error_handler
) (_("Unrecognized reloc type 0x%x"),
289 (unsigned int) dst
->r_type
);
293 #define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\
294 tic54x_reloc_processing(RELENT,RELOC,SYMS,ABFD,SECT)
296 #define coff_rtype_to_howto coff_tic54x_rtype_to_howto
298 static reloc_howto_type
*
299 coff_tic54x_rtype_to_howto (abfd
, sec
, rel
, h
, sym
, addendp
)
300 bfd
*abfd ATTRIBUTE_UNUSED
;
302 struct internal_reloc
*rel
;
303 struct coff_link_hash_entry
*h ATTRIBUTE_UNUSED
;
304 struct internal_syment
*sym ATTRIBUTE_UNUSED
;
309 if (rel
->r_symndx
== -1 && addendp
!= NULL
)
311 /* This is a TI "internal relocation", which means that the relocation
312 amount is the amount by which the current section is being relocated
313 in the output section. */
314 *addendp
= (sec
->output_section
->vma
+ sec
->output_offset
) - sec
->vma
;
317 tic54x_lookup_howto (&genrel
, rel
);
322 /* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
326 ticoff_bfd_is_local_label_name (abfd
, name
)
327 bfd
*abfd ATTRIBUTE_UNUSED
;
330 if (TICOFF_LOCAL_LABEL_P(name
))
335 #define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
337 /* Customize coffcode.h; the default coff_ functions are set up to use COFF2;
338 coff_bad_format_hook uses BADMAG, so set that for COFF2. The COFF1
339 and COFF0 vectors use custom _bad_format_hook procs instead of setting
341 #define BADMAG(x) COFF2_BADMAG(x)
342 #include "coffcode.h"
345 tic54x_set_section_contents (abfd
, section
, location
, offset
, bytes_to_do
)
350 bfd_size_type bytes_to_do
;
352 return coff_set_section_contents (abfd
, section
, location
,
353 offset
, bytes_to_do
);
357 tic54x_reloc_processing (relent
, reloc
, symbols
, abfd
, section
)
359 struct internal_reloc
*reloc
;
366 relent
->address
= reloc
->r_vaddr
;
368 if (reloc
->r_symndx
!= -1)
370 if (reloc
->r_symndx
< 0 || reloc
->r_symndx
>= obj_conv_table_size (abfd
))
372 (*_bfd_error_handler
)
373 (_("%s: warning: illegal symbol index %ld in relocs"),
374 bfd_archive_filename (abfd
), reloc
->r_symndx
);
375 relent
->sym_ptr_ptr
= bfd_abs_section_ptr
->symbol_ptr_ptr
;
380 relent
->sym_ptr_ptr
= (symbols
381 + obj_convert (abfd
)[reloc
->r_symndx
]);
382 ptr
= *(relent
->sym_ptr_ptr
);
387 relent
->sym_ptr_ptr
= section
->symbol_ptr_ptr
;
388 ptr
= *(relent
->sym_ptr_ptr
);
391 /* The symbols definitions that we have read in have been
392 relocated as if their sections started at 0. But the offsets
393 refering to the symbols in the raw data have not been
394 modified, so we have to have a negative addend to compensate.
396 Note that symbols which used to be common must be left alone. */
398 /* Calculate any reloc addend by looking at the symbol. */
399 CALC_ADDEND (abfd
, ptr
, *reloc
, relent
);
401 relent
->address
-= section
->vma
;
402 /* !! relent->section = (asection *) NULL;*/
404 /* Fill in the relent->howto field from reloc->r_type. */
405 tic54x_lookup_howto (relent
, reloc
);
408 /* TI COFF v0, DOS tools (little-endian headers). */
409 const bfd_target tic54x_coff0_vec
=
411 "coff0-c54x", /* name */
412 bfd_target_coff_flavour
,
413 BFD_ENDIAN_LITTLE
, /* data byte order is little */
414 BFD_ENDIAN_LITTLE
, /* header byte order is little (DOS tools) */
416 (HAS_RELOC
| EXEC_P
| /* object flags */
417 HAS_LINENO
| HAS_DEBUG
|
418 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
420 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
421 '_', /* leading symbol underscore */
422 '/', /* ar_pad_char */
423 15, /* ar_max_namelen */
424 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
425 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
426 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
427 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
428 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
429 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* hdrs */
431 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
432 bfd_generic_archive_p
, _bfd_dummy_target
},
433 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
435 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
436 _bfd_write_archive_contents
, bfd_false
},
438 BFD_JUMP_TABLE_GENERIC (coff
),
439 BFD_JUMP_TABLE_COPY (coff
),
440 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
441 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
442 BFD_JUMP_TABLE_SYMBOLS (coff
),
443 BFD_JUMP_TABLE_RELOCS (coff
),
444 BFD_JUMP_TABLE_WRITE (tic54x
),
445 BFD_JUMP_TABLE_LINK (coff
),
446 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),
449 (PTR
) & ticoff0_swap_table
452 /* TI COFF v0, SPARC tools (big-endian headers). */
453 const bfd_target tic54x_coff0_beh_vec
=
455 "coff0-beh-c54x", /* name */
456 bfd_target_coff_flavour
,
457 BFD_ENDIAN_LITTLE
, /* data byte order is little */
458 BFD_ENDIAN_BIG
, /* header byte order is big */
460 (HAS_RELOC
| EXEC_P
| /* object flags */
461 HAS_LINENO
| HAS_DEBUG
|
462 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
464 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
465 '_', /* leading symbol underscore */
466 '/', /* ar_pad_char */
467 15, /* ar_max_namelen */
468 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
469 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
470 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
471 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
472 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
473 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
, /* hdrs */
475 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
476 bfd_generic_archive_p
, _bfd_dummy_target
},
477 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
479 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
480 _bfd_write_archive_contents
, bfd_false
},
482 BFD_JUMP_TABLE_GENERIC (coff
),
483 BFD_JUMP_TABLE_COPY (coff
),
484 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
485 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
486 BFD_JUMP_TABLE_SYMBOLS (coff
),
487 BFD_JUMP_TABLE_RELOCS (coff
),
488 BFD_JUMP_TABLE_WRITE (tic54x
),
489 BFD_JUMP_TABLE_LINK (coff
),
490 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),
494 (PTR
) & ticoff0_swap_table
497 /* TI COFF v1, DOS tools (little-endian headers). */
498 const bfd_target tic54x_coff1_vec
=
500 "coff1-c54x", /* name */
501 bfd_target_coff_flavour
,
502 BFD_ENDIAN_LITTLE
, /* data byte order is little */
503 BFD_ENDIAN_LITTLE
, /* header byte order is little (DOS tools) */
505 (HAS_RELOC
| EXEC_P
| /* object flags */
506 HAS_LINENO
| HAS_DEBUG
|
507 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
509 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
510 '_', /* leading symbol underscore */
511 '/', /* ar_pad_char */
512 15, /* ar_max_namelen */
513 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
514 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
515 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
516 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
517 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
518 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* hdrs */
520 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
521 bfd_generic_archive_p
, _bfd_dummy_target
},
522 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
524 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
525 _bfd_write_archive_contents
, bfd_false
},
527 BFD_JUMP_TABLE_GENERIC (coff
),
528 BFD_JUMP_TABLE_COPY (coff
),
529 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
530 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
531 BFD_JUMP_TABLE_SYMBOLS (coff
),
532 BFD_JUMP_TABLE_RELOCS (coff
),
533 BFD_JUMP_TABLE_WRITE (tic54x
),
534 BFD_JUMP_TABLE_LINK (coff
),
535 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),
537 & tic54x_coff0_beh_vec
,
539 (PTR
) & ticoff1_swap_table
542 /* TI COFF v1, SPARC tools (big-endian headers). */
543 const bfd_target tic54x_coff1_beh_vec
=
545 "coff1-beh-c54x", /* name */
546 bfd_target_coff_flavour
,
547 BFD_ENDIAN_LITTLE
, /* data byte order is little */
548 BFD_ENDIAN_BIG
, /* header byte order is big */
550 (HAS_RELOC
| EXEC_P
| /* object flags */
551 HAS_LINENO
| HAS_DEBUG
|
552 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
554 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
555 '_', /* leading symbol underscore */
556 '/', /* ar_pad_char */
557 15, /* ar_max_namelen */
558 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
559 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
560 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
561 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
562 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
563 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
, /* hdrs */
565 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
566 bfd_generic_archive_p
, _bfd_dummy_target
},
567 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
569 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
570 _bfd_write_archive_contents
, bfd_false
},
572 BFD_JUMP_TABLE_GENERIC (coff
),
573 BFD_JUMP_TABLE_COPY (coff
),
574 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
575 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
576 BFD_JUMP_TABLE_SYMBOLS (coff
),
577 BFD_JUMP_TABLE_RELOCS (coff
),
578 BFD_JUMP_TABLE_WRITE (tic54x
),
579 BFD_JUMP_TABLE_LINK (coff
),
580 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),
584 (PTR
) & ticoff1_swap_table
587 /* TI COFF v2, TI DOS tools output (little-endian headers). */
588 const bfd_target tic54x_coff2_vec
=
590 "coff2-c54x", /* name */
591 bfd_target_coff_flavour
,
592 BFD_ENDIAN_LITTLE
, /* data byte order is little */
593 BFD_ENDIAN_LITTLE
, /* header byte order is little (DOS tools) */
595 (HAS_RELOC
| EXEC_P
| /* object flags */
596 HAS_LINENO
| HAS_DEBUG
|
597 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
599 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
600 '_', /* leading symbol underscore */
601 '/', /* ar_pad_char */
602 15, /* ar_max_namelen */
603 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
604 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
605 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
606 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
607 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
608 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* hdrs */
610 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
611 bfd_generic_archive_p
, _bfd_dummy_target
},
612 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
614 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
615 _bfd_write_archive_contents
, bfd_false
},
617 BFD_JUMP_TABLE_GENERIC (coff
),
618 BFD_JUMP_TABLE_COPY (coff
),
619 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
620 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
621 BFD_JUMP_TABLE_SYMBOLS (coff
),
622 BFD_JUMP_TABLE_RELOCS (coff
),
623 BFD_JUMP_TABLE_WRITE (tic54x
),
624 BFD_JUMP_TABLE_LINK (coff
),
625 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),
627 & tic54x_coff1_beh_vec
,
632 /* TI COFF v2, TI SPARC tools output (big-endian headers). */
633 const bfd_target tic54x_coff2_beh_vec
=
635 "coff2-beh-c54x", /* name */
636 bfd_target_coff_flavour
,
637 BFD_ENDIAN_LITTLE
, /* data byte order is little */
638 BFD_ENDIAN_BIG
, /* header byte order is big */
640 (HAS_RELOC
| EXEC_P
| /* object flags */
641 HAS_LINENO
| HAS_DEBUG
|
642 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
),
644 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
645 '_', /* leading symbol underscore */
646 '/', /* ar_pad_char */
647 15, /* ar_max_namelen */
648 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
649 tic54x_getl32
, tic54x_getl_signed_32
, tic54x_putl32
,
650 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
651 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
652 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
653 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
, /* hdrs */
655 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
656 bfd_generic_archive_p
, _bfd_dummy_target
},
657 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
659 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
660 _bfd_write_archive_contents
, bfd_false
},
662 BFD_JUMP_TABLE_GENERIC (coff
),
663 BFD_JUMP_TABLE_COPY (coff
),
664 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
665 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
666 BFD_JUMP_TABLE_SYMBOLS (coff
),
667 BFD_JUMP_TABLE_RELOCS (coff
),
668 BFD_JUMP_TABLE_WRITE (tic54x
),
669 BFD_JUMP_TABLE_LINK (coff
),
670 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),