1 /* 32-bit ELF support for TI C6X
3 Free Software Foundation, Inc.
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
25 #include "libiberty.h"
27 #include "elf/tic6x.h"
29 static reloc_howto_type elf32_tic6x_howto_table[] =
31 HOWTO (R_C6000_NONE, /* type */
33 0, /* size (0 = byte, 1 = short, 2 = long) */
35 FALSE, /* pc_relative */
37 complain_overflow_dont,/* complain_on_overflow */
38 bfd_elf_generic_reloc, /* special_function */
39 "R_C6000_NONE", /* name */
40 FALSE, /* partial_inplace */
43 FALSE), /* pcrel_offset */
44 HOWTO (R_C6000_ABS32, /* type */
46 2, /* size (0 = byte, 1 = short, 2 = long) */
48 FALSE, /* pc_relative */
50 complain_overflow_dont,/* complain_on_overflow */
51 bfd_elf_generic_reloc, /* special_function */
52 "R_C6000_ABS32", /* name */
53 FALSE, /* partial_inplace */
55 0xffffffff, /* dst_mask */
56 FALSE), /* pcrel_offset */
57 HOWTO (R_C6000_ABS16, /* type */
59 1, /* size (0 = byte, 1 = short, 2 = long) */
61 FALSE, /* pc_relative */
63 complain_overflow_bitfield,/* complain_on_overflow */
64 bfd_elf_generic_reloc, /* special_function */
65 "R_C6000_ABS16", /* name */
66 FALSE, /* partial_inplace */
68 0x0000ffff, /* dst_mask */
69 FALSE), /* pcrel_offset */
70 HOWTO (R_C6000_ABS8, /* type */
72 0, /* size (0 = byte, 1 = short, 2 = long) */
74 FALSE, /* pc_relative */
76 complain_overflow_bitfield,/* complain_on_overflow */
77 bfd_elf_generic_reloc, /* special_function */
78 "R_C6000_ABS8", /* name */
79 FALSE, /* partial_inplace */
81 0x000000ff, /* dst_mask */
82 FALSE), /* pcrel_offset */
83 HOWTO (R_C6000_PCR_S21, /* type */
85 2, /* size (0 = byte, 1 = short, 2 = long) */
87 TRUE, /* pc_relative */
89 complain_overflow_signed,/* complain_on_overflow */
90 bfd_elf_generic_reloc, /* special_function */
91 "R_C6000_PCR_S21", /* name */
92 FALSE, /* partial_inplace */
94 0x0fffff80, /* dst_mask */
95 TRUE), /* pcrel_offset */
96 HOWTO (R_C6000_PCR_S12, /* type */
98 2, /* size (0 = byte, 1 = short, 2 = long) */
100 TRUE, /* pc_relative */
102 complain_overflow_signed,/* complain_on_overflow */
103 bfd_elf_generic_reloc, /* special_function */
104 "R_C6000_PCR_S12", /* name */
105 FALSE, /* partial_inplace */
107 0x0fff0000, /* dst_mask */
108 TRUE), /* pcrel_offset */
109 HOWTO (R_C6000_PCR_S10, /* type */
111 2, /* size (0 = byte, 1 = short, 2 = long) */
113 TRUE, /* pc_relative */
115 complain_overflow_signed,/* complain_on_overflow */
116 bfd_elf_generic_reloc, /* special_function */
117 "R_C6000_PCR_S10", /* name */
118 FALSE, /* partial_inplace */
120 0x007fe000, /* dst_mask */
121 TRUE), /* pcrel_offset */
122 HOWTO (R_C6000_PCR_S7, /* type */
124 2, /* size (0 = byte, 1 = short, 2 = long) */
126 TRUE, /* pc_relative */
128 complain_overflow_signed,/* complain_on_overflow */
129 bfd_elf_generic_reloc, /* special_function */
130 "R_C6000_PCR_S7", /* name */
131 FALSE, /* partial_inplace */
133 0x007f0000, /* dst_mask */
134 TRUE), /* pcrel_offset */
135 HOWTO (R_C6000_ABS_S16, /* type */
137 2, /* size (0 = byte, 1 = short, 2 = long) */
139 FALSE, /* pc_relative */
141 complain_overflow_signed,/* complain_on_overflow */
142 bfd_elf_generic_reloc, /* special_function */
143 "R_C6000_ABS_S16", /* name */
144 FALSE, /* partial_inplace */
146 0x007fff80, /* dst_mask */
147 FALSE), /* pcrel_offset */
148 HOWTO (R_C6000_ABS_L16, /* type */
150 2, /* size (0 = byte, 1 = short, 2 = long) */
152 FALSE, /* pc_relative */
154 complain_overflow_dont,/* complain_on_overflow */
155 bfd_elf_generic_reloc, /* special_function */
156 "R_C6000_ABS_L16", /* name */
157 FALSE, /* partial_inplace */
159 0x007fff80, /* dst_mask */
160 FALSE), /* pcrel_offset */
161 HOWTO (R_C6000_ABS_H16, /* type */
163 2, /* size (0 = byte, 1 = short, 2 = long) */
165 FALSE, /* pc_relative */
167 complain_overflow_dont,/* complain_on_overflow */
168 bfd_elf_generic_reloc, /* special_function */
169 "R_C6000_ABS_H16", /* name */
170 FALSE, /* partial_inplace */
172 0x007fff80, /* dst_mask */
173 FALSE), /* pcrel_offset */
174 HOWTO (R_C6000_SBR_U15_B, /* type */
176 2, /* size (0 = byte, 1 = short, 2 = long) */
178 FALSE, /* pc_relative */
180 complain_overflow_unsigned,/* complain_on_overflow */
181 bfd_elf_generic_reloc, /* special_function */
182 "R_C6000_SBR_U15_B", /* name */
183 FALSE, /* partial_inplace */
185 0x007fff00, /* dst_mask */
186 FALSE), /* pcrel_offset */
187 HOWTO (R_C6000_SBR_U15_H, /* type */
189 2, /* size (0 = byte, 1 = short, 2 = long) */
191 FALSE, /* pc_relative */
193 complain_overflow_unsigned,/* complain_on_overflow */
194 bfd_elf_generic_reloc, /* special_function */
195 "R_C6000_SBR_U15_H", /* name */
196 FALSE, /* partial_inplace */
198 0x007fff00, /* dst_mask */
199 FALSE), /* pcrel_offset */
200 HOWTO (R_C6000_SBR_U15_W, /* type */
202 2, /* size (0 = byte, 1 = short, 2 = long) */
204 FALSE, /* pc_relative */
206 complain_overflow_unsigned,/* complain_on_overflow */
207 bfd_elf_generic_reloc, /* special_function */
208 "R_C6000_SBR_U15_W", /* name */
209 FALSE, /* partial_inplace */
211 0x007fff00, /* dst_mask */
212 FALSE), /* pcrel_offset */
213 HOWTO (R_C6000_SBR_S16, /* type */
215 2, /* size (0 = byte, 1 = short, 2 = long) */
217 FALSE, /* pc_relative */
219 complain_overflow_signed,/* complain_on_overflow */
220 bfd_elf_generic_reloc, /* special_function */
221 "R_C6000_SBR_S16", /* name */
222 FALSE, /* partial_inplace */
224 0x007fff80, /* dst_mask */
225 FALSE), /* pcrel_offset */
226 HOWTO (R_C6000_SBR_L16_B, /* type */
228 2, /* size (0 = byte, 1 = short, 2 = long) */
230 FALSE, /* pc_relative */
232 complain_overflow_dont,/* complain_on_overflow */
233 bfd_elf_generic_reloc, /* special_function */
234 "R_C6000_SBR_L16_B", /* name */
235 FALSE, /* partial_inplace */
237 0x007fff80, /* dst_mask */
238 FALSE), /* pcrel_offset */
239 HOWTO (R_C6000_SBR_L16_H, /* type */
241 2, /* size (0 = byte, 1 = short, 2 = long) */
243 FALSE, /* pc_relative */
245 complain_overflow_dont,/* complain_on_overflow */
246 bfd_elf_generic_reloc, /* special_function */
247 "R_C6000_SBR_L16_H", /* name */
248 FALSE, /* partial_inplace */
250 0x007fff80, /* dst_mask */
251 FALSE), /* pcrel_offset */
252 HOWTO (R_C6000_SBR_L16_W, /* type */
254 2, /* size (0 = byte, 1 = short, 2 = long) */
256 FALSE, /* pc_relative */
258 complain_overflow_dont,/* complain_on_overflow */
259 bfd_elf_generic_reloc, /* special_function */
260 "R_C6000_SBR_L16_W", /* name */
261 FALSE, /* partial_inplace */
263 0x007fff80, /* dst_mask */
264 FALSE), /* pcrel_offset */
265 HOWTO (R_C6000_SBR_H16_B, /* type */
267 2, /* size (0 = byte, 1 = short, 2 = long) */
269 FALSE, /* pc_relative */
271 complain_overflow_dont,/* complain_on_overflow */
272 bfd_elf_generic_reloc, /* special_function */
273 "R_C6000_SBR_H16_B", /* name */
274 FALSE, /* partial_inplace */
276 0x007fff80, /* dst_mask */
277 FALSE), /* pcrel_offset */
278 HOWTO (R_C6000_SBR_H16_H, /* type */
280 2, /* size (0 = byte, 1 = short, 2 = long) */
282 FALSE, /* pc_relative */
284 complain_overflow_dont,/* complain_on_overflow */
285 bfd_elf_generic_reloc, /* special_function */
286 "R_C6000_SBR_H16_H", /* name */
287 FALSE, /* partial_inplace */
289 0x007fff80, /* dst_mask */
290 FALSE), /* pcrel_offset */
291 HOWTO (R_C6000_SBR_H16_W, /* type */
293 2, /* size (0 = byte, 1 = short, 2 = long) */
295 FALSE, /* pc_relative */
297 complain_overflow_dont,/* complain_on_overflow */
298 bfd_elf_generic_reloc, /* special_function */
299 "R_C6000_SBR_H16_W", /* name */
300 FALSE, /* partial_inplace */
302 0x007fff80, /* dst_mask */
303 FALSE), /* pcrel_offset */
304 HOWTO (R_C6000_SBR_GOT_U15_W, /* type */
306 2, /* size (0 = byte, 1 = short, 2 = long) */
308 FALSE, /* pc_relative */
310 complain_overflow_unsigned,/* complain_on_overflow */
311 bfd_elf_generic_reloc, /* special_function */
312 "R_C6000_SBR_GOT_U15_W",/* name */
313 FALSE, /* partial_inplace */
315 0x007fff00, /* dst_mask */
316 FALSE), /* pcrel_offset */
317 HOWTO (R_C6000_SBR_GOT_L16_W, /* type */
319 2, /* size (0 = byte, 1 = short, 2 = long) */
321 FALSE, /* pc_relative */
323 complain_overflow_dont,/* complain_on_overflow */
324 bfd_elf_generic_reloc, /* special_function */
325 "R_C6000_SBR_GOT_L16_W",/* name */
326 FALSE, /* partial_inplace */
328 0x007fff80, /* dst_mask */
329 FALSE), /* pcrel_offset */
330 HOWTO (R_C6000_SBR_GOT_H16_W, /* type */
332 2, /* size (0 = byte, 1 = short, 2 = long) */
334 FALSE, /* pc_relative */
336 complain_overflow_dont,/* complain_on_overflow */
337 bfd_elf_generic_reloc, /* special_function */
338 "R_C6000_SBR_GOT_H16_W",/* name */
339 FALSE, /* partial_inplace */
341 0x007fff80, /* dst_mask */
342 FALSE), /* pcrel_offset */
343 HOWTO (R_C6000_DSBT_INDEX, /* type */
345 2, /* size (0 = byte, 1 = short, 2 = long) */
347 FALSE, /* pc_relative */
349 complain_overflow_unsigned,/* complain_on_overflow */
350 bfd_elf_generic_reloc, /* special_function */
351 "R_C6000_DSBT_INDEX", /* name */
352 FALSE, /* partial_inplace */
354 0x007fff00, /* dst_mask */
355 FALSE), /* pcrel_offset */
356 HOWTO (R_C6000_PREL31, /* type */
358 2, /* size (0 = byte, 1 = short, 2 = long) */
360 FALSE, /* pc_relative */
362 complain_overflow_dont,/* complain_on_overflow */
363 bfd_elf_generic_reloc, /* special_function */
364 "R_C6000_PREL31", /* name */
365 FALSE, /* partial_inplace */
367 0x7fffffff, /* dst_mask */
368 FALSE), /* pcrel_offset */
369 HOWTO (R_C6000_COPY, /* type */
371 2, /* size (0 = byte, 1 = short, 2 = long) */
373 FALSE, /* pc_relative */
375 complain_overflow_dont,/* complain_on_overflow */
376 bfd_elf_generic_reloc, /* special_function */
377 "R_C6000_COPY", /* name */
378 FALSE, /* partial_inplace */
380 0xffffffff, /* dst_mask */
381 FALSE), /* pcrel_offset */
608 HOWTO (R_C6000_ALIGN, /* type */
610 0, /* size (0 = byte, 1 = short, 2 = long) */
612 FALSE, /* pc_relative */
614 complain_overflow_dont,/* complain_on_overflow */
615 bfd_elf_generic_reloc, /* special_function */
616 "R_C6000_ALIGN", /* name */
617 FALSE, /* partial_inplace */
620 FALSE), /* pcrel_offset */
621 HOWTO (R_C6000_FPHEAD, /* type */
623 0, /* size (0 = byte, 1 = short, 2 = long) */
625 FALSE, /* pc_relative */
627 complain_overflow_dont,/* complain_on_overflow */
628 bfd_elf_generic_reloc, /* special_function */
629 "R_C6000_FPHEAD", /* name */
630 FALSE, /* partial_inplace */
633 FALSE), /* pcrel_offset */
634 HOWTO (R_C6000_NOCMP, /* type */
636 0, /* size (0 = byte, 1 = short, 2 = long) */
638 FALSE, /* pc_relative */
640 complain_overflow_dont,/* complain_on_overflow */
641 bfd_elf_generic_reloc, /* special_function */
642 "R_C6000_NOCMP", /* name */
643 FALSE, /* partial_inplace */
646 FALSE) /* pcrel_offset */
649 /* Map BFD relocations to ELF relocations. */
653 bfd_reloc_code_real_type bfd_reloc_val;
654 enum elf_tic6x_reloc_type elf_reloc_val;
657 static const tic6x_reloc_map elf32_tic6x_reloc_map[] =
659 { BFD_RELOC_NONE, R_C6000_NONE },
660 { BFD_RELOC_32, R_C6000_ABS32 },
661 { BFD_RELOC_16, R_C6000_ABS16 },
662 { BFD_RELOC_8, R_C6000_ABS8 },
663 { BFD_RELOC_C6000_PCR_S21, R_C6000_PCR_S21 },
664 { BFD_RELOC_C6000_PCR_S12, R_C6000_PCR_S12 },
665 { BFD_RELOC_C6000_PCR_S10, R_C6000_PCR_S10 },
666 { BFD_RELOC_C6000_PCR_S7, R_C6000_PCR_S7 },
667 { BFD_RELOC_C6000_ABS_S16, R_C6000_ABS_S16 },
668 { BFD_RELOC_C6000_ABS_L16, R_C6000_ABS_L16 },
669 { BFD_RELOC_C6000_ABS_H16, R_C6000_ABS_H16 },
670 { BFD_RELOC_C6000_SBR_U15_B, R_C6000_SBR_U15_B },
671 { BFD_RELOC_C6000_SBR_U15_H, R_C6000_SBR_U15_H },
672 { BFD_RELOC_C6000_SBR_U15_W, R_C6000_SBR_U15_W },
673 { BFD_RELOC_C6000_SBR_S16, R_C6000_SBR_S16 },
674 { BFD_RELOC_C6000_SBR_L16_B, R_C6000_SBR_L16_B },
675 { BFD_RELOC_C6000_SBR_L16_H, R_C6000_SBR_L16_H },
676 { BFD_RELOC_C6000_SBR_L16_W, R_C6000_SBR_L16_W },
677 { BFD_RELOC_C6000_SBR_H16_B, R_C6000_SBR_H16_B },
678 { BFD_RELOC_C6000_SBR_H16_H, R_C6000_SBR_H16_H },
679 { BFD_RELOC_C6000_SBR_H16_W, R_C6000_SBR_H16_W },
680 { BFD_RELOC_C6000_SBR_GOT_U15_W, R_C6000_SBR_GOT_U15_W },
681 { BFD_RELOC_C6000_SBR_GOT_L16_W, R_C6000_SBR_GOT_L16_W },
682 { BFD_RELOC_C6000_SBR_GOT_H16_W, R_C6000_SBR_GOT_H16_W },
683 { BFD_RELOC_C6000_DSBT_INDEX, R_C6000_DSBT_INDEX },
684 { BFD_RELOC_C6000_PREL31, R_C6000_PREL31 },
685 { BFD_RELOC_C6000_COPY, R_C6000_COPY },
686 { BFD_RELOC_C6000_ALIGN, R_C6000_ALIGN },
687 { BFD_RELOC_C6000_FPHEAD, R_C6000_FPHEAD },
688 { BFD_RELOC_C6000_NOCMP, R_C6000_NOCMP }
691 static reloc_howto_type *
692 elf32_tic6x_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
693 bfd_reloc_code_real_type code)
697 for (i = 0; i < ARRAY_SIZE (elf32_tic6x_reloc_map); i++)
698 if (elf32_tic6x_reloc_map[i].bfd_reloc_val == code)
699 return &elf32_tic6x_howto_table[elf32_tic6x_reloc_map[i].elf_reloc_val];
704 static reloc_howto_type *
705 elf32_tic6x_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
709 for (i = 0; i < ARRAY_SIZE (elf32_tic6x_howto_table); i++)
710 if (elf32_tic6x_howto_table[i].name != NULL
711 && strcasecmp (elf32_tic6x_howto_table[i].name, r_name) == 0)
712 return &elf32_tic6x_howto_table[i];
718 elf32_tic6x_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc,
719 Elf_Internal_Rela *elf_reloc)
723 r_type = ELF32_R_TYPE (elf_reloc->r_info);
724 if (r_type >= ARRAY_SIZE (elf32_tic6x_howto_table))
725 bfd_reloc->howto = NULL;
727 bfd_reloc->howto = &elf32_tic6x_howto_table[r_type];
731 elf32_tic6x_relocate_section (bfd *output_bfd,
732 struct bfd_link_info *info,
734 asection *input_section,
736 Elf_Internal_Rela *relocs,
737 Elf_Internal_Sym *local_syms,
738 asection **local_sections)
740 Elf_Internal_Shdr *symtab_hdr;
741 struct elf_link_hash_entry **sym_hashes;
742 Elf_Internal_Rela *rel;
743 Elf_Internal_Rela *relend;
744 bfd_boolean ok = TRUE;
746 symtab_hdr = & elf_symtab_hdr (input_bfd);
747 sym_hashes = elf_sym_hashes (input_bfd);
749 relend = relocs + input_section->reloc_count;
751 for (rel = relocs; rel < relend; rel ++)
754 unsigned long r_symndx;
756 reloc_howto_type *howto;
757 Elf_Internal_Sym *sym;
759 struct elf_link_hash_entry *h;
761 bfd_boolean unresolved_reloc;
762 bfd_reloc_status_type r;
763 struct bfd_link_hash_entry *sbh;
765 r_type = ELF32_R_TYPE (rel->r_info);
766 r_symndx = ELF32_R_SYM (rel->r_info);
768 elf32_tic6x_info_to_howto (input_bfd, &bfd_reloc, rel);
769 howto = bfd_reloc.howto;
772 bfd_set_error (bfd_error_bad_value);
779 unresolved_reloc = FALSE;
781 if (r_symndx < symtab_hdr->sh_info)
783 sym = local_syms + r_symndx;
784 sec = local_sections[r_symndx];
785 relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
791 RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
792 r_symndx, symtab_hdr, sym_hashes,
794 unresolved_reloc, warned);
797 if (sec != NULL && elf_discarded_section (sec))
799 /* For relocs against symbols from removed linkonce sections,
800 or sections discarded by a linker script, we just want the
801 section contents zeroed. Avoid any special processing. */
802 _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset);
808 if (info->relocatable)
817 /* No action needed. */
820 case R_C6000_PCR_S21:
821 case R_C6000_PCR_S12:
822 case R_C6000_PCR_S10:
824 /* Generic PC-relative handling produces a value relative to
825 the exact location of the relocation. Adjust it to be
826 relative to the start of the fetch packet instead. */
827 relocation += (input_section->output_section->vma
828 + input_section->output_offset
829 + rel->r_offset) & 0x1f;
834 case R_C6000_ABS_S16:
835 case R_C6000_ABS_L16:
836 case R_C6000_ABS_H16:
837 /* Generic logic OK. */
840 case R_C6000_SBR_U15_B:
841 case R_C6000_SBR_U15_H:
842 case R_C6000_SBR_U15_W:
843 case R_C6000_SBR_S16:
844 case R_C6000_SBR_L16_B:
845 case R_C6000_SBR_L16_H:
846 case R_C6000_SBR_L16_W:
847 case R_C6000_SBR_H16_B:
848 case R_C6000_SBR_H16_H:
849 case R_C6000_SBR_H16_W:
850 sbh = bfd_link_hash_lookup (info->hash, "__c6xabi_DSBT_BASE",
853 && (sbh->type == bfd_link_hash_defined
854 || sbh->type == bfd_link_hash_defweak))
855 relocation -= (sbh->u.def.value
856 + sbh->u.def.section->output_section->vma
857 + sbh->u.def.section->output_offset);
860 (*_bfd_error_handler) (_("%B: SB-relative relocation but "
861 "__c6xabi_DSBT_BASE not defined"),
868 case R_C6000_SBR_GOT_U15_W:
869 case R_C6000_SBR_GOT_L16_W:
870 case R_C6000_SBR_GOT_H16_W:
871 case R_C6000_DSBT_INDEX:
873 /* Shared libraries and exception handling support not
875 (*_bfd_error_handler) (_("%B: relocation type %d not implemented"),
881 /* Invalid in relocatable object. */
883 /* Unknown relocation. */
884 (*_bfd_error_handler) (_("%B: invalid relocation type %d"),
890 r = _bfd_final_link_relocate (howto, input_bfd, input_section,
891 contents, rel->r_offset,
892 relocation, rel->r_addend);
894 if (r == bfd_reloc_ok
895 && howto->complain_on_overflow == complain_overflow_bitfield)
897 /* Generic overflow handling accepts cases the ABI says
898 should be rejected for R_C6000_ABS16 and
900 bfd_vma value = (relocation + rel->r_addend) & 0xffffffff;
901 bfd_vma sbit = 1 << (howto->bitsize - 1);
902 bfd_vma sbits = (-(bfd_vma) sbit) & 0xffffffff;
903 bfd_vma value_sbits = value & sbits;
906 && value_sbits != sbit
907 && value_sbits != sbits)
908 r = bfd_reloc_overflow;
911 if (r != bfd_reloc_ok)
914 const char *error_message;
917 name = h->root.root.string;
920 name = bfd_elf_string_from_elf_section (input_bfd,
926 name = bfd_section_name (input_bfd, sec);
931 case bfd_reloc_overflow:
932 /* If the overflowing reloc was to an undefined symbol,
933 we have already printed one error message and there
934 is no point complaining again. */
936 h->root.type != bfd_link_hash_undefined)
937 && (!((*info->callbacks->reloc_overflow)
938 (info, (h ? &h->root : NULL), name, howto->name,
939 (bfd_vma) 0, input_bfd, input_section,
944 case bfd_reloc_undefined:
945 if (!((*info->callbacks->undefined_symbol)
946 (info, name, input_bfd, input_section,
947 rel->r_offset, TRUE)))
951 case bfd_reloc_outofrange:
952 error_message = _("out of range");
955 case bfd_reloc_notsupported:
956 error_message = _("unsupported relocation");
959 case bfd_reloc_dangerous:
960 error_message = _("dangerous relocation");
964 error_message = _("unknown error");
968 BFD_ASSERT (error_message != NULL);
969 if (!((*info->callbacks->reloc_dangerous)
970 (info, error_message, input_bfd, input_section,
982 #define TARGET_LITTLE_SYM bfd_elf32_tic6x_le_vec
983 #define TARGET_LITTLE_NAME "elf32-tic6x-le"
984 #define TARGET_BIG_SYM bfd_elf32_tic6x_be_vec
985 #define TARGET_BIG_NAME "elf32-tic6x-be"
986 #define ELF_ARCH bfd_arch_tic6x
987 #define ELF_MACHINE_CODE EM_TI_C6000
988 #define ELF_MAXPAGESIZE 1
989 #define bfd_elf32_bfd_reloc_type_lookup elf32_tic6x_reloc_type_lookup
990 #define bfd_elf32_bfd_reloc_name_lookup elf32_tic6x_reloc_name_lookup
991 #define elf_backend_can_gc_sections 1
992 #define elf_backend_default_use_rela_p 1
993 #define elf_backend_may_use_rel_p 1
994 #define elf_backend_may_use_rela_p 1
995 #define elf_backend_rela_normal 1
996 #define elf_backend_relocate_section elf32_tic6x_relocate_section
997 #define elf_info_to_howto elf32_tic6x_info_to_howto
998 #define elf_info_to_howto_rel _bfd_elf_no_info_to_howto
1000 #include "elf32-target.h"