00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "bfd.h"
00025 #include "sysdep.h"
00026 #include "libbfd.h"
00027 #include "elf-bfd.h"
00028 #include "elf/iq2000.h"
00029
00030
00031
00032 static bfd_reloc_status_type iq2000_elf_howto_hi16_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
00033
00034
00035 static reloc_howto_type iq2000_elf_howto_table [] =
00036 {
00037
00038
00039 HOWTO (R_IQ2000_NONE,
00040 0,
00041 2,
00042 32,
00043 FALSE,
00044 0,
00045 complain_overflow_bitfield,
00046 bfd_elf_generic_reloc,
00047 "R_IQ2000_NONE",
00048 FALSE,
00049 0,
00050 0,
00051 FALSE),
00052
00053
00054 HOWTO (R_IQ2000_16,
00055 0,
00056 1,
00057 16,
00058 FALSE,
00059 0,
00060 complain_overflow_bitfield,
00061 bfd_elf_generic_reloc,
00062 "R_IQ2000_16",
00063 FALSE,
00064 0x0000,
00065 0xffff,
00066 FALSE),
00067
00068
00069 HOWTO (R_IQ2000_32,
00070 0,
00071 2,
00072 31,
00073 FALSE,
00074 0,
00075 complain_overflow_bitfield,
00076 bfd_elf_generic_reloc,
00077 "R_IQ2000_32",
00078 FALSE,
00079 0x00000000,
00080 0x7fffffff,
00081 FALSE),
00082
00083
00084 HOWTO (R_IQ2000_26,
00085 2,
00086 2,
00087 26,
00088 FALSE,
00089 0,
00090 complain_overflow_dont,
00091
00092
00093
00094 bfd_elf_generic_reloc,
00095 "R_IQ2000_26",
00096 FALSE,
00097 0x00000000,
00098 0x03ffffff,
00099 FALSE),
00100
00101
00102 HOWTO (R_IQ2000_PC16,
00103 2,
00104 2,
00105 16,
00106 TRUE,
00107 0,
00108 complain_overflow_signed,
00109 bfd_elf_generic_reloc,
00110 "R_IQ2000_PC16",
00111 FALSE,
00112 0x0000,
00113 0xffff,
00114 TRUE),
00115
00116
00117 HOWTO (R_IQ2000_HI16,
00118 16,
00119 2,
00120 15,
00121 FALSE,
00122 0,
00123 complain_overflow_dont,
00124 iq2000_elf_howto_hi16_reloc,
00125 "R_IQ2000_HI16",
00126 FALSE,
00127 0x0000,
00128 0x7fff,
00129 FALSE),
00130
00131
00132 HOWTO (R_IQ2000_LO16,
00133 0,
00134 2,
00135 16,
00136 FALSE,
00137 0,
00138 complain_overflow_dont,
00139 bfd_elf_generic_reloc,
00140 "R_IQ2000_LO16",
00141 FALSE,
00142 0x0000,
00143 0xffff,
00144 FALSE),
00145
00146
00147 HOWTO (R_IQ2000_OFFSET_16,
00148 2,
00149 2,
00150 16,
00151 FALSE,
00152 0,
00153 complain_overflow_dont,
00154 bfd_elf_generic_reloc,
00155 "R_IQ2000_OFFSET_16",
00156 FALSE,
00157 0x0000,
00158 0xffff,
00159 FALSE),
00160
00161
00162 HOWTO (R_IQ2000_OFFSET_21,
00163 2,
00164 2,
00165 21,
00166 FALSE,
00167 0,
00168 complain_overflow_dont,
00169 bfd_elf_generic_reloc,
00170 "R_IQ2000_OFFSET_21",
00171 FALSE,
00172 0x000000,
00173 0x1fffff,
00174 FALSE),
00175
00176
00177 HOWTO (R_IQ2000_OFFSET_21,
00178 16,
00179 2,
00180 16,
00181 FALSE,
00182 0,
00183 complain_overflow_dont,
00184 bfd_elf_generic_reloc,
00185 "R_IQ2000_UHI16",
00186 FALSE,
00187 0x0000,
00188 0x7fff,
00189 FALSE),
00190
00191
00192 HOWTO (R_IQ2000_32_DEBUG,
00193 0,
00194 2,
00195 32,
00196 FALSE,
00197 0,
00198 complain_overflow_bitfield,
00199 bfd_elf_generic_reloc,
00200 "R_IQ2000_32",
00201 FALSE,
00202 0x00000000,
00203 0xffffffff,
00204 FALSE),
00205
00206 };
00207
00208
00209 static reloc_howto_type iq2000_elf_vtinherit_howto =
00210 HOWTO (R_IQ2000_GNU_VTINHERIT,
00211 0,
00212 2,
00213 0,
00214 FALSE,
00215 0,
00216 complain_overflow_dont,
00217 NULL,
00218 "R_IQ2000_GNU_VTINHERIT",
00219 FALSE,
00220 0,
00221 0,
00222 FALSE);
00223
00224
00225 static reloc_howto_type iq2000_elf_vtentry_howto =
00226 HOWTO (R_IQ2000_GNU_VTENTRY,
00227 0,
00228 2,
00229 0,
00230 FALSE,
00231 0,
00232 complain_overflow_dont,
00233 NULL,
00234 "R_IQ2000_GNU_VTENTRY",
00235 FALSE,
00236 0,
00237 0,
00238 FALSE);
00239
00240
00241 static bfd_reloc_status_type
00242 iq2000_elf_howto_hi16_reloc (bfd *abfd ATTRIBUTE_UNUSED,
00243 arelent *reloc_entry,
00244 asymbol *symbol,
00245 void * data,
00246 asection *input_section,
00247 bfd *output_bfd,
00248 char **error_message ATTRIBUTE_UNUSED)
00249 {
00250 bfd_reloc_status_type ret;
00251 bfd_vma relocation;
00252
00253
00254
00255 if (output_bfd != (bfd *) NULL
00256 && (symbol->flags & BSF_SECTION_SYM) == 0
00257 && reloc_entry->addend == 0)
00258 {
00259 reloc_entry->address += input_section->output_offset;
00260 return bfd_reloc_ok;
00261 }
00262
00263 if (bfd_is_com_section (symbol->section))
00264 relocation = 0;
00265 else
00266 relocation = symbol->value;
00267
00268 relocation += symbol->section->output_section->vma;
00269 relocation += symbol->section->output_offset;
00270 relocation += reloc_entry->addend;
00271
00272
00273 if (relocation & 0x8000)
00274 reloc_entry->addend += 0x10000;
00275
00276
00277 ret = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
00278 input_section, output_bfd, error_message);
00279
00280
00281 if (relocation & 0x8000)
00282 reloc_entry->addend -= 0x10000;
00283
00284 return ret;
00285 }
00286
00287 static bfd_reloc_status_type
00288 iq2000_elf_relocate_hi16 (bfd *input_bfd,
00289 Elf_Internal_Rela *relhi,
00290 bfd_byte *contents,
00291 bfd_vma value)
00292 {
00293 bfd_vma insn;
00294
00295 insn = bfd_get_32 (input_bfd, contents + relhi->r_offset);
00296
00297 value += relhi->r_addend;
00298 value &= 0x7fffffff;
00299
00300
00301
00302 if (value & 0x8000)
00303 value += 0x10000;
00304
00305 value >>= 16;
00306 insn = ((insn & ~0xFFFF) | value);
00307
00308 bfd_put_32 (input_bfd, insn, contents + relhi->r_offset);
00309 return bfd_reloc_ok;
00310 }
00311
00312
00313
00314 static reloc_howto_type *
00315 iq2000_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
00316 bfd_reloc_code_real_type code)
00317 {
00318
00319
00320
00321
00322
00323 switch (code)
00324 {
00325 case BFD_RELOC_NONE:
00326 return &iq2000_elf_howto_table[ (int) R_IQ2000_NONE];
00327 case BFD_RELOC_16:
00328 return &iq2000_elf_howto_table[ (int) R_IQ2000_16];
00329 case BFD_RELOC_32:
00330 return &iq2000_elf_howto_table[ (int) R_IQ2000_32];
00331 case BFD_RELOC_MIPS_JMP:
00332 return &iq2000_elf_howto_table[ (int) R_IQ2000_26];
00333 case BFD_RELOC_IQ2000_OFFSET_16:
00334 return &iq2000_elf_howto_table[ (int) R_IQ2000_OFFSET_16];
00335 case BFD_RELOC_IQ2000_OFFSET_21:
00336 return &iq2000_elf_howto_table[ (int) R_IQ2000_OFFSET_21];
00337 case BFD_RELOC_16_PCREL_S2:
00338 return &iq2000_elf_howto_table[ (int) R_IQ2000_PC16];
00339 case BFD_RELOC_HI16:
00340 return &iq2000_elf_howto_table[ (int) R_IQ2000_HI16];
00341 case BFD_RELOC_IQ2000_UHI16:
00342 return &iq2000_elf_howto_table[ (int) R_IQ2000_UHI16];
00343 case BFD_RELOC_LO16:
00344 return &iq2000_elf_howto_table[ (int) R_IQ2000_LO16];
00345 case BFD_RELOC_VTABLE_INHERIT:
00346 return &iq2000_elf_vtinherit_howto;
00347 case BFD_RELOC_VTABLE_ENTRY:
00348 return &iq2000_elf_vtentry_howto;
00349 default:
00350
00351 return NULL;
00352 }
00353 return NULL;
00354 }
00355
00356
00357
00358
00359
00360 static bfd_reloc_status_type
00361 iq2000_final_link_relocate (reloc_howto_type * howto,
00362 bfd * input_bfd,
00363 asection * input_section,
00364 bfd_byte * contents,
00365 Elf_Internal_Rela * rel,
00366 bfd_vma relocation)
00367 {
00368 return _bfd_final_link_relocate (howto, input_bfd, input_section,
00369 contents, rel->r_offset,
00370 relocation, rel->r_addend);
00371 }
00372
00373
00374
00375 static void
00376 iq2000_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
00377 arelent * cache_ptr,
00378 Elf_Internal_Rela * dst)
00379 {
00380 unsigned int r_type;
00381
00382 r_type = ELF32_R_TYPE (dst->r_info);
00383 switch (r_type)
00384 {
00385 case R_IQ2000_GNU_VTINHERIT:
00386 cache_ptr->howto = & iq2000_elf_vtinherit_howto;
00387 break;
00388
00389 case R_IQ2000_GNU_VTENTRY:
00390 cache_ptr->howto = & iq2000_elf_vtentry_howto;
00391 break;
00392
00393 default:
00394 cache_ptr->howto = & iq2000_elf_howto_table [r_type];
00395 break;
00396 }
00397 }
00398
00399
00400
00401
00402
00403 static bfd_boolean
00404 iq2000_elf_check_relocs (bfd *abfd,
00405 struct bfd_link_info *info,
00406 asection *sec,
00407 const Elf_Internal_Rela *relocs)
00408 {
00409 Elf_Internal_Shdr *symtab_hdr;
00410 struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
00411 const Elf_Internal_Rela *rel;
00412 const Elf_Internal_Rela *rel_end;
00413 bfd_boolean changed = FALSE;
00414
00415 if (info->relocatable)
00416 return TRUE;
00417
00418 symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
00419 sym_hashes = elf_sym_hashes (abfd);
00420 sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
00421 if (!elf_bad_symtab (abfd))
00422 sym_hashes_end -= symtab_hdr->sh_info;
00423
00424 rel_end = relocs + sec->reloc_count;
00425 for (rel = relocs; rel < rel_end; rel++)
00426 {
00427 struct elf_link_hash_entry *h;
00428 unsigned long r_symndx;
00429
00430 r_symndx = ELF32_R_SYM (rel->r_info);
00431 if (r_symndx < symtab_hdr->sh_info)
00432 h = NULL;
00433 else
00434 h = sym_hashes[r_symndx - symtab_hdr->sh_info];
00435
00436 switch (ELF32_R_TYPE (rel->r_info))
00437 {
00438
00439
00440 case R_IQ2000_GNU_VTINHERIT:
00441 if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
00442 return FALSE;
00443 break;
00444
00445
00446
00447 case R_IQ2000_GNU_VTENTRY:
00448 if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
00449 return FALSE;
00450 break;
00451
00452 case R_IQ2000_32:
00453
00454 if (memcmp (sec->name, ".debug", 6) == 0
00455 || memcmp (sec->name, ".stab", 5) == 0
00456 || memcmp (sec->name, ".eh_frame", 9) == 0)
00457 {
00458 ((Elf_Internal_Rela *) rel)->r_info
00459 = ELF32_R_INFO (ELF32_R_SYM (rel->r_info), R_IQ2000_32_DEBUG);
00460 changed = TRUE;
00461 }
00462 break;
00463 }
00464 }
00465
00466 if (changed)
00467
00468
00469 elf_section_data (sec)->relocs = (Elf_Internal_Rela *) relocs;
00470
00471 return TRUE;
00472 }
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508 static bfd_boolean
00509 iq2000_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
00510 struct bfd_link_info * info,
00511 bfd * input_bfd,
00512 asection * input_section,
00513 bfd_byte * contents,
00514 Elf_Internal_Rela * relocs,
00515 Elf_Internal_Sym * local_syms,
00516 asection ** local_sections)
00517 {
00518 Elf_Internal_Shdr * symtab_hdr;
00519 struct elf_link_hash_entry ** sym_hashes;
00520 Elf_Internal_Rela * rel;
00521 Elf_Internal_Rela * relend;
00522
00523 if (info->relocatable)
00524 return TRUE;
00525
00526 symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
00527 sym_hashes = elf_sym_hashes (input_bfd);
00528 relend = relocs + input_section->reloc_count;
00529
00530 for (rel = relocs; rel < relend; rel ++)
00531 {
00532 reloc_howto_type * howto;
00533 unsigned long r_symndx;
00534 Elf_Internal_Sym * sym;
00535 asection * sec;
00536 struct elf_link_hash_entry * h;
00537 bfd_vma relocation;
00538 bfd_reloc_status_type r;
00539 const char * name = NULL;
00540 int r_type;
00541
00542 r_type = ELF32_R_TYPE (rel->r_info);
00543
00544 if ( r_type == R_IQ2000_GNU_VTINHERIT
00545 || r_type == R_IQ2000_GNU_VTENTRY)
00546 continue;
00547
00548 r_symndx = ELF32_R_SYM (rel->r_info);
00549
00550
00551 howto = iq2000_elf_howto_table + ELF32_R_TYPE (rel->r_info);
00552 h = NULL;
00553 sym = NULL;
00554 sec = NULL;
00555
00556 if (r_symndx < symtab_hdr->sh_info)
00557 {
00558 sym = local_syms + r_symndx;
00559 sec = local_sections [r_symndx];
00560 relocation = (sec->output_section->vma
00561 + sec->output_offset
00562 + sym->st_value);
00563
00564 name = bfd_elf_string_from_elf_section
00565 (input_bfd, symtab_hdr->sh_link, sym->st_name);
00566 name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
00567 }
00568 else
00569 {
00570 bfd_boolean unresolved_reloc;
00571 bfd_boolean warned;
00572
00573 RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
00574 r_symndx, symtab_hdr, sym_hashes,
00575 h, sec, relocation,
00576 unresolved_reloc, warned);
00577
00578 name = h->root.root.string;
00579 }
00580
00581 switch (r_type)
00582 {
00583 case R_IQ2000_HI16:
00584 r = iq2000_elf_relocate_hi16 (input_bfd, rel, contents, relocation);
00585 break;
00586
00587 case R_IQ2000_PC16:
00588 rel->r_addend -= 4;
00589
00590
00591 default:
00592 r = iq2000_final_link_relocate (howto, input_bfd, input_section,
00593 contents, rel, relocation);
00594 break;
00595 }
00596
00597 if (r != bfd_reloc_ok)
00598 {
00599 const char * msg = (const char *) NULL;
00600
00601 switch (r)
00602 {
00603 case bfd_reloc_overflow:
00604 r = info->callbacks->reloc_overflow
00605 (info, (h ? &h->root : NULL), name, howto->name,
00606 (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
00607 break;
00608
00609 case bfd_reloc_undefined:
00610 r = info->callbacks->undefined_symbol
00611 (info, name, input_bfd, input_section, rel->r_offset, TRUE);
00612 break;
00613
00614 case bfd_reloc_outofrange:
00615 msg = _("internal error: out of range error");
00616 break;
00617
00618 case bfd_reloc_notsupported:
00619 msg = _("internal error: unsupported relocation error");
00620 break;
00621
00622 case bfd_reloc_dangerous:
00623 msg = _("internal error: dangerous relocation");
00624 break;
00625
00626 default:
00627 msg = _("internal error: unknown error");
00628 break;
00629 }
00630
00631 if (msg)
00632 r = info->callbacks->warning
00633 (info, msg, name, input_bfd, input_section, rel->r_offset);
00634
00635 if (! r)
00636 return FALSE;
00637 }
00638 }
00639
00640 return TRUE;
00641 }
00642
00643
00644
00645
00646
00647 static bfd_boolean
00648 iq2000_elf_gc_sweep_hook (bfd * abfd ATTRIBUTE_UNUSED,
00649 struct bfd_link_info * info ATTRIBUTE_UNUSED,
00650 asection * sec ATTRIBUTE_UNUSED,
00651 const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED)
00652 {
00653 return TRUE;
00654 }
00655
00656
00657
00658
00659 static asection *
00660 iq2000_elf_gc_mark_hook (asection * sec,
00661 struct bfd_link_info * info ATTRIBUTE_UNUSED,
00662 Elf_Internal_Rela * rel,
00663 struct elf_link_hash_entry * h,
00664 Elf_Internal_Sym * sym)
00665 {
00666 if (h == NULL)
00667 return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
00668
00669 switch (ELF32_R_TYPE (rel->r_info))
00670 {
00671 case R_IQ2000_GNU_VTINHERIT:
00672 case R_IQ2000_GNU_VTENTRY:
00673 break;
00674
00675 default:
00676 switch (h->root.type)
00677 {
00678 case bfd_link_hash_defined:
00679 case bfd_link_hash_defweak:
00680 return h->root.u.def.section;
00681
00682 case bfd_link_hash_common:
00683 return h->root.u.c.p->section;
00684
00685 default:
00686 break;
00687 }
00688 }
00689
00690 return NULL;
00691 }
00692
00693
00694
00695
00696 static int
00697 elf32_iq2000_machine (bfd *abfd)
00698 {
00699 switch (elf_elfheader (abfd)->e_flags & EF_IQ2000_CPU_MASK)
00700 {
00701 case EF_IQ2000_CPU_IQ10:
00702 return bfd_mach_iq10;
00703
00704 case EF_IQ2000_CPU_IQ2000:
00705 default:
00706 return bfd_mach_iq2000;
00707 }
00708 }
00709
00710
00711
00712
00713 static bfd_boolean
00714 iq2000_elf_set_private_flags (bfd *abfd, flagword flags)
00715 {
00716 elf_elfheader (abfd)->e_flags = flags;
00717 elf_flags_init (abfd) = TRUE;
00718 return TRUE;
00719 }
00720
00721
00722
00723 static bfd_boolean
00724 iq2000_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
00725 {
00726 if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
00727 || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
00728 return TRUE;
00729
00730 BFD_ASSERT (!elf_flags_init (obfd)
00731 || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
00732
00733 elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
00734 elf_flags_init (obfd) = TRUE;
00735 return TRUE;
00736 }
00737
00738
00739
00740
00741 static bfd_boolean
00742 iq2000_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
00743 {
00744 flagword old_flags, old_partial;
00745 flagword new_flags, new_partial;
00746 bfd_boolean error = FALSE;
00747 char new_opt[80];
00748 char old_opt[80];
00749
00750 new_opt[0] = old_opt[0] = '\0';
00751 new_flags = elf_elfheader (ibfd)->e_flags;
00752 old_flags = elf_elfheader (obfd)->e_flags;
00753
00754 if (!elf_flags_init (obfd))
00755 {
00756
00757 elf_flags_init (obfd) = TRUE;
00758 elf_elfheader (obfd)->e_flags = new_flags;
00759 }
00760
00761 else if (new_flags != old_flags)
00762 {
00763
00764
00765 new_partial = (new_flags & EF_IQ2000_CPU_MASK);
00766 old_partial = (old_flags & EF_IQ2000_CPU_MASK);
00767
00768 if (new_partial != old_partial)
00769 {
00770 switch (new_partial)
00771 {
00772 case EF_IQ2000_CPU_IQ10:
00773 strcat (new_opt, " -m10");
00774 break;
00775
00776 default:
00777 case EF_IQ2000_CPU_IQ2000:
00778 strcat (new_opt, " -m2000");
00779 break;
00780 }
00781
00782 switch (old_partial)
00783 {
00784 case EF_IQ2000_CPU_IQ10:
00785 strcat (old_opt, " -m10");
00786 break;
00787
00788 default:
00789 case EF_IQ2000_CPU_IQ2000:
00790 strcat (old_opt, " -m2000");
00791 break;
00792 }
00793 }
00794
00795
00796 if (new_opt[0])
00797 {
00798 error = TRUE;
00799 _bfd_error_handler
00800 (_("%s: compiled with %s and linked with modules compiled with %s"),
00801 bfd_get_filename (ibfd), new_opt, old_opt);
00802 }
00803
00804 new_flags &= ~ EF_IQ2000_ALL_FLAGS;
00805 old_flags &= ~ EF_IQ2000_ALL_FLAGS;
00806
00807
00808 if (new_flags != old_flags)
00809 {
00810 error = TRUE;
00811
00812 _bfd_error_handler
00813 (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
00814 bfd_get_filename (ibfd), (long)new_flags, (long)old_flags);
00815 }
00816 }
00817
00818 if (error)
00819 bfd_set_error (bfd_error_bad_value);
00820
00821 return !error;
00822 }
00823
00824
00825 static bfd_boolean
00826 iq2000_elf_print_private_bfd_data (bfd *abfd, void * ptr)
00827 {
00828 FILE *file = (FILE *) ptr;
00829 flagword flags;
00830
00831 BFD_ASSERT (abfd != NULL && ptr != NULL);
00832
00833
00834 _bfd_elf_print_private_bfd_data (abfd, ptr);
00835
00836 flags = elf_elfheader (abfd)->e_flags;
00837 fprintf (file, _("private flags = 0x%lx:"), (long)flags);
00838
00839 switch (flags & EF_IQ2000_CPU_MASK)
00840 {
00841 case EF_IQ2000_CPU_IQ10:
00842 fprintf (file, " -m10");
00843 break;
00844 case EF_IQ2000_CPU_IQ2000:
00845 fprintf (file, " -m2000");
00846 break;
00847 default:
00848 break;
00849 }
00850
00851 fputc ('\n', file);
00852 return TRUE;
00853 }
00854
00855 static
00856 bfd_boolean
00857 iq2000_elf_object_p (bfd *abfd)
00858 {
00859 bfd_default_set_arch_mach (abfd, bfd_arch_iq2000,
00860 elf32_iq2000_machine (abfd));
00861 return TRUE;
00862 }
00863
00864
00865 #define ELF_ARCH bfd_arch_iq2000
00866 #define ELF_MACHINE_CODE EM_IQ2000
00867 #define ELF_MAXPAGESIZE 0x1000
00868
00869 #define TARGET_BIG_SYM bfd_elf32_iq2000_vec
00870 #define TARGET_BIG_NAME "elf32-iq2000"
00871
00872 #define elf_info_to_howto_rel NULL
00873 #define elf_info_to_howto iq2000_info_to_howto_rela
00874 #define elf_backend_relocate_section iq2000_elf_relocate_section
00875 #define elf_backend_gc_mark_hook iq2000_elf_gc_mark_hook
00876 #define elf_backend_gc_sweep_hook iq2000_elf_gc_sweep_hook
00877 #define elf_backend_check_relocs iq2000_elf_check_relocs
00878 #define elf_backend_object_p iq2000_elf_object_p
00879 #define elf_backend_rela_normal 1
00880
00881 #define elf_backend_can_gc_sections 1
00882
00883 #define bfd_elf32_bfd_reloc_type_lookup iq2000_reloc_type_lookup
00884 #define bfd_elf32_bfd_set_private_flags iq2000_elf_set_private_flags
00885 #define bfd_elf32_bfd_copy_private_bfd_data iq2000_elf_copy_private_bfd_data
00886 #define bfd_elf32_bfd_merge_private_bfd_data iq2000_elf_merge_private_bfd_data
00887 #define bfd_elf32_bfd_print_private_bfd_data iq2000_elf_print_private_bfd_data
00888
00889 #include "elf32-target.h"