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
00029
00030
00031
00032
00033
00034
00035
00036 #include "bfd.h"
00037 #include "sysdep.h"
00038 #include "libbfd.h"
00039 #include "bfdlink.h"
00040 #include "genlink.h"
00041 #include "elf-bfd.h"
00042 #include "elfxx-mips.h"
00043 #include "elf/mips.h"
00044
00045
00046 #include "coff/sym.h"
00047 #include "coff/symconst.h"
00048 #include "coff/internal.h"
00049 #include "coff/ecoff.h"
00050 #include "coff/mips.h"
00051 #define ECOFF_SIGNED_32
00052 #include "ecoffswap.h"
00053
00054 static bfd_reloc_status_type gprel32_with_gp
00055 (bfd *, asymbol *, arelent *, asection *, bfd_boolean, void *, bfd_vma);
00056 static bfd_reloc_status_type mips_elf_gprel32_reloc
00057 (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
00058 static bfd_reloc_status_type mips32_64bit_reloc
00059 (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
00060 static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
00061 (bfd *, bfd_reloc_code_real_type);
00062 static reloc_howto_type *mips_elf32_rtype_to_howto
00063 (unsigned int, bfd_boolean);
00064 static void mips_info_to_howto_rel
00065 (bfd *, arelent *, Elf_Internal_Rela *);
00066 static void mips_info_to_howto_rela
00067 (bfd *, arelent *, Elf_Internal_Rela *);
00068 static bfd_boolean mips_elf_sym_is_global
00069 (bfd *, asymbol *);
00070 static bfd_boolean mips_elf32_object_p
00071 (bfd *);
00072 static bfd_boolean mips_elf_is_local_label_name
00073 (bfd *, const char *);
00074 static bfd_reloc_status_type mips16_jump_reloc
00075 (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
00076 static bfd_reloc_status_type mips16_gprel_reloc
00077 (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
00078 static bfd_reloc_status_type mips_elf_final_gp
00079 (bfd *, asymbol *, bfd_boolean, char **, bfd_vma *);
00080 static bfd_boolean mips_elf_assign_gp
00081 (bfd *, bfd_vma *);
00082 static bfd_boolean elf32_mips_grok_prstatus
00083 (bfd *, Elf_Internal_Note *);
00084 static bfd_boolean elf32_mips_grok_psinfo
00085 (bfd *, Elf_Internal_Note *);
00086 static irix_compat_t elf32_mips_irix_compat
00087 (bfd *);
00088
00089 extern const bfd_target bfd_elf32_bigmips_vec;
00090 extern const bfd_target bfd_elf32_littlemips_vec;
00091
00092
00093 #define ABI_N32_P(abfd) \
00094 ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0)
00095
00096
00097 #define SGI_COMPAT(abfd) \
00098 (elf32_mips_irix_compat (abfd) != ict_none)
00099
00100
00101 #define MIPS_RESERVED_GOTNO (2)
00102
00103
00104
00105 #define MINUS_ONE (((bfd_vma)0) - 1)
00106
00107
00108
00109 static reloc_howto_type elf_mips_howto_table_rel[] =
00110 {
00111
00112 HOWTO (R_MIPS_NONE,
00113 0,
00114 0,
00115 0,
00116 FALSE,
00117 0,
00118 complain_overflow_dont,
00119 _bfd_mips_elf_generic_reloc,
00120 "R_MIPS_NONE",
00121 FALSE,
00122 0,
00123 0,
00124 FALSE),
00125
00126
00127 HOWTO (R_MIPS_16,
00128 0,
00129 2,
00130 16,
00131 FALSE,
00132 0,
00133 complain_overflow_signed,
00134 _bfd_mips_elf_generic_reloc,
00135 "R_MIPS_16",
00136 TRUE,
00137 0x0000ffff,
00138 0x0000ffff,
00139 FALSE),
00140
00141
00142 HOWTO (R_MIPS_32,
00143 0,
00144 2,
00145 32,
00146 FALSE,
00147 0,
00148 complain_overflow_dont,
00149 _bfd_mips_elf_generic_reloc,
00150 "R_MIPS_32",
00151 TRUE,
00152 0xffffffff,
00153 0xffffffff,
00154 FALSE),
00155
00156
00157 HOWTO (R_MIPS_REL32,
00158 0,
00159 2,
00160 32,
00161 FALSE,
00162 0,
00163 complain_overflow_dont,
00164 _bfd_mips_elf_generic_reloc,
00165 "R_MIPS_REL32",
00166 TRUE,
00167 0xffffffff,
00168 0xffffffff,
00169 FALSE),
00170
00171
00172 HOWTO (R_MIPS_26,
00173 2,
00174 2,
00175 26,
00176 FALSE,
00177 0,
00178 complain_overflow_dont,
00179
00180
00181
00182 _bfd_mips_elf_generic_reloc,
00183 "R_MIPS_26",
00184 TRUE,
00185 0x03ffffff,
00186 0x03ffffff,
00187 FALSE),
00188
00189
00190 HOWTO (R_MIPS_HI16,
00191 16,
00192 2,
00193 16,
00194 FALSE,
00195 0,
00196 complain_overflow_dont,
00197 _bfd_mips_elf_hi16_reloc,
00198 "R_MIPS_HI16",
00199 TRUE,
00200 0x0000ffff,
00201 0x0000ffff,
00202 FALSE),
00203
00204
00205 HOWTO (R_MIPS_LO16,
00206 0,
00207 2,
00208 16,
00209 FALSE,
00210 0,
00211 complain_overflow_dont,
00212 _bfd_mips_elf_lo16_reloc,
00213 "R_MIPS_LO16",
00214 TRUE,
00215 0x0000ffff,
00216 0x0000ffff,
00217 FALSE),
00218
00219
00220 HOWTO (R_MIPS_GPREL16,
00221 0,
00222 2,
00223 16,
00224 FALSE,
00225 0,
00226 complain_overflow_signed,
00227 _bfd_mips_elf32_gprel16_reloc,
00228 "R_MIPS_GPREL16",
00229 TRUE,
00230 0x0000ffff,
00231 0x0000ffff,
00232 FALSE),
00233
00234
00235 HOWTO (R_MIPS_LITERAL,
00236 0,
00237 2,
00238 16,
00239 FALSE,
00240 0,
00241 complain_overflow_signed,
00242 _bfd_mips_elf32_gprel16_reloc,
00243 "R_MIPS_LITERAL",
00244 TRUE,
00245 0x0000ffff,
00246 0x0000ffff,
00247 FALSE),
00248
00249
00250 HOWTO (R_MIPS_GOT16,
00251 0,
00252 2,
00253 16,
00254 FALSE,
00255 0,
00256 complain_overflow_signed,
00257 _bfd_mips_elf_got16_reloc,
00258 "R_MIPS_GOT16",
00259 TRUE,
00260 0x0000ffff,
00261 0x0000ffff,
00262 FALSE),
00263
00264
00265 HOWTO (R_MIPS_PC16,
00266 0,
00267 2,
00268 16,
00269 TRUE,
00270 0,
00271 complain_overflow_signed,
00272 _bfd_mips_elf_generic_reloc,
00273 "R_MIPS_PC16",
00274 TRUE,
00275 0x0000ffff,
00276 0x0000ffff,
00277 TRUE),
00278
00279
00280 HOWTO (R_MIPS_CALL16,
00281 0,
00282 2,
00283 16,
00284 FALSE,
00285 0,
00286 complain_overflow_signed,
00287 _bfd_mips_elf_generic_reloc,
00288 "R_MIPS_CALL16",
00289 TRUE,
00290 0x0000ffff,
00291 0x0000ffff,
00292 FALSE),
00293
00294
00295 HOWTO (R_MIPS_GPREL32,
00296 0,
00297 2,
00298 32,
00299 FALSE,
00300 0,
00301 complain_overflow_dont,
00302 mips_elf_gprel32_reloc,
00303 "R_MIPS_GPREL32",
00304 TRUE,
00305 0xffffffff,
00306 0xffffffff,
00307 FALSE),
00308
00309
00310
00311 EMPTY_HOWTO (13),
00312 EMPTY_HOWTO (14),
00313 EMPTY_HOWTO (15),
00314
00315
00316 HOWTO (R_MIPS_SHIFT5,
00317 0,
00318 2,
00319 5,
00320 FALSE,
00321 6,
00322 complain_overflow_bitfield,
00323 _bfd_mips_elf_generic_reloc,
00324 "R_MIPS_SHIFT5",
00325 TRUE,
00326 0x000007c0,
00327 0x000007c0,
00328 FALSE),
00329
00330
00331
00332
00333 HOWTO (R_MIPS_SHIFT6,
00334 0,
00335 2,
00336 6,
00337 FALSE,
00338 6,
00339 complain_overflow_bitfield,
00340 _bfd_mips_elf_generic_reloc,
00341 "R_MIPS_SHIFT6",
00342 TRUE,
00343 0x000007c4,
00344 0x000007c4,
00345 FALSE),
00346
00347
00348 HOWTO (R_MIPS_64,
00349 0,
00350 4,
00351 64,
00352 FALSE,
00353 0,
00354 complain_overflow_dont,
00355 mips32_64bit_reloc,
00356 "R_MIPS_64",
00357 TRUE,
00358 MINUS_ONE,
00359 MINUS_ONE,
00360 FALSE),
00361
00362
00363 HOWTO (R_MIPS_GOT_DISP,
00364 0,
00365 2,
00366 16,
00367 FALSE,
00368 0,
00369 complain_overflow_signed,
00370 _bfd_mips_elf_generic_reloc,
00371 "R_MIPS_GOT_DISP",
00372 TRUE,
00373 0x0000ffff,
00374 0x0000ffff,
00375 FALSE),
00376
00377
00378 HOWTO (R_MIPS_GOT_PAGE,
00379 0,
00380 2,
00381 16,
00382 FALSE,
00383 0,
00384 complain_overflow_signed,
00385 _bfd_mips_elf_generic_reloc,
00386 "R_MIPS_GOT_PAGE",
00387 TRUE,
00388 0x0000ffff,
00389 0x0000ffff,
00390 FALSE),
00391
00392
00393 HOWTO (R_MIPS_GOT_OFST,
00394 0,
00395 2,
00396 16,
00397 FALSE,
00398 0,
00399 complain_overflow_signed,
00400 _bfd_mips_elf_generic_reloc,
00401 "R_MIPS_GOT_OFST",
00402 TRUE,
00403 0x0000ffff,
00404 0x0000ffff,
00405 FALSE),
00406
00407
00408 HOWTO (R_MIPS_GOT_HI16,
00409 0,
00410 2,
00411 16,
00412 FALSE,
00413 0,
00414 complain_overflow_dont,
00415 _bfd_mips_elf_generic_reloc,
00416 "R_MIPS_GOT_HI16",
00417 TRUE,
00418 0x0000ffff,
00419 0x0000ffff,
00420 FALSE),
00421
00422
00423 HOWTO (R_MIPS_GOT_LO16,
00424 0,
00425 2,
00426 16,
00427 FALSE,
00428 0,
00429 complain_overflow_dont,
00430 _bfd_mips_elf_generic_reloc,
00431 "R_MIPS_GOT_LO16",
00432 TRUE,
00433 0x0000ffff,
00434 0x0000ffff,
00435 FALSE),
00436
00437
00438 HOWTO (R_MIPS_SUB,
00439 0,
00440 4,
00441 64,
00442 FALSE,
00443 0,
00444 complain_overflow_dont,
00445 _bfd_mips_elf_generic_reloc,
00446 "R_MIPS_SUB",
00447 TRUE,
00448 MINUS_ONE,
00449 MINUS_ONE,
00450 FALSE),
00451
00452
00453 EMPTY_HOWTO (R_MIPS_INSERT_A),
00454 EMPTY_HOWTO (R_MIPS_INSERT_B),
00455 EMPTY_HOWTO (R_MIPS_DELETE),
00456
00457
00458 HOWTO (R_MIPS_HIGHER,
00459 0,
00460 2,
00461 16,
00462 FALSE,
00463 0,
00464 complain_overflow_dont,
00465 _bfd_mips_elf_generic_reloc,
00466 "R_MIPS_HIGHER",
00467 TRUE,
00468 0x0000ffff,
00469 0x0000ffff,
00470 FALSE),
00471
00472
00473 HOWTO (R_MIPS_HIGHEST,
00474 0,
00475 2,
00476 16,
00477 FALSE,
00478 0,
00479 complain_overflow_dont,
00480 _bfd_mips_elf_generic_reloc,
00481 "R_MIPS_HIGHEST",
00482 TRUE,
00483 0x0000ffff,
00484 0x0000ffff,
00485 FALSE),
00486
00487
00488 HOWTO (R_MIPS_CALL_HI16,
00489 0,
00490 2,
00491 16,
00492 FALSE,
00493 0,
00494 complain_overflow_dont,
00495 _bfd_mips_elf_generic_reloc,
00496 "R_MIPS_CALL_HI16",
00497 TRUE,
00498 0x0000ffff,
00499 0x0000ffff,
00500 FALSE),
00501
00502
00503 HOWTO (R_MIPS_CALL_LO16,
00504 0,
00505 2,
00506 16,
00507 FALSE,
00508 0,
00509 complain_overflow_dont,
00510 _bfd_mips_elf_generic_reloc,
00511 "R_MIPS_CALL_LO16",
00512 TRUE,
00513 0x0000ffff,
00514 0x0000ffff,
00515 FALSE),
00516
00517
00518 HOWTO (R_MIPS_SCN_DISP,
00519 0,
00520 2,
00521 32,
00522 FALSE,
00523 0,
00524 complain_overflow_dont,
00525 _bfd_mips_elf_generic_reloc,
00526 "R_MIPS_SCN_DISP",
00527 TRUE,
00528 0xffffffff,
00529 0xffffffff,
00530 FALSE),
00531
00532 EMPTY_HOWTO (R_MIPS_REL16),
00533 EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE),
00534 EMPTY_HOWTO (R_MIPS_PJUMP),
00535 EMPTY_HOWTO (R_MIPS_RELGOT),
00536
00537
00538
00539 HOWTO (R_MIPS_JALR,
00540 0,
00541 2,
00542 32,
00543 FALSE,
00544 0,
00545 complain_overflow_dont,
00546 _bfd_mips_elf_generic_reloc,
00547 "R_MIPS_JALR",
00548 FALSE,
00549 0x00000000,
00550 0x00000000,
00551 FALSE),
00552
00553
00554 HOWTO (R_MIPS_TLS_DTPMOD32,
00555 0,
00556 2,
00557 32,
00558 FALSE,
00559 0,
00560 complain_overflow_dont,
00561 _bfd_mips_elf_generic_reloc,
00562 "R_MIPS_TLS_DTPMOD32",
00563 TRUE,
00564 0xffffffff,
00565 0xffffffff,
00566 FALSE),
00567
00568 HOWTO (R_MIPS_TLS_DTPREL32,
00569 0,
00570 2,
00571 32,
00572 FALSE,
00573 0,
00574 complain_overflow_dont,
00575 _bfd_mips_elf_generic_reloc,
00576 "R_MIPS_TLS_DTPREL32",
00577 TRUE,
00578 0xffffffff,
00579 0xffffffff,
00580 FALSE),
00581
00582 EMPTY_HOWTO (R_MIPS_TLS_DTPMOD64),
00583 EMPTY_HOWTO (R_MIPS_TLS_DTPREL64),
00584
00585
00586 HOWTO (R_MIPS_TLS_GD,
00587 0,
00588 2,
00589 16,
00590 FALSE,
00591 0,
00592 complain_overflow_signed,
00593 _bfd_mips_elf_generic_reloc,
00594 "R_MIPS_TLS_GD",
00595 TRUE,
00596 0x0000ffff,
00597 0x0000ffff,
00598 FALSE),
00599
00600
00601 HOWTO (R_MIPS_TLS_LDM,
00602 0,
00603 2,
00604 16,
00605 FALSE,
00606 0,
00607 complain_overflow_signed,
00608 _bfd_mips_elf_generic_reloc,
00609 "R_MIPS_TLS_LDM",
00610 TRUE,
00611 0x0000ffff,
00612 0x0000ffff,
00613 FALSE),
00614
00615
00616 HOWTO (R_MIPS_TLS_DTPREL_HI16,
00617 0,
00618 2,
00619 16,
00620 FALSE,
00621 0,
00622 complain_overflow_signed,
00623 _bfd_mips_elf_generic_reloc,
00624 "R_MIPS_TLS_DTPREL_HI16",
00625 TRUE,
00626 0x0000ffff,
00627 0x0000ffff,
00628 FALSE),
00629
00630
00631 HOWTO (R_MIPS_TLS_DTPREL_LO16,
00632 0,
00633 2,
00634 16,
00635 FALSE,
00636 0,
00637 complain_overflow_signed,
00638 _bfd_mips_elf_generic_reloc,
00639 "R_MIPS_TLS_DTPREL_LO16",
00640 TRUE,
00641 0x0000ffff,
00642 0x0000ffff,
00643 FALSE),
00644
00645
00646 HOWTO (R_MIPS_TLS_GOTTPREL,
00647 0,
00648 2,
00649 16,
00650 FALSE,
00651 0,
00652 complain_overflow_signed,
00653 _bfd_mips_elf_generic_reloc,
00654 "R_MIPS_TLS_GOTTPREL",
00655 TRUE,
00656 0x0000ffff,
00657 0x0000ffff,
00658 FALSE),
00659
00660
00661 HOWTO (R_MIPS_TLS_TPREL32,
00662 0,
00663 2,
00664 32,
00665 FALSE,
00666 0,
00667 complain_overflow_dont,
00668 _bfd_mips_elf_generic_reloc,
00669 "R_MIPS_TLS_TPREL32",
00670 TRUE,
00671 0xffffffff,
00672 0xffffffff,
00673 FALSE),
00674
00675 EMPTY_HOWTO (R_MIPS_TLS_TPREL64),
00676
00677
00678 HOWTO (R_MIPS_TLS_TPREL_HI16,
00679 0,
00680 2,
00681 16,
00682 FALSE,
00683 0,
00684 complain_overflow_signed,
00685 _bfd_mips_elf_generic_reloc,
00686 "R_MIPS_TLS_TPREL_HI16",
00687 TRUE,
00688 0x0000ffff,
00689 0x0000ffff,
00690 FALSE),
00691
00692
00693 HOWTO (R_MIPS_TLS_TPREL_LO16,
00694 0,
00695 2,
00696 16,
00697 FALSE,
00698 0,
00699 complain_overflow_signed,
00700 _bfd_mips_elf_generic_reloc,
00701 "R_MIPS_TLS_TPREL_LO16",
00702 TRUE,
00703 0x0000ffff,
00704 0x0000ffff,
00705 FALSE),
00706 };
00707
00708
00709
00710 static reloc_howto_type elf_mips_ctor64_howto =
00711 HOWTO (R_MIPS_64,
00712 0,
00713 4,
00714 32,
00715 FALSE,
00716 0,
00717 complain_overflow_signed,
00718 mips32_64bit_reloc,
00719 "R_MIPS_64",
00720 TRUE,
00721 0xffffffff,
00722 0xffffffff,
00723 FALSE);
00724
00725 static reloc_howto_type elf_mips16_howto_table_rel[] =
00726 {
00727
00728 HOWTO (R_MIPS16_26,
00729 2,
00730 2,
00731 26,
00732 FALSE,
00733 0,
00734 complain_overflow_dont,
00735
00736
00737
00738 mips16_jump_reloc,
00739 "R_MIPS16_26",
00740 TRUE,
00741 0x3ffffff,
00742 0x3ffffff,
00743 FALSE),
00744
00745
00746 HOWTO (R_MIPS16_GPREL,
00747 0,
00748 2,
00749 16,
00750 FALSE,
00751 0,
00752 complain_overflow_signed,
00753 mips16_gprel_reloc,
00754 "R_MIPS16_GPREL",
00755 TRUE,
00756 0x0000ffff,
00757 0x0000ffff,
00758 FALSE),
00759
00760
00761 EMPTY_HOWTO (R_MIPS16_GOT16),
00762
00763
00764 EMPTY_HOWTO (R_MIPS16_CALL16),
00765
00766
00767 HOWTO (R_MIPS16_HI16,
00768 16,
00769 2,
00770 16,
00771 FALSE,
00772 0,
00773 complain_overflow_dont,
00774 _bfd_mips_elf_hi16_reloc,
00775 "R_MIPS16_HI16",
00776 TRUE,
00777 0x0000ffff,
00778 0x0000ffff,
00779 FALSE),
00780
00781
00782 HOWTO (R_MIPS16_LO16,
00783 0,
00784 2,
00785 16,
00786 FALSE,
00787 0,
00788 complain_overflow_dont,
00789 _bfd_mips_elf_lo16_reloc,
00790 "R_MIPS16_LO16",
00791 TRUE,
00792 0x0000ffff,
00793 0x0000ffff,
00794 FALSE),
00795 };
00796
00797
00798 static reloc_howto_type elf_mips_gnu_rel16_s2 =
00799 HOWTO (R_MIPS_GNU_REL16_S2,
00800 2,
00801 2,
00802 16,
00803 TRUE,
00804 0,
00805 complain_overflow_signed,
00806 _bfd_mips_elf_generic_reloc,
00807 "R_MIPS_GNU_REL16_S2",
00808 TRUE,
00809 0xffff,
00810 0xffff,
00811 TRUE);
00812
00813
00814
00815
00816
00817 static reloc_howto_type elf_mips_gnu_pcrel32 =
00818 HOWTO (R_MIPS_PC32,
00819 0,
00820 2,
00821 32,
00822 TRUE,
00823 0,
00824 complain_overflow_signed,
00825 _bfd_mips_elf_generic_reloc,
00826 "R_MIPS_PC32",
00827 TRUE,
00828 0xffffffff,
00829 0xffffffff,
00830 TRUE);
00831
00832
00833 static reloc_howto_type elf_mips_gnu_vtinherit_howto =
00834 HOWTO (R_MIPS_GNU_VTINHERIT,
00835 0,
00836 2,
00837 0,
00838 FALSE,
00839 0,
00840 complain_overflow_dont,
00841 NULL,
00842 "R_MIPS_GNU_VTINHERIT",
00843 FALSE,
00844 0,
00845 0,
00846 FALSE);
00847
00848
00849 static reloc_howto_type elf_mips_gnu_vtentry_howto =
00850 HOWTO (R_MIPS_GNU_VTENTRY,
00851 0,
00852 2,
00853 0,
00854 FALSE,
00855 0,
00856 complain_overflow_dont,
00857 _bfd_elf_rel_vtable_reloc_fn,
00858 "R_MIPS_GNU_VTENTRY",
00859 FALSE,
00860 0,
00861 0,
00862 FALSE);
00863
00864
00865
00866
00867 static bfd_boolean
00868 mips_elf_assign_gp (bfd *output_bfd, bfd_vma *pgp)
00869 {
00870 unsigned int count;
00871 asymbol **sym;
00872 unsigned int i;
00873
00874
00875 *pgp = _bfd_get_gp_value (output_bfd);
00876 if (*pgp)
00877 return TRUE;
00878
00879 count = bfd_get_symcount (output_bfd);
00880 sym = bfd_get_outsymbols (output_bfd);
00881
00882
00883
00884 if (sym == NULL)
00885 i = count;
00886 else
00887 {
00888 for (i = 0; i < count; i++, sym++)
00889 {
00890 register const char *name;
00891
00892 name = bfd_asymbol_name (*sym);
00893 if (*name == '_' && strcmp (name, "_gp") == 0)
00894 {
00895 *pgp = bfd_asymbol_value (*sym);
00896 _bfd_set_gp_value (output_bfd, *pgp);
00897 break;
00898 }
00899 }
00900 }
00901
00902 if (i >= count)
00903 {
00904
00905 *pgp = 4;
00906 _bfd_set_gp_value (output_bfd, *pgp);
00907 return FALSE;
00908 }
00909
00910 return TRUE;
00911 }
00912
00913
00914
00915
00916
00917
00918
00919 static bfd_reloc_status_type
00920 mips_elf_final_gp (bfd *output_bfd, asymbol *symbol, bfd_boolean relocatable,
00921 char **error_message, bfd_vma *pgp)
00922 {
00923 if (bfd_is_und_section (symbol->section)
00924 && ! relocatable)
00925 {
00926 *pgp = 0;
00927 return bfd_reloc_undefined;
00928 }
00929
00930 *pgp = _bfd_get_gp_value (output_bfd);
00931 if (*pgp == 0
00932 && (! relocatable
00933 || (symbol->flags & BSF_SECTION_SYM) != 0))
00934 {
00935 if (relocatable)
00936 {
00937
00938 *pgp = symbol->section->output_section->vma + 0x4000;
00939 _bfd_set_gp_value (output_bfd, *pgp);
00940 }
00941 else if (!mips_elf_assign_gp (output_bfd, pgp))
00942 {
00943 *error_message =
00944 (char *) _("GP relative relocation when _gp not defined");
00945 return bfd_reloc_dangerous;
00946 }
00947 }
00948
00949 return bfd_reloc_ok;
00950 }
00951
00952
00953
00954
00955
00956
00957
00958 bfd_reloc_status_type
00959 _bfd_mips_elf32_gprel16_reloc (bfd *abfd, arelent *reloc_entry,
00960 asymbol *symbol, void *data,
00961 asection *input_section, bfd *output_bfd,
00962 char **error_message)
00963 {
00964 bfd_boolean relocatable;
00965 bfd_reloc_status_type ret;
00966 bfd_vma gp;
00967
00968
00969 if (reloc_entry->howto->type == R_MIPS_LITERAL
00970 && output_bfd != NULL
00971 && (symbol->flags & BSF_SECTION_SYM) == 0
00972 && (symbol->flags & BSF_LOCAL) != 0)
00973 {
00974 *error_message = (char *)
00975 _("literal relocation occurs for an external symbol");
00976 return bfd_reloc_outofrange;
00977 }
00978
00979 if (output_bfd != NULL)
00980 relocatable = TRUE;
00981 else
00982 {
00983 relocatable = FALSE;
00984 output_bfd = symbol->section->output_section->owner;
00985 }
00986
00987 ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message,
00988 &gp);
00989 if (ret != bfd_reloc_ok)
00990 return ret;
00991
00992 return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry,
00993 input_section, relocatable,
00994 data, gp);
00995 }
00996
00997
00998
00999
01000 static bfd_reloc_status_type
01001 mips_elf_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
01002 void *data, asection *input_section, bfd *output_bfd,
01003 char **error_message)
01004 {
01005 bfd_boolean relocatable;
01006 bfd_reloc_status_type ret;
01007 bfd_vma gp;
01008
01009
01010 if (output_bfd != NULL
01011 && (symbol->flags & BSF_SECTION_SYM) == 0
01012 && (symbol->flags & BSF_LOCAL) != 0)
01013 {
01014 *error_message = (char *)
01015 _("32bits gp relative relocation occurs for an external symbol");
01016 return bfd_reloc_outofrange;
01017 }
01018
01019 if (output_bfd != NULL)
01020 relocatable = TRUE;
01021 else
01022 {
01023 relocatable = FALSE;
01024 output_bfd = symbol->section->output_section->owner;
01025 }
01026
01027 ret = mips_elf_final_gp (output_bfd, symbol, relocatable,
01028 error_message, &gp);
01029 if (ret != bfd_reloc_ok)
01030 return ret;
01031
01032 return gprel32_with_gp (abfd, symbol, reloc_entry, input_section,
01033 relocatable, data, gp);
01034 }
01035
01036 static bfd_reloc_status_type
01037 gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry,
01038 asection *input_section, bfd_boolean relocatable,
01039 void *data, bfd_vma gp)
01040 {
01041 bfd_vma relocation;
01042 bfd_vma val;
01043
01044 if (bfd_is_com_section (symbol->section))
01045 relocation = 0;
01046 else
01047 relocation = symbol->value;
01048
01049 relocation += symbol->section->output_section->vma;
01050 relocation += symbol->section->output_offset;
01051
01052 if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
01053 return bfd_reloc_outofrange;
01054
01055
01056 val = reloc_entry->addend;
01057
01058 if (reloc_entry->howto->partial_inplace)
01059 val += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address);
01060
01061
01062
01063
01064 if (! relocatable
01065 || (symbol->flags & BSF_SECTION_SYM) != 0)
01066 val += relocation - gp;
01067
01068 if (reloc_entry->howto->partial_inplace)
01069 bfd_put_32 (abfd, val, (bfd_byte *) data + reloc_entry->address);
01070 else
01071 reloc_entry->addend = val;
01072
01073 if (relocatable)
01074 reloc_entry->address += input_section->output_offset;
01075
01076 return bfd_reloc_ok;
01077 }
01078
01079
01080
01081
01082
01083 static bfd_reloc_status_type
01084 mips32_64bit_reloc (bfd *abfd, arelent *reloc_entry,
01085 asymbol *symbol ATTRIBUTE_UNUSED,
01086 void *data, asection *input_section,
01087 bfd *output_bfd, char **error_message)
01088 {
01089 bfd_reloc_status_type r;
01090 arelent reloc32;
01091 unsigned long val;
01092 bfd_size_type addr;
01093
01094
01095 reloc32 = *reloc_entry;
01096 if (bfd_big_endian (abfd))
01097 reloc32.address += 4;
01098 reloc32.howto = &elf_mips_howto_table_rel[R_MIPS_32];
01099 r = bfd_perform_relocation (abfd, &reloc32, data, input_section,
01100 output_bfd, error_message);
01101
01102
01103 val = bfd_get_32 (abfd, (bfd_byte *) data + reloc32.address);
01104 if ((val & 0x80000000) != 0)
01105 val = 0xffffffff;
01106 else
01107 val = 0;
01108 addr = reloc_entry->address;
01109 if (bfd_little_endian (abfd))
01110 addr += 4;
01111 bfd_put_32 (abfd, val, (bfd_byte *) data + addr);
01112
01113 return r;
01114 }
01115
01116
01117
01118 static bfd_reloc_status_type
01119 mips16_jump_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry,
01120 asymbol *symbol, void *data ATTRIBUTE_UNUSED,
01121 asection *input_section, bfd *output_bfd,
01122 char **error_message ATTRIBUTE_UNUSED)
01123 {
01124 if (output_bfd != NULL
01125 && (symbol->flags & BSF_SECTION_SYM) == 0
01126 && reloc_entry->addend == 0)
01127 {
01128 reloc_entry->address += input_section->output_offset;
01129 return bfd_reloc_ok;
01130 }
01131
01132
01133 {
01134 static bfd_boolean warned;
01135
01136 if (! warned)
01137 (*_bfd_error_handler)
01138 (_("Linking mips16 objects into %s format is not supported"),
01139 bfd_get_target (input_section->output_section->owner));
01140 warned = TRUE;
01141 }
01142
01143 return bfd_reloc_undefined;
01144 }
01145
01146
01147
01148 static bfd_reloc_status_type
01149 mips16_gprel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
01150 void *data, asection *input_section, bfd *output_bfd,
01151 char **error_message)
01152 {
01153 bfd_boolean relocatable;
01154 bfd_reloc_status_type ret;
01155 bfd_byte *location;
01156 bfd_vma gp;
01157
01158
01159
01160 if (output_bfd != NULL
01161 && (symbol->flags & BSF_SECTION_SYM) == 0
01162 && (symbol->flags & BSF_LOCAL) != 0)
01163 {
01164 reloc_entry->address += input_section->output_offset;
01165 return bfd_reloc_ok;
01166 }
01167
01168 if (output_bfd != NULL)
01169 relocatable = TRUE;
01170 else
01171 {
01172 relocatable = FALSE;
01173 output_bfd = symbol->section->output_section->owner;
01174 }
01175
01176 ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message,
01177 &gp);
01178 if (ret != bfd_reloc_ok)
01179 return ret;
01180
01181 location = (bfd_byte *) data + reloc_entry->address;
01182 _bfd_mips16_elf_reloc_unshuffle (abfd, reloc_entry->howto->type, FALSE,
01183 location);
01184 ret = _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry,
01185 input_section, relocatable,
01186 data, gp);
01187 _bfd_mips16_elf_reloc_shuffle (abfd, reloc_entry->howto->type, !relocatable,
01188 location);
01189
01190 return ret;
01191 }
01192
01193
01194
01195 struct elf_reloc_map {
01196 bfd_reloc_code_real_type bfd_val;
01197 enum elf_mips_reloc_type elf_val;
01198 };
01199
01200 static const struct elf_reloc_map mips_reloc_map[] =
01201 {
01202 { BFD_RELOC_NONE, R_MIPS_NONE },
01203 { BFD_RELOC_16, R_MIPS_16 },
01204 { BFD_RELOC_32, R_MIPS_32 },
01205
01206 { BFD_RELOC_64, R_MIPS_64 },
01207 { BFD_RELOC_MIPS_JMP, R_MIPS_26 },
01208 { BFD_RELOC_HI16_S, R_MIPS_HI16 },
01209 { BFD_RELOC_LO16, R_MIPS_LO16 },
01210 { BFD_RELOC_GPREL16, R_MIPS_GPREL16 },
01211 { BFD_RELOC_MIPS_LITERAL, R_MIPS_LITERAL },
01212 { BFD_RELOC_MIPS_GOT16, R_MIPS_GOT16 },
01213 { BFD_RELOC_16_PCREL, R_MIPS_PC16 },
01214 { BFD_RELOC_MIPS_CALL16, R_MIPS_CALL16 },
01215 { BFD_RELOC_GPREL32, R_MIPS_GPREL32 },
01216 { BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },
01217 { BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 },
01218 { BFD_RELOC_MIPS_CALL_HI16, R_MIPS_CALL_HI16 },
01219 { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 },
01220 { BFD_RELOC_MIPS_SUB, R_MIPS_SUB },
01221 { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE },
01222 { BFD_RELOC_MIPS_GOT_OFST, R_MIPS_GOT_OFST },
01223 { BFD_RELOC_MIPS_GOT_DISP, R_MIPS_GOT_DISP },
01224 { BFD_RELOC_MIPS_TLS_DTPMOD32, R_MIPS_TLS_DTPMOD32 },
01225 { BFD_RELOC_MIPS_TLS_DTPREL32, R_MIPS_TLS_DTPREL32 },
01226 { BFD_RELOC_MIPS_TLS_DTPMOD64, R_MIPS_TLS_DTPMOD64 },
01227 { BFD_RELOC_MIPS_TLS_DTPREL64, R_MIPS_TLS_DTPREL64 },
01228 { BFD_RELOC_MIPS_TLS_GD, R_MIPS_TLS_GD },
01229 { BFD_RELOC_MIPS_TLS_LDM, R_MIPS_TLS_LDM },
01230 { BFD_RELOC_MIPS_TLS_DTPREL_HI16, R_MIPS_TLS_DTPREL_HI16 },
01231 { BFD_RELOC_MIPS_TLS_DTPREL_LO16, R_MIPS_TLS_DTPREL_LO16 },
01232 { BFD_RELOC_MIPS_TLS_GOTTPREL, R_MIPS_TLS_GOTTPREL },
01233 { BFD_RELOC_MIPS_TLS_TPREL32, R_MIPS_TLS_TPREL32 },
01234 { BFD_RELOC_MIPS_TLS_TPREL64, R_MIPS_TLS_TPREL64 },
01235 { BFD_RELOC_MIPS_TLS_TPREL_HI16, R_MIPS_TLS_TPREL_HI16 },
01236 { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 }
01237 };
01238
01239 static const struct elf_reloc_map mips16_reloc_map[] =
01240 {
01241 { BFD_RELOC_MIPS16_JMP, R_MIPS16_26 - R_MIPS16_min },
01242 { BFD_RELOC_MIPS16_GPREL, R_MIPS16_GPREL - R_MIPS16_min },
01243 { BFD_RELOC_MIPS16_HI16_S, R_MIPS16_HI16 - R_MIPS16_min },
01244 { BFD_RELOC_MIPS16_LO16, R_MIPS16_LO16 - R_MIPS16_min },
01245 };
01246
01247
01248
01249 static reloc_howto_type *
01250 bfd_elf32_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
01251 {
01252 unsigned int i;
01253 reloc_howto_type *howto_table = elf_mips_howto_table_rel;
01254 reloc_howto_type *howto16_table = elf_mips16_howto_table_rel;
01255
01256 for (i = 0; i < sizeof (mips_reloc_map) / sizeof (struct elf_reloc_map);
01257 i++)
01258 {
01259 if (mips_reloc_map[i].bfd_val == code)
01260 return &howto_table[(int) mips_reloc_map[i].elf_val];
01261 }
01262
01263 for (i = 0; i < sizeof (mips16_reloc_map) / sizeof (struct elf_reloc_map);
01264 i++)
01265 {
01266 if (mips16_reloc_map[i].bfd_val == code)
01267 return &howto16_table[(int) mips16_reloc_map[i].elf_val];
01268 }
01269
01270 switch (code)
01271 {
01272 default:
01273 bfd_set_error (bfd_error_bad_value);
01274 return NULL;
01275
01276 case BFD_RELOC_CTOR:
01277
01278
01279
01280 if ((elf_elfheader (abfd)->e_flags & (E_MIPS_ABI_O64
01281 | E_MIPS_ABI_EABI64)) != 0)
01282 return &elf_mips_ctor64_howto;
01283 else
01284 return &howto_table[(int) R_MIPS_32];
01285
01286 case BFD_RELOC_VTABLE_INHERIT:
01287 return &elf_mips_gnu_vtinherit_howto;
01288 case BFD_RELOC_VTABLE_ENTRY:
01289 return &elf_mips_gnu_vtentry_howto;
01290 case BFD_RELOC_16_PCREL_S2:
01291 return &elf_mips_gnu_rel16_s2;
01292 case BFD_RELOC_32_PCREL:
01293 return &elf_mips_gnu_pcrel32;
01294 }
01295 }
01296
01297
01298
01299 static reloc_howto_type *
01300 mips_elf32_rtype_to_howto (unsigned int r_type,
01301 bfd_boolean rela_p ATTRIBUTE_UNUSED)
01302 {
01303 switch (r_type)
01304 {
01305 case R_MIPS_GNU_VTINHERIT:
01306 return &elf_mips_gnu_vtinherit_howto;
01307 case R_MIPS_GNU_VTENTRY:
01308 return &elf_mips_gnu_vtentry_howto;
01309 case R_MIPS_GNU_REL16_S2:
01310 return &elf_mips_gnu_rel16_s2;
01311 case R_MIPS_PC32:
01312 return &elf_mips_gnu_pcrel32;
01313 default:
01314 if (r_type >= R_MIPS16_min && r_type < R_MIPS16_max)
01315 return &elf_mips16_howto_table_rel[r_type - R_MIPS16_min];
01316 BFD_ASSERT (r_type < (unsigned int) R_MIPS_max);
01317 return &elf_mips_howto_table_rel[r_type];
01318 }
01319 }
01320
01321
01322
01323 static void
01324 mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
01325 {
01326 unsigned int r_type;
01327
01328 r_type = ELF32_R_TYPE (dst->r_info);
01329 cache_ptr->howto = mips_elf32_rtype_to_howto (r_type, FALSE);
01330
01331
01332
01333
01334
01335 if (((*cache_ptr->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0
01336 && (r_type == (unsigned int) R_MIPS_GPREL16
01337 || r_type == (unsigned int) R_MIPS_LITERAL))
01338 cache_ptr->addend = elf_gp (abfd);
01339 }
01340
01341
01342
01343 static void
01344 mips_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
01345 {
01346 mips_info_to_howto_rel (abfd, cache_ptr, dst);
01347
01348
01349
01350 }
01351
01352
01353
01354
01355
01356
01357
01358 static bfd_boolean
01359 mips_elf_sym_is_global (bfd *abfd ATTRIBUTE_UNUSED, asymbol *sym)
01360 {
01361 if (SGI_COMPAT (abfd))
01362 return (sym->flags & BSF_SECTION_SYM) == 0;
01363 else
01364 return ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0
01365 || bfd_is_und_section (bfd_get_section (sym))
01366 || bfd_is_com_section (bfd_get_section (sym)));
01367 }
01368
01369
01370
01371 static bfd_boolean
01372 mips_elf32_object_p (bfd *abfd)
01373 {
01374 unsigned long mach;
01375
01376
01377
01378
01379 if (SGI_COMPAT (abfd))
01380 elf_bad_symtab (abfd) = TRUE;
01381
01382 if (ABI_N32_P (abfd))
01383 return FALSE;
01384
01385 mach = _bfd_elf_mips_mach (elf_elfheader (abfd)->e_flags);
01386 bfd_default_set_arch_mach (abfd, bfd_arch_mips, mach);
01387
01388 return TRUE;
01389 }
01390
01391
01392
01393 static bfd_boolean
01394 mips_elf_is_local_label_name (bfd *abfd, const char *name)
01395 {
01396 if (name[0] == '$')
01397 return TRUE;
01398
01399
01400
01401 return _bfd_elf_is_local_label_name (abfd, name);
01402 }
01403
01404
01405 static bfd_boolean
01406 elf32_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
01407 {
01408 int offset;
01409 unsigned int size;
01410
01411 switch (note->descsz)
01412 {
01413 default:
01414 return FALSE;
01415
01416 case 256:
01417
01418 elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
01419
01420
01421 elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
01422
01423
01424 offset = 72;
01425 size = 180;
01426
01427 break;
01428 }
01429
01430
01431 return _bfd_elfcore_make_pseudosection (abfd, ".reg",
01432 size, note->descpos + offset);
01433 }
01434
01435 static bfd_boolean
01436 elf32_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
01437 {
01438 switch (note->descsz)
01439 {
01440 default:
01441 return FALSE;
01442
01443 case 128:
01444 elf_tdata (abfd)->core_program
01445 = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
01446 elf_tdata (abfd)->core_command
01447 = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
01448 }
01449
01450
01451
01452
01453
01454 {
01455 char *command = elf_tdata (abfd)->core_command;
01456 int n = strlen (command);
01457
01458 if (0 < n && command[n - 1] == ' ')
01459 command[n - 1] = '\0';
01460 }
01461
01462 return TRUE;
01463 }
01464
01465
01466
01467 static irix_compat_t
01468 elf32_mips_irix_compat (bfd *abfd)
01469 {
01470 if ((abfd->xvec == &bfd_elf32_bigmips_vec)
01471 || (abfd->xvec == &bfd_elf32_littlemips_vec))
01472 return ict_irix5;
01473 else
01474 return ict_none;
01475 }
01476
01477
01478
01479 static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
01480
01481 magicSym,
01482
01483 4,
01484
01485 sizeof (struct hdr_ext),
01486 sizeof (struct dnr_ext),
01487 sizeof (struct pdr_ext),
01488 sizeof (struct sym_ext),
01489 sizeof (struct opt_ext),
01490 sizeof (struct fdr_ext),
01491 sizeof (struct rfd_ext),
01492 sizeof (struct ext_ext),
01493
01494 ecoff_swap_hdr_in,
01495 ecoff_swap_dnr_in,
01496 ecoff_swap_pdr_in,
01497 ecoff_swap_sym_in,
01498 ecoff_swap_opt_in,
01499 ecoff_swap_fdr_in,
01500 ecoff_swap_rfd_in,
01501 ecoff_swap_ext_in,
01502 _bfd_ecoff_swap_tir_in,
01503 _bfd_ecoff_swap_rndx_in,
01504
01505 ecoff_swap_hdr_out,
01506 ecoff_swap_dnr_out,
01507 ecoff_swap_pdr_out,
01508 ecoff_swap_sym_out,
01509 ecoff_swap_opt_out,
01510 ecoff_swap_fdr_out,
01511 ecoff_swap_rfd_out,
01512 ecoff_swap_ext_out,
01513 _bfd_ecoff_swap_tir_out,
01514 _bfd_ecoff_swap_rndx_out,
01515
01516 _bfd_mips_elf_read_ecoff_info
01517 };
01518
01519 #define ELF_ARCH bfd_arch_mips
01520 #define ELF_MACHINE_CODE EM_MIPS
01521
01522 #define elf_backend_collect TRUE
01523 #define elf_backend_type_change_ok TRUE
01524 #define elf_backend_can_gc_sections TRUE
01525 #define elf_info_to_howto mips_info_to_howto_rela
01526 #define elf_info_to_howto_rel mips_info_to_howto_rel
01527 #define elf_backend_sym_is_global mips_elf_sym_is_global
01528 #define elf_backend_object_p mips_elf32_object_p
01529 #define elf_backend_symbol_processing _bfd_mips_elf_symbol_processing
01530 #define elf_backend_section_processing _bfd_mips_elf_section_processing
01531 #define elf_backend_section_from_shdr _bfd_mips_elf_section_from_shdr
01532 #define elf_backend_fake_sections _bfd_mips_elf_fake_sections
01533 #define elf_backend_section_from_bfd_section \
01534 _bfd_mips_elf_section_from_bfd_section
01535 #define elf_backend_add_symbol_hook _bfd_mips_elf_add_symbol_hook
01536 #define elf_backend_link_output_symbol_hook \
01537 _bfd_mips_elf_link_output_symbol_hook
01538 #define elf_backend_create_dynamic_sections \
01539 _bfd_mips_elf_create_dynamic_sections
01540 #define elf_backend_check_relocs _bfd_mips_elf_check_relocs
01541 #define elf_backend_adjust_dynamic_symbol \
01542 _bfd_mips_elf_adjust_dynamic_symbol
01543 #define elf_backend_always_size_sections \
01544 _bfd_mips_elf_always_size_sections
01545 #define elf_backend_size_dynamic_sections \
01546 _bfd_mips_elf_size_dynamic_sections
01547 #define elf_backend_relocate_section _bfd_mips_elf_relocate_section
01548 #define elf_backend_finish_dynamic_symbol \
01549 _bfd_mips_elf_finish_dynamic_symbol
01550 #define elf_backend_finish_dynamic_sections \
01551 _bfd_mips_elf_finish_dynamic_sections
01552 #define elf_backend_final_write_processing \
01553 _bfd_mips_elf_final_write_processing
01554 #define elf_backend_additional_program_headers \
01555 _bfd_mips_elf_additional_program_headers
01556 #define elf_backend_modify_segment_map _bfd_mips_elf_modify_segment_map
01557 #define elf_backend_gc_mark_hook _bfd_mips_elf_gc_mark_hook
01558 #define elf_backend_gc_sweep_hook _bfd_mips_elf_gc_sweep_hook
01559 #define elf_backend_copy_indirect_symbol \
01560 _bfd_mips_elf_copy_indirect_symbol
01561 #define elf_backend_hide_symbol _bfd_mips_elf_hide_symbol
01562 #define elf_backend_grok_prstatus elf32_mips_grok_prstatus
01563 #define elf_backend_grok_psinfo elf32_mips_grok_psinfo
01564 #define elf_backend_ecoff_debug_swap &mips_elf32_ecoff_debug_swap
01565
01566 #define elf_backend_got_header_size (4 * MIPS_RESERVED_GOTNO)
01567 #define elf_backend_may_use_rel_p 1
01568 #define elf_backend_may_use_rela_p 0
01569 #define elf_backend_default_use_rela_p 0
01570 #define elf_backend_sign_extend_vma TRUE
01571
01572 #define elf_backend_discard_info _bfd_mips_elf_discard_info
01573 #define elf_backend_ignore_discarded_relocs \
01574 _bfd_mips_elf_ignore_discarded_relocs
01575 #define elf_backend_mips_irix_compat elf32_mips_irix_compat
01576 #define elf_backend_mips_rtype_to_howto mips_elf32_rtype_to_howto
01577 #define bfd_elf32_bfd_is_local_label_name \
01578 mips_elf_is_local_label_name
01579 #define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line
01580 #define bfd_elf32_new_section_hook _bfd_mips_elf_new_section_hook
01581 #define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents
01582 #define bfd_elf32_bfd_get_relocated_section_contents \
01583 _bfd_elf_mips_get_relocated_section_contents
01584 #define bfd_elf32_bfd_link_hash_table_create \
01585 _bfd_mips_elf_link_hash_table_create
01586 #define bfd_elf32_bfd_final_link _bfd_mips_elf_final_link
01587 #define bfd_elf32_bfd_merge_private_bfd_data \
01588 _bfd_mips_elf_merge_private_bfd_data
01589 #define bfd_elf32_bfd_set_private_flags _bfd_mips_elf_set_private_flags
01590 #define bfd_elf32_bfd_print_private_bfd_data \
01591 _bfd_mips_elf_print_private_bfd_data
01592
01593
01594 #define TARGET_LITTLE_SYM bfd_elf32_littlemips_vec
01595 #define TARGET_LITTLE_NAME "elf32-littlemips"
01596 #define TARGET_BIG_SYM bfd_elf32_bigmips_vec
01597 #define TARGET_BIG_NAME "elf32-bigmips"
01598
01599
01600
01601 #define ELF_MAXPAGESIZE 0x1000
01602
01603 #include "elf32-target.h"
01604
01605
01606 #undef TARGET_LITTLE_SYM
01607 #undef TARGET_LITTLE_NAME
01608 #undef TARGET_BIG_SYM
01609 #undef TARGET_BIG_NAME
01610
01611 #undef ELF_MAXPAGESIZE
01612
01613 #define TARGET_LITTLE_SYM bfd_elf32_tradlittlemips_vec
01614 #define TARGET_LITTLE_NAME "elf32-tradlittlemips"
01615 #define TARGET_BIG_SYM bfd_elf32_tradbigmips_vec
01616 #define TARGET_BIG_NAME "elf32-tradbigmips"
01617
01618
01619
01620 #define ELF_MAXPAGESIZE 0x10000
01621 #define elf32_bed elf32_tradbed
01622
01623
01624 #include "elf32-target.h"