00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "bfd.h"
00029 #include "sysdep.h"
00030 #include "bfdlink.h"
00031 #include "libbfd.h"
00032 #include "coff/internal.h"
00033 #include "coff/sym.h"
00034 #include "coff/symconst.h"
00035 #include "coff/ecoff.h"
00036 #include "coff/mips.h"
00037 #include "libcoff.h"
00038 #include "libecoff.h"
00039
00040
00041
00042 static bfd_boolean mips_ecoff_bad_format_hook
00043 PARAMS ((bfd *abfd, PTR filehdr));
00044 static void mips_ecoff_swap_reloc_in
00045 PARAMS ((bfd *, PTR, struct internal_reloc *));
00046 static void mips_ecoff_swap_reloc_out
00047 PARAMS ((bfd *, const struct internal_reloc *, PTR));
00048 static void mips_adjust_reloc_in
00049 PARAMS ((bfd *, const struct internal_reloc *, arelent *));
00050 static void mips_adjust_reloc_out
00051 PARAMS ((bfd *, const arelent *, struct internal_reloc *));
00052 static bfd_reloc_status_type mips_generic_reloc
00053 PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
00054 asection *section, bfd *output_bfd, char **error));
00055 static bfd_reloc_status_type mips_refhi_reloc
00056 PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
00057 asection *section, bfd *output_bfd, char **error));
00058 static bfd_reloc_status_type mips_reflo_reloc
00059 PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
00060 asection *section, bfd *output_bfd, char **error));
00061 static bfd_reloc_status_type mips_gprel_reloc
00062 PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
00063 asection *section, bfd *output_bfd, char **error));
00064 static void mips_relocate_hi
00065 PARAMS ((struct internal_reloc *refhi, struct internal_reloc *reflo,
00066 bfd *input_bfd, asection *input_section, bfd_byte *contents,
00067 bfd_vma relocation));
00068 static bfd_boolean mips_relocate_section
00069 PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PTR));
00070 static reloc_howto_type *mips_bfd_reloc_type_lookup
00071 PARAMS ((bfd *, bfd_reloc_code_real_type));
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 #define MIPSECOFF
00082 #define NO_COFF_RELOCS
00083 #define NO_COFF_SYMBOLS
00084 #define NO_COFF_LINENOS
00085 #define coff_swap_filehdr_in mips_ecoff_swap_filehdr_in
00086 #define coff_swap_filehdr_out mips_ecoff_swap_filehdr_out
00087 #define coff_swap_aouthdr_in mips_ecoff_swap_aouthdr_in
00088 #define coff_swap_aouthdr_out mips_ecoff_swap_aouthdr_out
00089 #define coff_swap_scnhdr_in mips_ecoff_swap_scnhdr_in
00090 #define coff_swap_scnhdr_out mips_ecoff_swap_scnhdr_out
00091 #include "coffswap.h"
00092
00093
00094 #define ECOFF_32
00095 #include "ecoffswap.h"
00096
00097
00098
00099 static reloc_howto_type mips_howto_table[] =
00100 {
00101
00102
00103
00104 HOWTO (MIPS_R_IGNORE,
00105 0,
00106 0,
00107 8,
00108 FALSE,
00109 0,
00110 complain_overflow_dont,
00111 0,
00112 "IGNORE",
00113 FALSE,
00114 0,
00115 0,
00116 FALSE),
00117
00118
00119 HOWTO (MIPS_R_REFHALF,
00120 0,
00121 1,
00122 16,
00123 FALSE,
00124 0,
00125 complain_overflow_bitfield,
00126 mips_generic_reloc,
00127 "REFHALF",
00128 TRUE,
00129 0xffff,
00130 0xffff,
00131 FALSE),
00132
00133
00134 HOWTO (MIPS_R_REFWORD,
00135 0,
00136 2,
00137 32,
00138 FALSE,
00139 0,
00140 complain_overflow_bitfield,
00141 mips_generic_reloc,
00142 "REFWORD",
00143 TRUE,
00144 0xffffffff,
00145 0xffffffff,
00146 FALSE),
00147
00148
00149 HOWTO (MIPS_R_JMPADDR,
00150 2,
00151 2,
00152 26,
00153 FALSE,
00154 0,
00155 complain_overflow_dont,
00156
00157
00158
00159 mips_generic_reloc,
00160 "JMPADDR",
00161 TRUE,
00162 0x3ffffff,
00163 0x3ffffff,
00164 FALSE),
00165
00166
00167
00168 HOWTO (MIPS_R_REFHI,
00169 16,
00170 2,
00171 16,
00172 FALSE,
00173 0,
00174 complain_overflow_bitfield,
00175 mips_refhi_reloc,
00176 "REFHI",
00177 TRUE,
00178 0xffff,
00179 0xffff,
00180 FALSE),
00181
00182
00183 HOWTO (MIPS_R_REFLO,
00184 0,
00185 2,
00186 16,
00187 FALSE,
00188 0,
00189 complain_overflow_dont,
00190 mips_reflo_reloc,
00191 "REFLO",
00192 TRUE,
00193 0xffff,
00194 0xffff,
00195 FALSE),
00196
00197
00198
00199 HOWTO (MIPS_R_GPREL,
00200 0,
00201 2,
00202 16,
00203 FALSE,
00204 0,
00205 complain_overflow_signed,
00206 mips_gprel_reloc,
00207 "GPREL",
00208 TRUE,
00209 0xffff,
00210 0xffff,
00211 FALSE),
00212
00213
00214
00215 HOWTO (MIPS_R_LITERAL,
00216 0,
00217 2,
00218 16,
00219 FALSE,
00220 0,
00221 complain_overflow_signed,
00222 mips_gprel_reloc,
00223 "LITERAL",
00224 TRUE,
00225 0xffff,
00226 0xffff,
00227 FALSE),
00228
00229 EMPTY_HOWTO (8),
00230 EMPTY_HOWTO (9),
00231 EMPTY_HOWTO (10),
00232 EMPTY_HOWTO (11),
00233
00234
00235
00236
00237 HOWTO (MIPS_R_PCREL16,
00238 2,
00239 2,
00240 16,
00241 TRUE,
00242 0,
00243 complain_overflow_signed,
00244 mips_generic_reloc,
00245 "PCREL16",
00246 TRUE,
00247 0xffff,
00248 0xffff,
00249 TRUE),
00250 };
00251
00252 #define MIPS_HOWTO_COUNT \
00253 (sizeof mips_howto_table / sizeof mips_howto_table[0])
00254
00255
00256
00257 static bfd_boolean
00258 mips_ecoff_bad_format_hook (abfd, filehdr)
00259 bfd *abfd;
00260 PTR filehdr;
00261 {
00262 struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
00263
00264 switch (internal_f->f_magic)
00265 {
00266 case MIPS_MAGIC_1:
00267
00268 return TRUE;
00269
00270 case MIPS_MAGIC_BIG:
00271 case MIPS_MAGIC_BIG2:
00272 case MIPS_MAGIC_BIG3:
00273 return bfd_big_endian (abfd);
00274
00275 case MIPS_MAGIC_LITTLE:
00276 case MIPS_MAGIC_LITTLE2:
00277 case MIPS_MAGIC_LITTLE3:
00278 return bfd_little_endian (abfd);
00279
00280 default:
00281 return FALSE;
00282 }
00283 }
00284
00285
00286
00287
00288
00289
00290
00291 static void
00292 mips_ecoff_swap_reloc_in (abfd, ext_ptr, intern)
00293 bfd *abfd;
00294 PTR ext_ptr;
00295 struct internal_reloc *intern;
00296 {
00297 const RELOC *ext = (RELOC *) ext_ptr;
00298
00299 intern->r_vaddr = H_GET_32 (abfd, ext->r_vaddr);
00300 if (bfd_header_big_endian (abfd))
00301 {
00302 intern->r_symndx = (((int) ext->r_bits[0]
00303 << RELOC_BITS0_SYMNDX_SH_LEFT_BIG)
00304 | ((int) ext->r_bits[1]
00305 << RELOC_BITS1_SYMNDX_SH_LEFT_BIG)
00306 | ((int) ext->r_bits[2]
00307 << RELOC_BITS2_SYMNDX_SH_LEFT_BIG));
00308 intern->r_type = ((ext->r_bits[3] & RELOC_BITS3_TYPE_BIG)
00309 >> RELOC_BITS3_TYPE_SH_BIG);
00310 intern->r_extern = (ext->r_bits[3] & RELOC_BITS3_EXTERN_BIG) != 0;
00311 }
00312 else
00313 {
00314 intern->r_symndx = (((int) ext->r_bits[0]
00315 << RELOC_BITS0_SYMNDX_SH_LEFT_LITTLE)
00316 | ((int) ext->r_bits[1]
00317 << RELOC_BITS1_SYMNDX_SH_LEFT_LITTLE)
00318 | ((int) ext->r_bits[2]
00319 << RELOC_BITS2_SYMNDX_SH_LEFT_LITTLE));
00320 intern->r_type = (((ext->r_bits[3] & RELOC_BITS3_TYPE_LITTLE)
00321 >> RELOC_BITS3_TYPE_SH_LITTLE)
00322 | ((ext->r_bits[3] & RELOC_BITS3_TYPEHI_LITTLE)
00323 << RELOC_BITS3_TYPEHI_SH_LITTLE));
00324 intern->r_extern = (ext->r_bits[3] & RELOC_BITS3_EXTERN_LITTLE) != 0;
00325 }
00326 }
00327
00328
00329
00330 static void
00331 mips_ecoff_swap_reloc_out (abfd, intern, dst)
00332 bfd *abfd;
00333 const struct internal_reloc *intern;
00334 PTR dst;
00335 {
00336 RELOC *ext = (RELOC *) dst;
00337 long r_symndx;
00338
00339 BFD_ASSERT (intern->r_extern
00340 || (intern->r_symndx >= 0 && intern->r_symndx <= 12));
00341
00342 r_symndx = intern->r_symndx;
00343
00344 H_PUT_32 (abfd, intern->r_vaddr, ext->r_vaddr);
00345 if (bfd_header_big_endian (abfd))
00346 {
00347 ext->r_bits[0] = r_symndx >> RELOC_BITS0_SYMNDX_SH_LEFT_BIG;
00348 ext->r_bits[1] = r_symndx >> RELOC_BITS1_SYMNDX_SH_LEFT_BIG;
00349 ext->r_bits[2] = r_symndx >> RELOC_BITS2_SYMNDX_SH_LEFT_BIG;
00350 ext->r_bits[3] = (((intern->r_type << RELOC_BITS3_TYPE_SH_BIG)
00351 & RELOC_BITS3_TYPE_BIG)
00352 | (intern->r_extern ? RELOC_BITS3_EXTERN_BIG : 0));
00353 }
00354 else
00355 {
00356 ext->r_bits[0] = r_symndx >> RELOC_BITS0_SYMNDX_SH_LEFT_LITTLE;
00357 ext->r_bits[1] = r_symndx >> RELOC_BITS1_SYMNDX_SH_LEFT_LITTLE;
00358 ext->r_bits[2] = r_symndx >> RELOC_BITS2_SYMNDX_SH_LEFT_LITTLE;
00359 ext->r_bits[3] = (((intern->r_type << RELOC_BITS3_TYPE_SH_LITTLE)
00360 & RELOC_BITS3_TYPE_LITTLE)
00361 | ((intern->r_type >> RELOC_BITS3_TYPEHI_SH_LITTLE
00362 & RELOC_BITS3_TYPEHI_LITTLE))
00363 | (intern->r_extern ? RELOC_BITS3_EXTERN_LITTLE : 0));
00364 }
00365 }
00366
00367
00368
00369
00370
00371 static void
00372 mips_adjust_reloc_in (abfd, intern, rptr)
00373 bfd *abfd;
00374 const struct internal_reloc *intern;
00375 arelent *rptr;
00376 {
00377 if (intern->r_type > MIPS_R_PCREL16)
00378 abort ();
00379
00380 if (! intern->r_extern
00381 && (intern->r_type == MIPS_R_GPREL
00382 || intern->r_type == MIPS_R_LITERAL))
00383 rptr->addend += ecoff_data (abfd)->gp;
00384
00385
00386
00387 if (intern->r_type == MIPS_R_IGNORE)
00388 rptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
00389
00390 rptr->howto = &mips_howto_table[intern->r_type];
00391 }
00392
00393
00394
00395
00396 static void
00397 mips_adjust_reloc_out (abfd, rel, intern)
00398 bfd *abfd ATTRIBUTE_UNUSED;
00399 const arelent *rel ATTRIBUTE_UNUSED;
00400 struct internal_reloc *intern ATTRIBUTE_UNUSED;
00401 {
00402 }
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415 static bfd_reloc_status_type
00416 mips_generic_reloc (abfd,
00417 reloc_entry,
00418 symbol,
00419 data,
00420 input_section,
00421 output_bfd,
00422 error_message)
00423 bfd *abfd ATTRIBUTE_UNUSED;
00424 arelent *reloc_entry;
00425 asymbol *symbol;
00426 PTR data ATTRIBUTE_UNUSED;
00427 asection *input_section;
00428 bfd *output_bfd;
00429 char **error_message ATTRIBUTE_UNUSED;
00430 {
00431 if (output_bfd != (bfd *) NULL
00432 && (symbol->flags & BSF_SECTION_SYM) == 0
00433 && reloc_entry->addend == 0)
00434 {
00435 reloc_entry->address += input_section->output_offset;
00436 return bfd_reloc_ok;
00437 }
00438
00439 return bfd_reloc_continue;
00440 }
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451 struct mips_hi
00452 {
00453 struct mips_hi *next;
00454 bfd_byte *addr;
00455 bfd_vma addend;
00456 };
00457
00458
00459
00460 static struct mips_hi *mips_refhi_list;
00461
00462 static bfd_reloc_status_type
00463 mips_refhi_reloc (abfd,
00464 reloc_entry,
00465 symbol,
00466 data,
00467 input_section,
00468 output_bfd,
00469 error_message)
00470 bfd *abfd ATTRIBUTE_UNUSED;
00471 arelent *reloc_entry;
00472 asymbol *symbol;
00473 PTR data;
00474 asection *input_section;
00475 bfd *output_bfd;
00476 char **error_message ATTRIBUTE_UNUSED;
00477 {
00478 bfd_reloc_status_type ret;
00479 bfd_vma relocation;
00480 struct mips_hi *n;
00481
00482
00483
00484 if (output_bfd != (bfd *) NULL
00485 && (symbol->flags & BSF_SECTION_SYM) == 0
00486 && reloc_entry->addend == 0)
00487 {
00488 reloc_entry->address += input_section->output_offset;
00489 return bfd_reloc_ok;
00490 }
00491
00492 ret = bfd_reloc_ok;
00493 if (bfd_is_und_section (symbol->section)
00494 && output_bfd == (bfd *) NULL)
00495 ret = bfd_reloc_undefined;
00496
00497 if (bfd_is_com_section (symbol->section))
00498 relocation = 0;
00499 else
00500 relocation = symbol->value;
00501
00502 relocation += symbol->section->output_section->vma;
00503 relocation += symbol->section->output_offset;
00504 relocation += reloc_entry->addend;
00505
00506 if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
00507 return bfd_reloc_outofrange;
00508
00509
00510 n = (struct mips_hi *) bfd_malloc ((bfd_size_type) sizeof *n);
00511 if (n == NULL)
00512 return bfd_reloc_outofrange;
00513 n->addr = (bfd_byte *) data + reloc_entry->address;
00514 n->addend = relocation;
00515 n->next = mips_refhi_list;
00516 mips_refhi_list = n;
00517
00518 if (output_bfd != (bfd *) NULL)
00519 reloc_entry->address += input_section->output_offset;
00520
00521 return ret;
00522 }
00523
00524
00525
00526
00527
00528 static bfd_reloc_status_type
00529 mips_reflo_reloc (abfd,
00530 reloc_entry,
00531 symbol,
00532 data,
00533 input_section,
00534 output_bfd,
00535 error_message)
00536 bfd *abfd;
00537 arelent *reloc_entry;
00538 asymbol *symbol;
00539 PTR data;
00540 asection *input_section;
00541 bfd *output_bfd;
00542 char **error_message;
00543 {
00544 if (mips_refhi_list != NULL)
00545 {
00546 struct mips_hi *l;
00547
00548 l = mips_refhi_list;
00549 while (l != NULL)
00550 {
00551 unsigned long insn;
00552 unsigned long val;
00553 unsigned long vallo;
00554 struct mips_hi *next;
00555
00556
00557
00558
00559
00560 insn = bfd_get_32 (abfd, l->addr);
00561 vallo = (bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address)
00562 & 0xffff);
00563 val = ((insn & 0xffff) << 16) + vallo;
00564 val += l->addend;
00565
00566
00567
00568
00569
00570
00571
00572 if ((vallo & 0x8000) != 0)
00573 val -= 0x10000;
00574 if ((val & 0x8000) != 0)
00575 val += 0x10000;
00576
00577 insn = (insn &~ (unsigned) 0xffff) | ((val >> 16) & 0xffff);
00578 bfd_put_32 (abfd, (bfd_vma) insn, l->addr);
00579
00580 next = l->next;
00581 free (l);
00582 l = next;
00583 }
00584
00585 mips_refhi_list = NULL;
00586 }
00587
00588
00589 return mips_generic_reloc (abfd, reloc_entry, symbol, data,
00590 input_section, output_bfd, error_message);
00591 }
00592
00593
00594
00595
00596 static bfd_reloc_status_type
00597 mips_gprel_reloc (abfd,
00598 reloc_entry,
00599 symbol,
00600 data,
00601 input_section,
00602 output_bfd,
00603 error_message)
00604 bfd *abfd;
00605 arelent *reloc_entry;
00606 asymbol *symbol;
00607 PTR data;
00608 asection *input_section;
00609 bfd *output_bfd;
00610 char **error_message;
00611 {
00612 bfd_boolean relocatable;
00613 bfd_vma gp;
00614 bfd_vma relocation;
00615 unsigned long val;
00616 unsigned long insn;
00617
00618
00619
00620
00621
00622 if (output_bfd != (bfd *) NULL
00623 && (symbol->flags & BSF_SECTION_SYM) == 0
00624 && reloc_entry->addend == 0)
00625 {
00626 reloc_entry->address += input_section->output_offset;
00627 return bfd_reloc_ok;
00628 }
00629
00630 if (output_bfd != (bfd *) NULL)
00631 relocatable = TRUE;
00632 else
00633 {
00634 relocatable = FALSE;
00635 output_bfd = symbol->section->output_section->owner;
00636 }
00637
00638 if (bfd_is_und_section (symbol->section) && ! relocatable)
00639 return bfd_reloc_undefined;
00640
00641
00642
00643
00644
00645
00646 gp = _bfd_get_gp_value (output_bfd);
00647 if (gp == 0
00648 && (! relocatable
00649 || (symbol->flags & BSF_SECTION_SYM) != 0))
00650 {
00651 if (relocatable)
00652 {
00653
00654 gp = symbol->section->output_section->vma + 0x4000;
00655 _bfd_set_gp_value (output_bfd, gp);
00656 }
00657 else
00658 {
00659 unsigned int count;
00660 asymbol **sym;
00661 unsigned int i;
00662
00663 count = bfd_get_symcount (output_bfd);
00664 sym = bfd_get_outsymbols (output_bfd);
00665
00666 if (sym == (asymbol **) NULL)
00667 i = count;
00668 else
00669 {
00670 for (i = 0; i < count; i++, sym++)
00671 {
00672 register const char *name;
00673
00674 name = bfd_asymbol_name (*sym);
00675 if (*name == '_' && strcmp (name, "_gp") == 0)
00676 {
00677 gp = bfd_asymbol_value (*sym);
00678 _bfd_set_gp_value (output_bfd, gp);
00679 break;
00680 }
00681 }
00682 }
00683
00684 if (i >= count)
00685 {
00686
00687 gp = 4;
00688 _bfd_set_gp_value (output_bfd, gp);
00689 *error_message =
00690 (char *) _("GP relative relocation when _gp not defined");
00691 return bfd_reloc_dangerous;
00692 }
00693 }
00694 }
00695
00696 if (bfd_is_com_section (symbol->section))
00697 relocation = 0;
00698 else
00699 relocation = symbol->value;
00700
00701 relocation += symbol->section->output_section->vma;
00702 relocation += symbol->section->output_offset;
00703
00704 if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
00705 return bfd_reloc_outofrange;
00706
00707 insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address);
00708
00709
00710 val = ((insn & 0xffff) + reloc_entry->addend) & 0xffff;
00711 if (val & 0x8000)
00712 val -= 0x10000;
00713
00714
00715
00716
00717 if (! relocatable
00718 || (symbol->flags & BSF_SECTION_SYM) != 0)
00719 val += relocation - gp;
00720
00721 insn = (insn &~ (unsigned) 0xffff) | (val & 0xffff);
00722 bfd_put_32 (abfd, (bfd_vma) insn, (bfd_byte *) data + reloc_entry->address);
00723
00724 if (relocatable)
00725 reloc_entry->address += input_section->output_offset;
00726
00727
00728 if ((long) val >= 0x8000 || (long) val < -0x8000)
00729 return bfd_reloc_overflow;
00730
00731 return bfd_reloc_ok;
00732 }
00733
00734
00735
00736 static reloc_howto_type *
00737 mips_bfd_reloc_type_lookup (abfd, code)
00738 bfd *abfd ATTRIBUTE_UNUSED;
00739 bfd_reloc_code_real_type code;
00740 {
00741 int mips_type;
00742
00743 switch (code)
00744 {
00745 case BFD_RELOC_16:
00746 mips_type = MIPS_R_REFHALF;
00747 break;
00748 case BFD_RELOC_32:
00749 case BFD_RELOC_CTOR:
00750 mips_type = MIPS_R_REFWORD;
00751 break;
00752 case BFD_RELOC_MIPS_JMP:
00753 mips_type = MIPS_R_JMPADDR;
00754 break;
00755 case BFD_RELOC_HI16_S:
00756 mips_type = MIPS_R_REFHI;
00757 break;
00758 case BFD_RELOC_LO16:
00759 mips_type = MIPS_R_REFLO;
00760 break;
00761 case BFD_RELOC_GPREL16:
00762 mips_type = MIPS_R_GPREL;
00763 break;
00764 case BFD_RELOC_MIPS_LITERAL:
00765 mips_type = MIPS_R_LITERAL;
00766 break;
00767 case BFD_RELOC_16_PCREL_S2:
00768 mips_type = MIPS_R_PCREL16;
00769 break;
00770 default:
00771 return (reloc_howto_type *) NULL;
00772 }
00773
00774 return &mips_howto_table[mips_type];
00775 }
00776
00777
00778
00779
00780
00781
00782 static void
00783 mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents,
00784 relocation)
00785 struct internal_reloc *refhi;
00786 struct internal_reloc *reflo;
00787 bfd *input_bfd;
00788 asection *input_section;
00789 bfd_byte *contents;
00790 bfd_vma relocation;
00791 {
00792 unsigned long insn;
00793 unsigned long val;
00794 unsigned long vallo;
00795
00796 if (refhi == NULL)
00797 return;
00798
00799 insn = bfd_get_32 (input_bfd,
00800 contents + refhi->r_vaddr - input_section->vma);
00801 if (reflo == NULL)
00802 vallo = 0;
00803 else
00804 vallo = (bfd_get_32 (input_bfd,
00805 contents + reflo->r_vaddr - input_section->vma)
00806 & 0xffff);
00807
00808 val = ((insn & 0xffff) << 16) + vallo;
00809 val += relocation;
00810
00811
00812
00813
00814
00815
00816 if ((vallo & 0x8000) != 0)
00817 val -= 0x10000;
00818
00819 if ((val & 0x8000) != 0)
00820 val += 0x10000;
00821
00822 insn = (insn &~ (unsigned) 0xffff) | ((val >> 16) & 0xffff);
00823 bfd_put_32 (input_bfd, (bfd_vma) insn,
00824 contents + refhi->r_vaddr - input_section->vma);
00825 }
00826
00827
00828
00829 static bfd_boolean
00830 mips_relocate_section (output_bfd, info, input_bfd, input_section,
00831 contents, external_relocs)
00832 bfd *output_bfd;
00833 struct bfd_link_info *info;
00834 bfd *input_bfd;
00835 asection *input_section;
00836 bfd_byte *contents;
00837 PTR external_relocs;
00838 {
00839 asection **symndx_to_section;
00840 struct ecoff_link_hash_entry **sym_hashes;
00841 bfd_vma gp;
00842 bfd_boolean gp_undefined;
00843 struct external_reloc *ext_rel;
00844 struct external_reloc *ext_rel_end;
00845 unsigned int i;
00846 bfd_boolean got_lo;
00847 struct internal_reloc lo_int_rel;
00848 bfd_size_type amt;
00849
00850 BFD_ASSERT (input_bfd->xvec->byteorder
00851 == output_bfd->xvec->byteorder);
00852
00853
00854
00855
00856 symndx_to_section = ecoff_data (input_bfd)->symndx_to_section;
00857 if (symndx_to_section == (asection **) NULL)
00858 {
00859 amt = NUM_RELOC_SECTIONS * sizeof (asection *);
00860 symndx_to_section = (asection **) bfd_alloc (input_bfd, amt);
00861 if (!symndx_to_section)
00862 return FALSE;
00863
00864 symndx_to_section[RELOC_SECTION_NONE] = NULL;
00865 symndx_to_section[RELOC_SECTION_TEXT] =
00866 bfd_get_section_by_name (input_bfd, ".text");
00867 symndx_to_section[RELOC_SECTION_RDATA] =
00868 bfd_get_section_by_name (input_bfd, ".rdata");
00869 symndx_to_section[RELOC_SECTION_DATA] =
00870 bfd_get_section_by_name (input_bfd, ".data");
00871 symndx_to_section[RELOC_SECTION_SDATA] =
00872 bfd_get_section_by_name (input_bfd, ".sdata");
00873 symndx_to_section[RELOC_SECTION_SBSS] =
00874 bfd_get_section_by_name (input_bfd, ".sbss");
00875 symndx_to_section[RELOC_SECTION_BSS] =
00876 bfd_get_section_by_name (input_bfd, ".bss");
00877 symndx_to_section[RELOC_SECTION_INIT] =
00878 bfd_get_section_by_name (input_bfd, ".init");
00879 symndx_to_section[RELOC_SECTION_LIT8] =
00880 bfd_get_section_by_name (input_bfd, ".lit8");
00881 symndx_to_section[RELOC_SECTION_LIT4] =
00882 bfd_get_section_by_name (input_bfd, ".lit4");
00883 symndx_to_section[RELOC_SECTION_XDATA] = NULL;
00884 symndx_to_section[RELOC_SECTION_PDATA] = NULL;
00885 symndx_to_section[RELOC_SECTION_FINI] =
00886 bfd_get_section_by_name (input_bfd, ".fini");
00887 symndx_to_section[RELOC_SECTION_LITA] = NULL;
00888 symndx_to_section[RELOC_SECTION_ABS] = NULL;
00889
00890 ecoff_data (input_bfd)->symndx_to_section = symndx_to_section;
00891 }
00892
00893 sym_hashes = ecoff_data (input_bfd)->sym_hashes;
00894
00895 gp = _bfd_get_gp_value (output_bfd);
00896 if (gp == 0)
00897 gp_undefined = TRUE;
00898 else
00899 gp_undefined = FALSE;
00900
00901 got_lo = FALSE;
00902
00903 ext_rel = (struct external_reloc *) external_relocs;
00904 ext_rel_end = ext_rel + input_section->reloc_count;
00905 for (i = 0; ext_rel < ext_rel_end; ext_rel++, i++)
00906 {
00907 struct internal_reloc int_rel;
00908 bfd_boolean use_lo = FALSE;
00909 bfd_vma addend;
00910 reloc_howto_type *howto;
00911 struct ecoff_link_hash_entry *h = NULL;
00912 asection *s = NULL;
00913 bfd_vma relocation;
00914 bfd_reloc_status_type r;
00915
00916 if (! got_lo)
00917 mips_ecoff_swap_reloc_in (input_bfd, (PTR) ext_rel, &int_rel);
00918 else
00919 {
00920 int_rel = lo_int_rel;
00921 got_lo = FALSE;
00922 }
00923
00924 BFD_ASSERT (int_rel.r_type
00925 < sizeof mips_howto_table / sizeof mips_howto_table[0]);
00926
00927
00928
00929 if (int_rel.r_type == MIPS_R_REFHI)
00930 {
00931 struct external_reloc *lo_ext_rel;
00932
00933
00934
00935
00936 for (lo_ext_rel = ext_rel + 1;
00937 lo_ext_rel < ext_rel_end;
00938 lo_ext_rel++)
00939 {
00940 mips_ecoff_swap_reloc_in (input_bfd, (PTR) lo_ext_rel,
00941 &lo_int_rel);
00942 if (lo_int_rel.r_type != int_rel.r_type)
00943 break;
00944 }
00945
00946 if (lo_ext_rel < ext_rel_end
00947 && lo_int_rel.r_type == MIPS_R_REFLO
00948 && int_rel.r_extern == lo_int_rel.r_extern
00949 && int_rel.r_symndx == lo_int_rel.r_symndx)
00950 {
00951 use_lo = TRUE;
00952 if (lo_ext_rel == ext_rel + 1)
00953 got_lo = TRUE;
00954 }
00955 }
00956
00957 howto = &mips_howto_table[int_rel.r_type];
00958
00959 if (int_rel.r_extern)
00960 {
00961 h = sym_hashes[int_rel.r_symndx];
00962
00963
00964
00965 if (h == (struct ecoff_link_hash_entry *) NULL)
00966 abort ();
00967 }
00968 else
00969 {
00970 if (int_rel.r_symndx < 0 || int_rel.r_symndx >= NUM_RELOC_SECTIONS)
00971 s = NULL;
00972 else
00973 s = symndx_to_section[int_rel.r_symndx];
00974
00975 if (s == (asection *) NULL)
00976 abort ();
00977 }
00978
00979
00980
00981 if (int_rel.r_type != MIPS_R_GPREL
00982 && int_rel.r_type != MIPS_R_LITERAL)
00983 addend = 0;
00984 else
00985 {
00986 if (gp_undefined)
00987 {
00988 if (! ((*info->callbacks->reloc_dangerous)
00989 (info, _("GP relative relocation used when GP not defined"),
00990 input_bfd, input_section,
00991 int_rel.r_vaddr - input_section->vma)))
00992 return FALSE;
00993
00994 gp = 4;
00995 _bfd_set_gp_value (output_bfd, gp);
00996 gp_undefined = FALSE;
00997 }
00998 if (! int_rel.r_extern)
00999 {
01000
01001
01002
01003
01004
01005
01006 addend = ecoff_data (input_bfd)->gp - gp;
01007 }
01008 else if (! info->relocatable
01009 || h->root.type == bfd_link_hash_defined
01010 || h->root.type == bfd_link_hash_defweak)
01011 {
01012
01013
01014
01015
01016
01017
01018
01019
01020 addend = - gp;
01021 }
01022 else
01023 {
01024
01025
01026
01027
01028
01029
01030 addend = 0;
01031 }
01032 }
01033
01034 if (info->relocatable)
01035 {
01036
01037
01038 if (int_rel.r_extern)
01039 {
01040 if ((h->root.type == bfd_link_hash_defined
01041 || h->root.type == bfd_link_hash_defweak)
01042 && ! bfd_is_abs_section (h->root.u.def.section))
01043 {
01044 const char *name;
01045
01046
01047
01048
01049
01050
01051 int_rel.r_extern = 0;
01052
01053
01054 s = h->root.u.def.section;
01055 name = bfd_get_section_name (output_bfd,
01056 s->output_section);
01057
01058 int_rel.r_symndx = -1;
01059 switch (name[1])
01060 {
01061 case 'b':
01062 if (strcmp (name, ".bss") == 0)
01063 int_rel.r_symndx = RELOC_SECTION_BSS;
01064 break;
01065 case 'd':
01066 if (strcmp (name, ".data") == 0)
01067 int_rel.r_symndx = RELOC_SECTION_DATA;
01068 break;
01069 case 'f':
01070 if (strcmp (name, ".fini") == 0)
01071 int_rel.r_symndx = RELOC_SECTION_FINI;
01072 break;
01073 case 'i':
01074 if (strcmp (name, ".init") == 0)
01075 int_rel.r_symndx = RELOC_SECTION_INIT;
01076 break;
01077 case 'l':
01078 if (strcmp (name, ".lit8") == 0)
01079 int_rel.r_symndx = RELOC_SECTION_LIT8;
01080 else if (strcmp (name, ".lit4") == 0)
01081 int_rel.r_symndx = RELOC_SECTION_LIT4;
01082 break;
01083 case 'r':
01084 if (strcmp (name, ".rdata") == 0)
01085 int_rel.r_symndx = RELOC_SECTION_RDATA;
01086 break;
01087 case 's':
01088 if (strcmp (name, ".sdata") == 0)
01089 int_rel.r_symndx = RELOC_SECTION_SDATA;
01090 else if (strcmp (name, ".sbss") == 0)
01091 int_rel.r_symndx = RELOC_SECTION_SBSS;
01092 break;
01093 case 't':
01094 if (strcmp (name, ".text") == 0)
01095 int_rel.r_symndx = RELOC_SECTION_TEXT;
01096 break;
01097 }
01098
01099 if (int_rel.r_symndx == -1)
01100 abort ();
01101
01102
01103 relocation = (h->root.u.def.value
01104 + s->output_section->vma
01105 + s->output_offset);
01106
01107
01108
01109
01110 if (howto->pc_relative)
01111 relocation -= int_rel.r_vaddr - input_section->vma;
01112
01113 h = NULL;
01114 }
01115 else
01116 {
01117
01118
01119 int_rel.r_symndx = h->indx;
01120 if (int_rel.r_symndx == -1)
01121 {
01122
01123 if (! ((*info->callbacks->unattached_reloc)
01124 (info, h->root.root.string, input_bfd,
01125 input_section,
01126 int_rel.r_vaddr - input_section->vma)))
01127 return FALSE;
01128 int_rel.r_symndx = 0;
01129 }
01130 relocation = 0;
01131 }
01132 }
01133 else
01134 {
01135
01136
01137 relocation = (s->output_section->vma
01138 + s->output_offset
01139 - s->vma);
01140 }
01141
01142 relocation += addend;
01143 addend = 0;
01144
01145
01146
01147
01148 if (howto->pc_relative)
01149 relocation -= (input_section->output_section->vma
01150 + input_section->output_offset
01151 - input_section->vma);
01152
01153
01154 if (relocation == 0)
01155 r = bfd_reloc_ok;
01156 else
01157 {
01158 if (int_rel.r_type != MIPS_R_REFHI)
01159 r = _bfd_relocate_contents (howto, input_bfd, relocation,
01160 (contents
01161 + int_rel.r_vaddr
01162 - input_section->vma));
01163 else
01164 {
01165 mips_relocate_hi (&int_rel,
01166 use_lo ? &lo_int_rel : NULL,
01167 input_bfd, input_section, contents,
01168 relocation);
01169 r = bfd_reloc_ok;
01170 }
01171 }
01172
01173
01174 int_rel.r_vaddr += (input_section->output_section->vma
01175 + input_section->output_offset
01176 - input_section->vma);
01177
01178
01179 mips_ecoff_swap_reloc_out (input_bfd, &int_rel, (PTR) ext_rel);
01180 }
01181 else
01182 {
01183
01184 if (int_rel.r_extern)
01185 {
01186
01187 if (h->root.type == bfd_link_hash_defined
01188 || h->root.type == bfd_link_hash_defweak)
01189 {
01190 asection *hsec;
01191
01192 hsec = h->root.u.def.section;
01193 relocation = (h->root.u.def.value
01194 + hsec->output_section->vma
01195 + hsec->output_offset);
01196 }
01197 else
01198 {
01199 if (! ((*info->callbacks->undefined_symbol)
01200 (info, h->root.root.string, input_bfd,
01201 input_section,
01202 int_rel.r_vaddr - input_section->vma, TRUE)))
01203 return FALSE;
01204 relocation = 0;
01205 }
01206 }
01207 else
01208 {
01209
01210 relocation = (s->output_section->vma
01211 + s->output_offset
01212 - s->vma);
01213
01214
01215
01216
01217 if (howto->pc_relative)
01218 relocation += int_rel.r_vaddr;
01219 }
01220
01221 if (int_rel.r_type != MIPS_R_REFHI)
01222 r = _bfd_final_link_relocate (howto,
01223 input_bfd,
01224 input_section,
01225 contents,
01226 (int_rel.r_vaddr
01227 - input_section->vma),
01228 relocation,
01229 addend);
01230 else
01231 {
01232 mips_relocate_hi (&int_rel,
01233 use_lo ? &lo_int_rel : NULL,
01234 input_bfd, input_section, contents,
01235 relocation);
01236 r = bfd_reloc_ok;
01237 }
01238 }
01239
01240
01241
01242
01243
01244 if (r == bfd_reloc_ok
01245 && int_rel.r_type == MIPS_R_JMPADDR
01246 && (((relocation
01247 + addend
01248 + (int_rel.r_extern ? 0 : s->vma))
01249 & 0xf0000000)
01250 != ((input_section->output_section->vma
01251 + input_section->output_offset
01252 + (int_rel.r_vaddr - input_section->vma))
01253 & 0xf0000000)))
01254 r = bfd_reloc_overflow;
01255
01256 if (r != bfd_reloc_ok)
01257 {
01258 switch (r)
01259 {
01260 default:
01261 case bfd_reloc_outofrange:
01262 abort ();
01263 case bfd_reloc_overflow:
01264 {
01265 const char *name;
01266
01267 if (int_rel.r_extern)
01268 name = NULL;
01269 else
01270 name = bfd_section_name (input_bfd, s);
01271 if (! ((*info->callbacks->reloc_overflow)
01272 (info, (h ? &h->root : NULL), name, howto->name,
01273 (bfd_vma) 0, input_bfd, input_section,
01274 int_rel.r_vaddr - input_section->vma)))
01275 return FALSE;
01276 }
01277 break;
01278 }
01279 }
01280 }
01281
01282 return TRUE;
01283 }
01284
01285
01286
01287
01288 static const struct ecoff_backend_data mips_ecoff_backend_data =
01289 {
01290
01291 {
01292 (void (*) PARAMS ((bfd *,PTR,int,int,int,int,PTR))) bfd_void,
01293 (void (*) PARAMS ((bfd *,PTR,PTR))) bfd_void,
01294 (void (*) PARAMS ((bfd *,PTR,PTR))) bfd_void,
01295 (unsigned (*) PARAMS ((bfd *,PTR,int,int,int,int,PTR)))bfd_void,
01296 (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void,
01297 (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void,
01298 (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void,
01299 mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out,
01300 mips_ecoff_swap_scnhdr_out,
01301 FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, FALSE, 4, FALSE, 2,
01302 mips_ecoff_swap_filehdr_in, mips_ecoff_swap_aouthdr_in,
01303 mips_ecoff_swap_scnhdr_in, NULL,
01304 mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
01305 _bfd_ecoff_mkobject_hook, _bfd_ecoff_styp_to_sec_flags,
01306 _bfd_ecoff_set_alignment_hook, _bfd_ecoff_slurp_symbol_table,
01307 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
01308 NULL, NULL
01309 },
01310
01311 bfd_arch_mips,
01312
01313 "__________",
01314
01315
01316 0x1000,
01317
01318
01319
01320 FALSE,
01321
01322 32,
01323
01324 &mips_howto_table[MIPS_R_REFWORD],
01325 {
01326
01327 magicSym,
01328
01329 4,
01330
01331 sizeof (struct hdr_ext),
01332 sizeof (struct dnr_ext),
01333 sizeof (struct pdr_ext),
01334 sizeof (struct sym_ext),
01335 sizeof (struct opt_ext),
01336 sizeof (struct fdr_ext),
01337 sizeof (struct rfd_ext),
01338 sizeof (struct ext_ext),
01339
01340 ecoff_swap_hdr_in,
01341 ecoff_swap_dnr_in,
01342 ecoff_swap_pdr_in,
01343 ecoff_swap_sym_in,
01344 ecoff_swap_opt_in,
01345 ecoff_swap_fdr_in,
01346 ecoff_swap_rfd_in,
01347 ecoff_swap_ext_in,
01348 _bfd_ecoff_swap_tir_in,
01349 _bfd_ecoff_swap_rndx_in,
01350
01351 ecoff_swap_hdr_out,
01352 ecoff_swap_dnr_out,
01353 ecoff_swap_pdr_out,
01354 ecoff_swap_sym_out,
01355 ecoff_swap_opt_out,
01356 ecoff_swap_fdr_out,
01357 ecoff_swap_rfd_out,
01358 ecoff_swap_ext_out,
01359 _bfd_ecoff_swap_tir_out,
01360 _bfd_ecoff_swap_rndx_out,
01361
01362 _bfd_ecoff_slurp_symbolic_info
01363 },
01364
01365 RELSZ,
01366
01367 mips_ecoff_swap_reloc_in,
01368 mips_ecoff_swap_reloc_out,
01369
01370 mips_adjust_reloc_in,
01371 mips_adjust_reloc_out,
01372
01373 mips_relocate_section,
01374
01375 NULL,
01376
01377 _bfd_get_elt_at_filepos
01378 };
01379
01380
01381 #define _bfd_ecoff_bfd_reloc_type_lookup mips_bfd_reloc_type_lookup
01382
01383
01384 #define _bfd_ecoff_bfd_get_relocated_section_contents \
01385 bfd_generic_get_relocated_section_contents
01386
01387
01388 #define _bfd_ecoff_get_section_contents_in_window \
01389 _bfd_generic_get_section_contents_in_window
01390
01391
01392 #define _bfd_ecoff_bfd_relax_section bfd_generic_relax_section
01393
01394
01395 #define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections
01396
01397
01398 #define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections
01399
01400 #define _bfd_ecoff_bfd_is_group_section bfd_generic_is_group_section
01401 #define _bfd_ecoff_bfd_discard_group bfd_generic_discard_group
01402 #define _bfd_ecoff_section_already_linked \
01403 _bfd_generic_section_already_linked
01404
01405 extern const bfd_target ecoff_big_vec;
01406
01407 const bfd_target ecoff_little_vec =
01408 {
01409 "ecoff-littlemips",
01410 bfd_target_ecoff_flavour,
01411 BFD_ENDIAN_LITTLE,
01412 BFD_ENDIAN_LITTLE,
01413
01414 (HAS_RELOC | EXEC_P |
01415 HAS_LINENO | HAS_DEBUG |
01416 HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
01417
01418 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
01419 0,
01420 ' ',
01421 15,
01422 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
01423 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
01424 bfd_getl16, bfd_getl_signed_16, bfd_putl16,
01425 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
01426 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
01427 bfd_getl16, bfd_getl_signed_16, bfd_putl16,
01428
01429 {_bfd_dummy_target, coff_object_p,
01430 _bfd_ecoff_archive_p, _bfd_dummy_target},
01431 {bfd_false, _bfd_ecoff_mkobject,
01432 _bfd_generic_mkarchive, bfd_false},
01433 {bfd_false, _bfd_ecoff_write_object_contents,
01434 _bfd_write_archive_contents, bfd_false},
01435
01436 BFD_JUMP_TABLE_GENERIC (_bfd_ecoff),
01437 BFD_JUMP_TABLE_COPY (_bfd_ecoff),
01438 BFD_JUMP_TABLE_CORE (_bfd_nocore),
01439 BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff),
01440 BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff),
01441 BFD_JUMP_TABLE_RELOCS (_bfd_ecoff),
01442 BFD_JUMP_TABLE_WRITE (_bfd_ecoff),
01443 BFD_JUMP_TABLE_LINK (_bfd_ecoff),
01444 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
01445
01446 & ecoff_big_vec,
01447
01448 (PTR) &mips_ecoff_backend_data
01449 };
01450
01451 const bfd_target ecoff_big_vec =
01452 {
01453 "ecoff-bigmips",
01454 bfd_target_ecoff_flavour,
01455 BFD_ENDIAN_BIG,
01456 BFD_ENDIAN_BIG,
01457
01458 (HAS_RELOC | EXEC_P |
01459 HAS_LINENO | HAS_DEBUG |
01460 HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
01461
01462 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
01463 0,
01464 ' ',
01465 15,
01466 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
01467 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
01468 bfd_getb16, bfd_getb_signed_16, bfd_putb16,
01469 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
01470 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
01471 bfd_getb16, bfd_getb_signed_16, bfd_putb16,
01472 {_bfd_dummy_target, coff_object_p,
01473 _bfd_ecoff_archive_p, _bfd_dummy_target},
01474 {bfd_false, _bfd_ecoff_mkobject,
01475 _bfd_generic_mkarchive, bfd_false},
01476 {bfd_false, _bfd_ecoff_write_object_contents,
01477 _bfd_write_archive_contents, bfd_false},
01478
01479 BFD_JUMP_TABLE_GENERIC (_bfd_ecoff),
01480 BFD_JUMP_TABLE_COPY (_bfd_ecoff),
01481 BFD_JUMP_TABLE_CORE (_bfd_nocore),
01482 BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff),
01483 BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff),
01484 BFD_JUMP_TABLE_RELOCS (_bfd_ecoff),
01485 BFD_JUMP_TABLE_WRITE (_bfd_ecoff),
01486 BFD_JUMP_TABLE_LINK (_bfd_ecoff),
01487 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
01488
01489 & ecoff_little_vec,
01490
01491 (PTR) &mips_ecoff_backend_data
01492 };
01493
01494 const bfd_target ecoff_biglittle_vec =
01495 {
01496 "ecoff-biglittlemips",
01497 bfd_target_ecoff_flavour,
01498 BFD_ENDIAN_LITTLE,
01499 BFD_ENDIAN_BIG,
01500
01501 (HAS_RELOC | EXEC_P |
01502 HAS_LINENO | HAS_DEBUG |
01503 HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
01504
01505 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
01506 0,
01507 ' ',
01508 15,
01509 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
01510 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
01511 bfd_getl16, bfd_getl_signed_16, bfd_putl16,
01512 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
01513 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
01514 bfd_getb16, bfd_getb_signed_16, bfd_putb16,
01515
01516 {_bfd_dummy_target, coff_object_p,
01517 _bfd_ecoff_archive_p, _bfd_dummy_target},
01518 {bfd_false, _bfd_ecoff_mkobject,
01519 _bfd_generic_mkarchive, bfd_false},
01520 {bfd_false, _bfd_ecoff_write_object_contents,
01521 _bfd_write_archive_contents, bfd_false},
01522
01523 BFD_JUMP_TABLE_GENERIC (_bfd_ecoff),
01524 BFD_JUMP_TABLE_COPY (_bfd_ecoff),
01525 BFD_JUMP_TABLE_CORE (_bfd_nocore),
01526 BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff),
01527 BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff),
01528 BFD_JUMP_TABLE_RELOCS (_bfd_ecoff),
01529 BFD_JUMP_TABLE_WRITE (_bfd_ecoff),
01530 BFD_JUMP_TABLE_LINK (_bfd_ecoff),
01531 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
01532
01533 NULL,
01534
01535 (PTR) &mips_ecoff_backend_data
01536 };