1 /* SuperH SH64-specific support for 32-bit ELF
2 Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
25 #include "../opcodes/sh64-opc.h"
26 #include "elf32-sh64.h"
28 /* Add a suffix for datalabel indirection symbols. It must not match any
29 other symbols; user symbols with or without version or other
30 decoration. It must only be used internally and not emitted by any
32 #define DATALABEL_SUFFIX " DL"
34 /* Used to hold data for function called through bfd_map_over_sections. */
35 struct sh64_find_section_vma_data
41 static bfd_boolean sh64_elf_new_section_hook
43 static bfd_boolean sh64_elf_copy_private_data
45 static bfd_boolean sh64_elf_merge_private_data
47 static bfd_boolean sh64_elf_fake_sections
48 (bfd *, Elf_Internal_Shdr *, asection *);
49 static bfd_boolean sh64_elf_set_private_flags
51 static bfd_boolean sh64_elf_set_mach_from_flags
53 static bfd_boolean shmedia_prepare_reloc
54 (struct bfd_link_info *, bfd *, asection *, bfd_byte *,
55 const Elf_Internal_Rela *, bfd_vma *);
56 static int sh64_elf_get_symbol_type
57 (Elf_Internal_Sym *, int);
58 static bfd_boolean sh64_elf_add_symbol_hook
59 (bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, const char **,
60 flagword *, asection **, bfd_vma *);
61 static bfd_boolean sh64_elf_link_output_symbol_hook
62 (bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *,
64 static bfd_boolean sh64_backend_section_from_shdr
65 (bfd *, Elf_Internal_Shdr *, const char *);
66 static void sh64_elf_final_write_processing
68 static bfd_boolean sh64_bfd_elf_copy_private_section_data
69 (bfd *, asection *, bfd *, asection *);
70 static void sh64_find_section_for_address
71 (bfd *, asection *, void *);
73 /* Let elf32-sh.c handle the "bfd_" definitions, so we only have to
74 intrude with an #ifndef around the function definition. */
75 #define sh_elf_copy_private_data sh64_elf_copy_private_data
76 #define sh_elf_merge_private_data sh64_elf_merge_private_data
77 #define sh_elf_set_private_flags sh64_elf_set_private_flags
78 /* Typo in elf32-sh.c (and unlinear name). */
79 #define bfd_elf32_bfd_set_private_flags sh64_elf_set_private_flags
80 #define sh_elf_set_mach_from_flags sh64_elf_set_mach_from_flags
82 #define elf_backend_sign_extend_vma 1
83 #define elf_backend_fake_sections sh64_elf_fake_sections
84 #define elf_backend_get_symbol_type sh64_elf_get_symbol_type
85 #define elf_backend_add_symbol_hook sh64_elf_add_symbol_hook
86 #define elf_backend_link_output_symbol_hook \
87 sh64_elf_link_output_symbol_hook
88 #define elf_backend_final_write_processing sh64_elf_final_write_processing
89 #define elf_backend_section_from_shdr sh64_backend_section_from_shdr
91 #define bfd_elf32_new_section_hook sh64_elf_new_section_hook
93 /* For objcopy, we need to set up sh64_elf_section_data (asection *) from
94 incoming section flags. This is otherwise done in sh64elf.em when
95 linking or tc-sh64.c when assembling. */
96 #define bfd_elf32_bfd_copy_private_section_data \
97 sh64_bfd_elf_copy_private_section_data
99 /* This COFF-only function (only compiled with COFF support, making
100 ELF-only chains problematic) returns TRUE early for SH4, so let's just
101 define it TRUE here. */
102 #define _bfd_sh_align_load_span(a,b,c,d,e,f,g,h,i,j) TRUE
104 #define GOT_BIAS (-((long)-32768))
105 #define INCLUDE_SHMEDIA
106 #include "elf32-sh.c"
108 /* Tack some extra info on struct bfd_elf_section_data. */
111 sh64_elf_new_section_hook (bfd *abfd, asection *sec)
113 struct _sh64_elf_section_data *sdata;
114 bfd_size_type amt = sizeof (*sdata);
116 sdata = (struct _sh64_elf_section_data *) bfd_zalloc (abfd, amt);
119 sec->used_by_bfd = sdata;
121 return _bfd_elf_new_section_hook (abfd, sec);
124 /* Set the SHF_SH5_ISA32 flag for ISA SHmedia code sections, and pass
125 through SHT_SH5_CR_SORTED on a sorted .cranges section. */
128 sh64_elf_fake_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
129 Elf_Internal_Shdr *elf_section_hdr,
132 if (sh64_elf_section_data (asect)->sh64_info != NULL)
133 elf_section_hdr->sh_flags
134 |= sh64_elf_section_data (asect)->sh64_info->contents_flags;
136 /* If this section has the SEC_SORT_ENTRIES flag set, it is a sorted
137 .cranges section passing through objcopy. */
138 if ((bfd_get_section_flags (output_bfd, asect) & SEC_SORT_ENTRIES) != 0
139 && strcmp (bfd_get_section_name (output_bfd, asect),
140 SH64_CRANGES_SECTION_NAME) == 0)
141 elf_section_hdr->sh_type = SHT_SH5_CR_SORTED;
147 sh64_elf_set_mach_from_flags (bfd *abfd)
149 flagword flags = elf_elfheader (abfd)->e_flags;
152 switch (flags & EF_SH_MACH_MASK)
155 /* These are fit to execute on SH5. Just one but keep the switch
156 construct to make additions easy. */
157 bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh5);
161 bfd_set_error (bfd_error_wrong_format);
165 /* We also need to set SEC_DEBUGGING on an incoming .cranges section.
166 We could have used elf_backend_section_flags if it had given us the
167 section name; the bfd_section member in the header argument is not
168 set at the point of the call. FIXME: Find out whether that is by
169 undocumented design or a bug. */
170 cranges = bfd_get_section_by_name (abfd, SH64_CRANGES_SECTION_NAME);
172 && ! bfd_set_section_flags (abfd, cranges,
173 bfd_get_section_flags (abfd, cranges)
181 sh64_elf_copy_private_data (bfd * ibfd, bfd * obfd)
183 if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour
184 || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
187 BFD_ASSERT (!elf_flags_init (obfd)
188 || (elf_elfheader (obfd)->e_flags
189 == elf_elfheader (ibfd)->e_flags));
191 elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
196 sh64_elf_merge_private_data (bfd *ibfd, bfd *obfd)
198 flagword old_flags, new_flags;
200 if (! _bfd_generic_verify_endian_match (ibfd, obfd))
203 if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour
204 || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
207 if (bfd_get_arch_size (ibfd) != bfd_get_arch_size (obfd))
211 if (bfd_get_arch_size (ibfd) == 32
212 && bfd_get_arch_size (obfd) == 64)
213 msg = _("%s: compiled as 32-bit object and %s is 64-bit");
214 else if (bfd_get_arch_size (ibfd) == 64
215 && bfd_get_arch_size (obfd) == 32)
216 msg = _("%s: compiled as 64-bit object and %s is 32-bit");
218 msg = _("%s: object size does not match that of target %s");
220 (*_bfd_error_handler) (msg, bfd_get_filename (ibfd),
221 bfd_get_filename (obfd));
222 bfd_set_error (bfd_error_wrong_format);
226 old_flags = elf_elfheader (obfd)->e_flags;
227 new_flags = elf_elfheader (ibfd)->e_flags;
228 if (! elf_flags_init (obfd))
230 /* This happens when ld starts out with a 'blank' output file. */
231 elf_flags_init (obfd) = TRUE;
232 elf_elfheader (obfd)->e_flags = old_flags = new_flags;
234 /* We don't allow linking in non-SH64 code. */
235 else if ((new_flags & EF_SH_MACH_MASK) != EF_SH5)
237 (*_bfd_error_handler)
238 ("%s: uses non-SH64 instructions while previous modules use SH64 instructions",
239 bfd_get_filename (ibfd));
240 bfd_set_error (bfd_error_bad_value);
244 /* I can't think of anything sane other than old_flags being EF_SH5 and
245 that we need to preserve that. */
246 elf_elfheader (obfd)->e_flags = old_flags;
247 return sh64_elf_set_mach_from_flags (obfd);
250 /* Handle a SH64-specific section when reading an object file. This
251 is called when elfcode.h finds a section with an unknown type.
253 We only recognize SHT_SH5_CR_SORTED, on the .cranges section. */
256 sh64_backend_section_from_shdr (bfd *abfd, Elf_Internal_Shdr *hdr,
261 /* We do like MIPS with a bit switch for recognized types, and returning
262 FALSE for a recognized section type with an unexpected name. Right
263 now we only have one recognized type, but that might change. */
264 switch (hdr->sh_type)
266 case SHT_SH5_CR_SORTED:
267 if (strcmp (name, SH64_CRANGES_SECTION_NAME) != 0)
270 /* We set the SEC_SORT_ENTRIES flag so it can be passed on to
271 sh64_elf_fake_sections, keeping SHT_SH5_CR_SORTED if this object
272 passes through objcopy. Perhaps it is brittle; the flag can
273 suddenly be used by other BFD parts, but it seems not really used
274 anywhere at the moment. */
275 flags = SEC_DEBUGGING | SEC_SORT_ENTRIES;
282 if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name))
286 && ! bfd_set_section_flags (abfd, hdr->bfd_section,
287 bfd_get_section_flags (abfd,
295 /* In contrast to sh64_backend_section_from_shdr, this is called for all
296 sections, but only when copying sections, not when linking or
297 assembling. We need to set up the sh64_elf_section_data (asection *)
298 structure for the SH64 ELF section flags to be copied correctly. */
301 sh64_bfd_elf_copy_private_section_data (bfd *ibfd, asection *isec,
302 bfd *obfd, asection *osec)
304 struct sh64_section_data *sh64_sec_data;
306 if (ibfd->xvec->flavour != bfd_target_elf_flavour
307 || obfd->xvec->flavour != bfd_target_elf_flavour)
310 if (! _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec))
313 sh64_sec_data = sh64_elf_section_data (isec)->sh64_info;
314 if (sh64_sec_data == NULL)
316 sh64_sec_data = bfd_zmalloc (sizeof (struct sh64_section_data));
318 if (sh64_sec_data == NULL)
321 sh64_sec_data->contents_flags
322 = (elf_section_data (isec)->this_hdr.sh_flags
323 & (SHF_SH5_ISA32 | SHF_SH5_ISA32_MIXED));
325 sh64_elf_section_data (osec)->sh64_info = sh64_sec_data;
331 /* Function to keep SH64 specific file flags. */
334 sh64_elf_set_private_flags (bfd *abfd, flagword flags)
336 BFD_ASSERT (! elf_flags_init (abfd)
337 || elf_elfheader (abfd)->e_flags == flags);
339 elf_elfheader (abfd)->e_flags = flags;
340 elf_flags_init (abfd) = TRUE;
341 return sh64_elf_set_mach_from_flags (abfd);
344 /* Called when writing out an object file to decide the type of a symbol. */
347 sh64_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
349 if (ELF_ST_TYPE (elf_sym->st_info) == STT_DATALABEL)
350 return STT_DATALABEL;
355 /* Hook called by the linker routine which adds symbols from an object
356 file. We must make indirect symbols for undefined symbols marked with
357 STT_DATALABEL, so relocations passing them will pick up that attribute
358 and neutralize STO_SH5_ISA32 found on the symbol definition.
360 There is a problem, though: We want to fill in the hash-table entry for
361 this symbol and signal to the caller that no further processing is
362 needed. But we don't have the index for this hash-table entry. We
363 rely here on that the current entry is the first hash-entry with NULL,
364 which seems brittle. Also, iterating over the hash-table to find that
365 entry is a linear operation on the number of symbols in this input
366 file, and this function should take constant time, so that's not good
367 too. Only comfort is that DataLabel references should only be found in
368 hand-written assembly code and thus be rare. FIXME: Talk maintainers
369 into adding an option to elf_add_symbol_hook (preferably) for the index
370 or the hash entry, alternatively adding the index to Elf_Internal_Sym
374 sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
375 const Elf_Internal_Sym *sym, const char **namep,
376 flagword *flagsp ATTRIBUTE_UNUSED,
377 asection **secp, bfd_vma *valp)
379 /* We want to do this for relocatable as well as final linking. */
380 if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL
381 && info->hash->creator->flavour == bfd_target_elf_flavour)
383 struct elf_link_hash_entry *h;
385 /* For relocatable links, we register the DataLabel sym in its own
386 right, and tweak the name when it's output. Otherwise, we make
387 an indirect symbol of it. */
389 = info->relocatable || info->emitrelocations
390 ? BSF_GLOBAL : BSF_GLOBAL | BSF_INDIRECT;
393 = bfd_malloc (strlen (*namep) + sizeof (DATALABEL_SUFFIX));
394 struct elf_link_hash_entry ** sym_hash = elf_sym_hashes (abfd);
396 BFD_ASSERT (sym_hash != NULL);
398 /* Allocation may fail. */
402 strcpy (dl_name, *namep);
403 strcat (dl_name, DATALABEL_SUFFIX);
405 h = (struct elf_link_hash_entry *)
406 bfd_link_hash_lookup (info->hash, dl_name, FALSE, FALSE, FALSE);
410 /* No previous datalabel symbol. Make one. */
411 struct bfd_link_hash_entry *bh = NULL;
412 struct elf_backend_data *bed = get_elf_backend_data (abfd);
414 if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name,
423 h = (struct elf_link_hash_entry *) bh;
424 h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
425 h->type = STT_DATALABEL;
428 /* If a new symbol was created, it holds the allocated name.
429 Otherwise, we don't need it anymore and should deallocate it. */
432 if (h->type != STT_DATALABEL
433 || ((info->relocatable || info->emitrelocations)
434 && h->root.type != bfd_link_hash_undefined)
435 || (! info->relocatable && !info->emitrelocations
436 && h->root.type != bfd_link_hash_indirect))
438 /* Make sure we don't get confused on invalid input. */
439 (*_bfd_error_handler)
440 (_("%s: encountered datalabel symbol in input"),
441 bfd_get_filename (abfd));
442 bfd_set_error (bfd_error_bad_value);
446 /* Now find the hash-table slot for this entry and fill it in. */
447 while (*sym_hash != NULL)
451 /* Signal to caller to skip this symbol - we've handled it. */
458 /* This hook function is called before the linker writes out a global
459 symbol. For relocatable links, DataLabel symbols will be present in
460 linker output. We cut off the special suffix on those symbols, so the
461 right name appears in the output.
463 When linking and emitting relocations, there can appear global symbols
464 that are not referenced by relocs, but rather only implicitly through
465 DataLabel references, a relation that is not visible to the linker.
466 Since no stripping of global symbols in done when doing such linking,
467 we don't need to look up and make sure to emit the main symbol for each
471 sh64_elf_link_output_symbol_hook (bfd *abfd ATTRIBUTE_UNUSED,
472 struct bfd_link_info *info,
474 Elf_Internal_Sym *sym,
475 asection *input_sec ATTRIBUTE_UNUSED)
477 char *name = (char *) cname;
479 if (info->relocatable || info->emitrelocations)
481 if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL)
482 name[strlen (name) - strlen (DATALABEL_SUFFIX)] = 0;
488 /* Check a SH64-specific reloc and put the value to relocate to into
489 RELOCATION, ready to pass to _bfd_final_link_relocate. Return FALSE if
490 bad value, TRUE if ok. */
493 shmedia_prepare_reloc (struct bfd_link_info *info, bfd *abfd,
494 asection *input_section, bfd_byte *contents,
495 const Elf_Internal_Rela *rel, bfd_vma *relocation)
497 bfd_vma disp, dropped;
499 switch (ELF32_R_TYPE (rel->r_info))
502 /* Check the lowest bit of the destination field. If it is 1, we
503 check the ISA type of the destination (i.e. the low bit of the
504 "relocation" value, and emit an error if the instruction does not
505 match). If it is 0, we change a PTA to PTB. There should never
506 be a PTB that should change to a PTA; that indicates a toolchain
507 error; a mismatch with GAS. */
510 bfd_vma insn = bfd_get_32 (abfd, contents + rel->r_offset);
512 if (insn & (1 << 10))
514 /* Check matching insn and ISA (address of target). */
515 if ((insn & SHMEDIA_PTB_BIT) != 0
516 && ((*relocation + rel->r_addend) & 1) != 0)
517 msg = _("PTB mismatch: a SHmedia address (bit 0 == 1)");
518 else if ((insn & SHMEDIA_PTB_BIT) == 0
519 && ((*relocation + rel->r_addend) & 1) == 0)
520 msg = _("PTA mismatch: a SHcompact address (bit 0 == 0)");
523 && ! ((*info->callbacks->reloc_dangerous)
524 (info, msg, abfd, input_section,
530 /* We shouldn't get here with a PTB insn and a R_SH_PT_16. It
531 means GAS output does not match expectations; a PTA or PTB
532 expressed as such (or a PT found at assembly to be PTB)
533 would match the test above, and PT expansion with an
534 unknown destination (or when relaxing) will get us here. */
535 if ((insn & SHMEDIA_PTB_BIT) != 0)
537 (*_bfd_error_handler)
538 (_("%s: GAS error: unexpected PTB insn with R_SH_PT_16"),
539 bfd_get_filename (input_section->owner));
543 /* Change the PTA to a PTB, if destination indicates so. */
544 if (((*relocation + rel->r_addend) & 1) == 0)
545 bfd_put_32 (abfd, insn | SHMEDIA_PTB_BIT,
546 contents + rel->r_offset);
550 case R_SH_SHMEDIA_CODE:
561 case R_SH_IMM_LOW16_PCREL:
562 case R_SH_IMM_MEDLOW16:
563 case R_SH_IMM_MEDLOW16_PCREL:
564 case R_SH_IMM_MEDHI16:
565 case R_SH_IMM_MEDHI16_PCREL:
567 case R_SH_IMM_HI16_PCREL:
576 disp = (*relocation & 0xf);
578 switch (ELF32_R_TYPE (rel->r_info))
580 case R_SH_DIR10SW: dropped = disp & 1; break;
581 case R_SH_DIR10SL: dropped = disp & 3; break;
582 case R_SH_DIR10SQ: dropped = disp & 7; break;
586 (*_bfd_error_handler)
587 (_("%s: error: unaligned relocation type %d at %08x reloc %08x\n"),
588 bfd_get_filename (input_section->owner), ELF32_R_TYPE (rel->r_info),
589 (unsigned)rel->r_offset, (unsigned)relocation);
596 /* Helper function to locate the section holding a certain address. This
597 is called via bfd_map_over_sections. */
600 sh64_find_section_for_address (bfd *abfd ATTRIBUTE_UNUSED,
601 asection *section, void *data)
605 struct sh64_find_section_vma_data *fsec_datap
606 = (struct sh64_find_section_vma_data *) data;
608 /* Return if already found. */
609 if (fsec_datap->section)
612 /* If this section isn't part of the addressable contents, skip it. */
613 if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0)
616 vma = bfd_get_section_vma (abfd, section);
617 if (fsec_datap->addr < vma)
620 /* FIXME: section->reloc_done isn't set properly; a generic buglet
621 preventing us from using bfd_get_section_size_after_reloc. */
623 = section->_cooked_size ? section->_cooked_size : section->_raw_size;
625 if (fsec_datap->addr >= vma + size)
628 fsec_datap->section = section;
631 /* Make sure to write out the generated entries in the .cranges section
632 when doing partial linking, and set bit 0 on the entry address if it
633 points to SHmedia code and write sorted .cranges entries when writing
634 executables (final linking and objcopy). */
637 sh64_elf_final_write_processing (bfd *abfd,
638 bfd_boolean linker ATTRIBUTE_UNUSED)
640 bfd_vma ld_generated_cranges_size;
642 = bfd_get_section_by_name (abfd, SH64_CRANGES_SECTION_NAME);
644 /* If no new .cranges were added, the generic ELF linker parts will
645 write it all out. If not, we need to write them out when doing
646 partial linking. For a final link, we will sort them and write them
647 all out further below. */
650 && elf_elfheader (abfd)->e_type != ET_EXEC
651 && (ld_generated_cranges_size
652 = sh64_elf_section_data (cranges)->sh64_info->cranges_growth) != 0)
654 bfd_vma incoming_cranges_size
655 = ((cranges->_cooked_size != 0
656 ? cranges->_cooked_size : cranges->_raw_size)
657 - ld_generated_cranges_size);
659 if (! bfd_set_section_contents (abfd, cranges,
661 + incoming_cranges_size,
662 cranges->output_offset
663 + incoming_cranges_size,
664 ld_generated_cranges_size))
666 bfd_set_error (bfd_error_file_truncated);
667 (*_bfd_error_handler)
668 (_("%s: could not write out added .cranges entries"),
669 bfd_get_filename (abfd));
673 /* Only set entry address bit 0 and sort .cranges when linking to an
674 executable; never with objcopy or strip. */
675 if (linker && elf_elfheader (abfd)->e_type == ET_EXEC)
677 struct sh64_find_section_vma_data fsec_data;
678 sh64_elf_crange dummy;
680 /* For a final link, set the low bit of the entry address to
681 reflect whether or not it is a SHmedia address.
682 FIXME: Perhaps we shouldn't do this if the entry address was
683 supplied numerically, but we currently lack the infrastructure to
684 recognize that: The entry symbol, and info whether it is numeric
685 or a symbol name is kept private in the linker. */
686 fsec_data.addr = elf_elfheader (abfd)->e_entry;
687 fsec_data.section = NULL;
689 bfd_map_over_sections (abfd, sh64_find_section_for_address,
691 if (fsec_data.section
692 && (sh64_get_contents_type (fsec_data.section,
693 elf_elfheader (abfd)->e_entry,
694 &dummy) == CRT_SH5_ISA32))
695 elf_elfheader (abfd)->e_entry |= 1;
697 /* If we have a .cranges section, sort the entries. */
700 bfd_size_type cranges_size
701 = (cranges->_cooked_size != 0
702 ? cranges->_cooked_size : cranges->_raw_size);
704 /* We know we always have these in memory at this time. */
705 BFD_ASSERT (cranges->contents != NULL);
707 /* The .cranges may already have been sorted in the process of
708 finding out the ISA-type of the entry address. If not, we do
710 if (elf_section_data (cranges)->this_hdr.sh_type
711 != SHT_SH5_CR_SORTED)
713 qsort (cranges->contents, cranges_size / SH64_CRANGE_SIZE,
715 bfd_big_endian (cranges->owner)
716 ? _bfd_sh64_crange_qsort_cmpb
717 : _bfd_sh64_crange_qsort_cmpl);
718 elf_section_data (cranges)->this_hdr.sh_type
722 /* We need to write it out in whole as sorted. */
723 if (! bfd_set_section_contents (abfd, cranges,
725 cranges->output_offset,
728 bfd_set_error (bfd_error_file_truncated);
729 (*_bfd_error_handler)
730 (_("%s: could not write out sorted .cranges entries"),
731 bfd_get_filename (abfd));
737 #undef TARGET_BIG_SYM
738 #define TARGET_BIG_SYM bfd_elf32_sh64_vec
739 #undef TARGET_BIG_NAME
740 #define TARGET_BIG_NAME "elf32-sh64"
741 #undef TARGET_LITTLE_SYM
742 #define TARGET_LITTLE_SYM bfd_elf32_sh64l_vec
743 #undef TARGET_LITTLE_NAME
744 #define TARGET_LITTLE_NAME "elf32-sh64l"
746 #include "elf32-target.h"
748 /* NetBSD support. */
749 #undef TARGET_BIG_SYM
750 #define TARGET_BIG_SYM bfd_elf32_sh64nbsd_vec
751 #undef TARGET_BIG_NAME
752 #define TARGET_BIG_NAME "elf32-sh64-nbsd"
753 #undef TARGET_LITTLE_SYM
754 #define TARGET_LITTLE_SYM bfd_elf32_sh64lnbsd_vec
755 #undef TARGET_LITTLE_NAME
756 #define TARGET_LITTLE_NAME "elf32-sh64l-nbsd"
757 #undef ELF_MAXPAGESIZE
758 #define ELF_MAXPAGESIZE 0x10000
759 #undef elf_symbol_leading_char
760 #define elf_symbol_leading_char 0
762 #define elf32_bed elf32_sh64_nbsd_bed
764 #include "elf32-target.h"
767 #undef TARGET_BIG_SYM
768 #define TARGET_BIG_SYM bfd_elf32_sh64blin_vec
769 #undef TARGET_BIG_NAME
770 #define TARGET_BIG_NAME "elf32-sh64big-linux"
771 #undef TARGET_LITTLE_SYM
772 #define TARGET_LITTLE_SYM bfd_elf32_sh64lin_vec
773 #undef TARGET_LITTLE_NAME
774 #define TARGET_LITTLE_NAME "elf32-sh64-linux"
776 #define elf32_bed elf32_sh64_lin_bed
778 #include "elf32-target.h"