1 /* MIPS-specific support for 32-bit ELF
2 Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
5 Most of the information added by Ian Lance Taylor, Cygnus Support,
7 N32/64 ABI support added by Mark Mitchell, CodeSourcery, LLC.
8 <mark@codesourcery.com>
9 Traditional MIPS targets support added by Koundinya.K, Dansk Data
10 Elektronik & Operations Research Group. <kk@ddeorg.soft.net>
12 This file is part of BFD, the Binary File Descriptor library.
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
28 /* This file handles MIPS ELF targets. SGI Irix 5 uses a slightly
29 different MIPS ELF from other targets. This matters when linking.
30 This file supports both, switching at runtime. */
38 #include "elfxx-mips.h"
41 /* Get the ECOFF swapping routines. */
43 #include "coff/symconst.h"
44 #include "coff/internal.h"
45 #include "coff/ecoff.h"
46 #include "coff/mips.h"
47 #define ECOFF_SIGNED_32
48 #include "ecoffswap.h"
50 static bfd_reloc_status_type mips_elf_hi16_reloc
51 PARAMS ((bfd
*, arelent
*, asymbol
*, PTR
, asection
*, bfd
*, char **));
52 static bfd_reloc_status_type mips_elf_lo16_reloc
53 PARAMS ((bfd
*, arelent
*, asymbol
*, PTR
, asection
*, bfd
*, char **));
54 static bfd_reloc_status_type mips_elf_got16_reloc
55 PARAMS ((bfd
*, arelent
*, asymbol
*, PTR
, asection
*, bfd
*, char **));
56 static bfd_reloc_status_type mips_elf_gprel32_reloc
57 PARAMS ((bfd
*, arelent
*, asymbol
*, PTR
, asection
*, bfd
*, char **));
58 static bfd_reloc_status_type mips32_64bit_reloc
59 PARAMS ((bfd
*, arelent
*, asymbol
*, PTR
, asection
*, bfd
*, char **));
60 static reloc_howto_type
*bfd_elf32_bfd_reloc_type_lookup
61 PARAMS ((bfd
*, bfd_reloc_code_real_type
));
62 static reloc_howto_type
*mips_elf32_rtype_to_howto
63 PARAMS ((unsigned int, boolean
));
64 static void mips_info_to_howto_rel
65 PARAMS ((bfd
*, arelent
*, Elf32_Internal_Rel
*));
66 static void mips_info_to_howto_rela
67 PARAMS ((bfd
*, arelent
*, Elf32_Internal_Rela
*));
68 static boolean mips_elf_sym_is_global
PARAMS ((bfd
*, asymbol
*));
69 static boolean mips_elf32_object_p
PARAMS ((bfd
*));
70 static boolean mips_elf_is_local_label_name
71 PARAMS ((bfd
*, const char *));
72 static bfd_reloc_status_type mips16_jump_reloc
73 PARAMS ((bfd
*, arelent
*, asymbol
*, PTR
, asection
*, bfd
*, char **));
74 static bfd_reloc_status_type mips16_gprel_reloc
75 PARAMS ((bfd
*, arelent
*, asymbol
*, PTR
, asection
*, bfd
*, char **));
76 static bfd_reloc_status_type mips_elf_final_gp
77 PARAMS ((bfd
*, asymbol
*, boolean
, char **, bfd_vma
*));
78 static boolean mips_elf_assign_gp
PARAMS ((bfd
*, bfd_vma
*));
79 static boolean elf32_mips_grok_prstatus
80 PARAMS ((bfd
*, Elf_Internal_Note
*));
81 static boolean elf32_mips_grok_psinfo
82 PARAMS ((bfd
*, Elf_Internal_Note
*));
83 static boolean elf32_mips_discard_info
84 PARAMS ((bfd
*, struct elf_reloc_cookie
*, struct bfd_link_info
*));
85 static boolean elf32_mips_ignore_discarded_relocs
86 PARAMS ((asection
*));
87 static boolean elf32_mips_write_section
88 PARAMS ((bfd
*, asection
*, bfd_byte
*));
89 static irix_compat_t elf32_mips_irix_compat
92 extern const bfd_target bfd_elf32_bigmips_vec
;
93 extern const bfd_target bfd_elf32_littlemips_vec
;
95 /* Nonzero if ABFD is using the N32 ABI. */
96 #define ABI_N32_P(abfd) \
97 ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0)
99 /* Whether we are trying to be compatible with IRIX at all. */
100 #define SGI_COMPAT(abfd) \
101 (elf32_mips_irix_compat (abfd) != ict_none)
103 /* The number of local .got entries we reserve. */
104 #define MIPS_RESERVED_GOTNO (2)
106 /* In case we're on a 32-bit machine, construct a 64-bit "-1" value
107 from smaller values. Start with zero, widen, *then* decrement. */
108 #define MINUS_ONE (((bfd_vma)0) - 1)
110 /* The relocation table used for SHT_REL sections. */
112 static reloc_howto_type elf_mips_howto_table_rel
[] =
115 HOWTO (R_MIPS_NONE
, /* type */
117 0, /* size (0 = byte, 1 = short, 2 = long) */
119 false, /* pc_relative */
121 complain_overflow_dont
, /* complain_on_overflow */
122 bfd_elf_generic_reloc
, /* special_function */
123 "R_MIPS_NONE", /* name */
124 false, /* partial_inplace */
127 false), /* pcrel_offset */
129 /* 16 bit relocation. */
130 HOWTO (R_MIPS_16
, /* type */
132 2, /* size (0 = byte, 1 = short, 2 = long) */
134 false, /* pc_relative */
136 complain_overflow_signed
, /* complain_on_overflow */
137 bfd_elf_generic_reloc
, /* special_function */
138 "R_MIPS_16", /* name */
139 true, /* partial_inplace */
140 0x0000ffff, /* src_mask */
141 0x0000ffff, /* dst_mask */
142 false), /* pcrel_offset */
144 /* 32 bit relocation. */
145 HOWTO (R_MIPS_32
, /* type */
147 2, /* size (0 = byte, 1 = short, 2 = long) */
149 false, /* pc_relative */
151 complain_overflow_dont
, /* complain_on_overflow */
152 bfd_elf_generic_reloc
, /* special_function */
153 "R_MIPS_32", /* name */
154 true, /* partial_inplace */
155 0xffffffff, /* src_mask */
156 0xffffffff, /* dst_mask */
157 false), /* pcrel_offset */
159 /* 32 bit symbol relative relocation. */
160 HOWTO (R_MIPS_REL32
, /* type */
162 2, /* size (0 = byte, 1 = short, 2 = long) */
164 false, /* pc_relative */
166 complain_overflow_dont
, /* complain_on_overflow */
167 bfd_elf_generic_reloc
, /* special_function */
168 "R_MIPS_REL32", /* name */
169 true, /* partial_inplace */
170 0xffffffff, /* src_mask */
171 0xffffffff, /* dst_mask */
172 false), /* pcrel_offset */
174 /* 26 bit jump address. */
175 HOWTO (R_MIPS_26
, /* type */
177 2, /* size (0 = byte, 1 = short, 2 = long) */
179 false, /* pc_relative */
181 complain_overflow_dont
, /* complain_on_overflow */
182 /* This needs complex overflow
183 detection, because the upper four
184 bits must match the PC + 4. */
185 bfd_elf_generic_reloc
, /* special_function */
186 "R_MIPS_26", /* name */
187 true, /* partial_inplace */
188 0x03ffffff, /* src_mask */
189 0x03ffffff, /* dst_mask */
190 false), /* pcrel_offset */
192 /* High 16 bits of symbol value. */
193 HOWTO (R_MIPS_HI16
, /* type */
195 2, /* size (0 = byte, 1 = short, 2 = long) */
197 false, /* pc_relative */
199 complain_overflow_dont
, /* complain_on_overflow */
200 mips_elf_hi16_reloc
, /* special_function */
201 "R_MIPS_HI16", /* name */
202 true, /* partial_inplace */
203 0x0000ffff, /* src_mask */
204 0x0000ffff, /* dst_mask */
205 false), /* pcrel_offset */
207 /* Low 16 bits of symbol value. */
208 HOWTO (R_MIPS_LO16
, /* type */
210 2, /* size (0 = byte, 1 = short, 2 = long) */
212 false, /* pc_relative */
214 complain_overflow_dont
, /* complain_on_overflow */
215 mips_elf_lo16_reloc
, /* special_function */
216 "R_MIPS_LO16", /* name */
217 true, /* partial_inplace */
218 0x0000ffff, /* src_mask */
219 0x0000ffff, /* dst_mask */
220 false), /* pcrel_offset */
222 /* GP relative reference. */
223 HOWTO (R_MIPS_GPREL16
, /* type */
225 2, /* size (0 = byte, 1 = short, 2 = long) */
227 false, /* pc_relative */
229 complain_overflow_signed
, /* complain_on_overflow */
230 _bfd_mips_elf32_gprel16_reloc
, /* special_function */
231 "R_MIPS_GPREL16", /* name */
232 true, /* partial_inplace */
233 0x0000ffff, /* src_mask */
234 0x0000ffff, /* dst_mask */
235 false), /* pcrel_offset */
237 /* Reference to literal section. */
238 HOWTO (R_MIPS_LITERAL
, /* type */
240 2, /* size (0 = byte, 1 = short, 2 = long) */
242 false, /* pc_relative */
244 complain_overflow_signed
, /* complain_on_overflow */
245 _bfd_mips_elf32_gprel16_reloc
, /* special_function */
246 "R_MIPS_LITERAL", /* name */
247 true, /* partial_inplace */
248 0x0000ffff, /* src_mask */
249 0x0000ffff, /* dst_mask */
250 false), /* pcrel_offset */
252 /* Reference to global offset table. */
253 HOWTO (R_MIPS_GOT16
, /* type */
255 2, /* size (0 = byte, 1 = short, 2 = long) */
257 false, /* pc_relative */
259 complain_overflow_signed
, /* complain_on_overflow */
260 mips_elf_got16_reloc
, /* special_function */
261 "R_MIPS_GOT16", /* name */
262 true, /* partial_inplace */
263 0x0000ffff, /* src_mask */
264 0x0000ffff, /* dst_mask */
265 false), /* pcrel_offset */
267 /* 16 bit PC relative reference. */
268 HOWTO (R_MIPS_PC16
, /* type */
270 2, /* size (0 = byte, 1 = short, 2 = long) */
272 true, /* pc_relative */
274 complain_overflow_signed
, /* complain_on_overflow */
275 bfd_elf_generic_reloc
, /* special_function */
276 "R_MIPS_PC16", /* name */
277 true, /* partial_inplace */
278 0x0000ffff, /* src_mask */
279 0x0000ffff, /* dst_mask */
280 true), /* pcrel_offset */
282 /* 16 bit call through global offset table. */
283 HOWTO (R_MIPS_CALL16
, /* type */
285 2, /* size (0 = byte, 1 = short, 2 = long) */
287 false, /* pc_relative */
289 complain_overflow_signed
, /* complain_on_overflow */
290 bfd_elf_generic_reloc
, /* special_function */
291 "R_MIPS_CALL16", /* name */
292 true, /* partial_inplace */
293 0x0000ffff, /* src_mask */
294 0x0000ffff, /* dst_mask */
295 false), /* pcrel_offset */
297 /* 32 bit GP relative reference. */
298 HOWTO (R_MIPS_GPREL32
, /* type */
300 2, /* size (0 = byte, 1 = short, 2 = long) */
302 false, /* pc_relative */
304 complain_overflow_dont
, /* complain_on_overflow */
305 mips_elf_gprel32_reloc
, /* special_function */
306 "R_MIPS_GPREL32", /* name */
307 true, /* partial_inplace */
308 0xffffffff, /* src_mask */
309 0xffffffff, /* dst_mask */
310 false), /* pcrel_offset */
312 /* The remaining relocs are defined on Irix 5, although they are
313 not defined by the ABI. */
318 /* A 5 bit shift field. */
319 HOWTO (R_MIPS_SHIFT5
, /* type */
321 2, /* size (0 = byte, 1 = short, 2 = long) */
323 false, /* pc_relative */
325 complain_overflow_bitfield
, /* complain_on_overflow */
326 bfd_elf_generic_reloc
, /* special_function */
327 "R_MIPS_SHIFT5", /* name */
328 true, /* partial_inplace */
329 0x000007c0, /* src_mask */
330 0x000007c0, /* dst_mask */
331 false), /* pcrel_offset */
333 /* A 6 bit shift field. */
334 /* FIXME: This is not handled correctly; a special function is
335 needed to put the most significant bit in the right place. */
336 HOWTO (R_MIPS_SHIFT6
, /* type */
338 2, /* size (0 = byte, 1 = short, 2 = long) */
340 false, /* pc_relative */
342 complain_overflow_bitfield
, /* complain_on_overflow */
343 bfd_elf_generic_reloc
, /* special_function */
344 "R_MIPS_SHIFT6", /* name */
345 true, /* partial_inplace */
346 0x000007c4, /* src_mask */
347 0x000007c4, /* dst_mask */
348 false), /* pcrel_offset */
350 /* A 64 bit relocation. */
351 HOWTO (R_MIPS_64
, /* type */
353 4, /* size (0 = byte, 1 = short, 2 = long) */
355 false, /* pc_relative */
357 complain_overflow_dont
, /* complain_on_overflow */
358 mips32_64bit_reloc
, /* special_function */
359 "R_MIPS_64", /* name */
360 true, /* partial_inplace */
361 MINUS_ONE
, /* src_mask */
362 MINUS_ONE
, /* dst_mask */
363 false), /* pcrel_offset */
365 /* Displacement in the global offset table. */
366 HOWTO (R_MIPS_GOT_DISP
, /* type */
368 2, /* size (0 = byte, 1 = short, 2 = long) */
370 false, /* pc_relative */
372 complain_overflow_signed
, /* complain_on_overflow */
373 bfd_elf_generic_reloc
, /* special_function */
374 "R_MIPS_GOT_DISP", /* name */
375 true, /* partial_inplace */
376 0x0000ffff, /* src_mask */
377 0x0000ffff, /* dst_mask */
378 false), /* pcrel_offset */
380 /* Displacement to page pointer in the global offset table. */
381 HOWTO (R_MIPS_GOT_PAGE
, /* type */
383 2, /* size (0 = byte, 1 = short, 2 = long) */
385 false, /* pc_relative */
387 complain_overflow_signed
, /* complain_on_overflow */
388 bfd_elf_generic_reloc
, /* special_function */
389 "R_MIPS_GOT_PAGE", /* name */
390 true, /* partial_inplace */
391 0x0000ffff, /* src_mask */
392 0x0000ffff, /* dst_mask */
393 false), /* pcrel_offset */
395 /* Offset from page pointer in the global offset table. */
396 HOWTO (R_MIPS_GOT_OFST
, /* type */
398 2, /* size (0 = byte, 1 = short, 2 = long) */
400 false, /* pc_relative */
402 complain_overflow_signed
, /* complain_on_overflow */
403 bfd_elf_generic_reloc
, /* special_function */
404 "R_MIPS_GOT_OFST", /* name */
405 true, /* partial_inplace */
406 0x0000ffff, /* src_mask */
407 0x0000ffff, /* dst_mask */
408 false), /* pcrel_offset */
410 /* High 16 bits of displacement in global offset table. */
411 HOWTO (R_MIPS_GOT_HI16
, /* type */
413 2, /* size (0 = byte, 1 = short, 2 = long) */
415 false, /* pc_relative */
417 complain_overflow_dont
, /* complain_on_overflow */
418 bfd_elf_generic_reloc
, /* special_function */
419 "R_MIPS_GOT_HI16", /* name */
420 true, /* partial_inplace */
421 0x0000ffff, /* src_mask */
422 0x0000ffff, /* dst_mask */
423 false), /* pcrel_offset */
425 /* Low 16 bits of displacement in global offset table. */
426 HOWTO (R_MIPS_GOT_LO16
, /* type */
428 2, /* size (0 = byte, 1 = short, 2 = long) */
430 false, /* pc_relative */
432 complain_overflow_dont
, /* complain_on_overflow */
433 bfd_elf_generic_reloc
, /* special_function */
434 "R_MIPS_GOT_LO16", /* name */
435 true, /* partial_inplace */
436 0x0000ffff, /* src_mask */
437 0x0000ffff, /* dst_mask */
438 false), /* pcrel_offset */
440 /* 64 bit subtraction. Used in the N32 ABI. */
441 HOWTO (R_MIPS_SUB
, /* type */
443 4, /* size (0 = byte, 1 = short, 2 = long) */
445 false, /* pc_relative */
447 complain_overflow_dont
, /* complain_on_overflow */
448 bfd_elf_generic_reloc
, /* special_function */
449 "R_MIPS_SUB", /* name */
450 true, /* partial_inplace */
451 MINUS_ONE
, /* src_mask */
452 MINUS_ONE
, /* dst_mask */
453 false), /* pcrel_offset */
455 /* Used to cause the linker to insert and delete instructions? */
456 EMPTY_HOWTO (R_MIPS_INSERT_A
),
457 EMPTY_HOWTO (R_MIPS_INSERT_B
),
458 EMPTY_HOWTO (R_MIPS_DELETE
),
460 /* Get the higher value of a 64 bit addend. */
461 HOWTO (R_MIPS_HIGHER
, /* type */
463 2, /* size (0 = byte, 1 = short, 2 = long) */
465 false, /* pc_relative */
467 complain_overflow_dont
, /* complain_on_overflow */
468 bfd_elf_generic_reloc
, /* special_function */
469 "R_MIPS_HIGHER", /* name */
470 true, /* partial_inplace */
471 0x0000ffff, /* src_mask */
472 0x0000ffff, /* dst_mask */
473 false), /* pcrel_offset */
475 /* Get the highest value of a 64 bit addend. */
476 HOWTO (R_MIPS_HIGHEST
, /* type */
478 2, /* size (0 = byte, 1 = short, 2 = long) */
480 false, /* pc_relative */
482 complain_overflow_dont
, /* complain_on_overflow */
483 bfd_elf_generic_reloc
, /* special_function */
484 "R_MIPS_HIGHEST", /* name */
485 true, /* partial_inplace */
486 0x0000ffff, /* src_mask */
487 0x0000ffff, /* dst_mask */
488 false), /* pcrel_offset */
490 /* High 16 bits of displacement in global offset table. */
491 HOWTO (R_MIPS_CALL_HI16
, /* type */
493 2, /* size (0 = byte, 1 = short, 2 = long) */
495 false, /* pc_relative */
497 complain_overflow_dont
, /* complain_on_overflow */
498 bfd_elf_generic_reloc
, /* special_function */
499 "R_MIPS_CALL_HI16", /* name */
500 true, /* partial_inplace */
501 0x0000ffff, /* src_mask */
502 0x0000ffff, /* dst_mask */
503 false), /* pcrel_offset */
505 /* Low 16 bits of displacement in global offset table. */
506 HOWTO (R_MIPS_CALL_LO16
, /* type */
508 2, /* size (0 = byte, 1 = short, 2 = long) */
510 false, /* pc_relative */
512 complain_overflow_dont
, /* complain_on_overflow */
513 bfd_elf_generic_reloc
, /* special_function */
514 "R_MIPS_CALL_LO16", /* name */
515 true, /* partial_inplace */
516 0x0000ffff, /* src_mask */
517 0x0000ffff, /* dst_mask */
518 false), /* pcrel_offset */
520 /* Section displacement. */
521 HOWTO (R_MIPS_SCN_DISP
, /* type */
523 2, /* size (0 = byte, 1 = short, 2 = long) */
525 false, /* pc_relative */
527 complain_overflow_dont
, /* complain_on_overflow */
528 bfd_elf_generic_reloc
, /* special_function */
529 "R_MIPS_SCN_DISP", /* name */
530 true, /* partial_inplace */
531 0xffffffff, /* src_mask */
532 0xffffffff, /* dst_mask */
533 false), /* pcrel_offset */
535 EMPTY_HOWTO (R_MIPS_REL16
),
536 EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE
),
537 EMPTY_HOWTO (R_MIPS_PJUMP
),
538 EMPTY_HOWTO (R_MIPS_RELGOT
),
540 /* Protected jump conversion. This is an optimization hint. No
541 relocation is required for correctness. */
542 HOWTO (R_MIPS_JALR
, /* type */
544 2, /* size (0 = byte, 1 = short, 2 = long) */
546 false, /* pc_relative */
548 complain_overflow_dont
, /* complain_on_overflow */
549 bfd_elf_generic_reloc
, /* special_function */
550 "R_MIPS_JALR", /* name */
551 false, /* partial_inplace */
552 0x00000000, /* src_mask */
553 0x00000000, /* dst_mask */
554 false), /* pcrel_offset */
557 /* The reloc used for BFD_RELOC_CTOR when doing a 64 bit link. This
558 is a hack to make the linker think that we need 64 bit values. */
559 static reloc_howto_type elf_mips_ctor64_howto
=
560 HOWTO (R_MIPS_64
, /* type */
562 4, /* size (0 = byte, 1 = short, 2 = long) */
564 false, /* pc_relative */
566 complain_overflow_signed
, /* complain_on_overflow */
567 mips32_64bit_reloc
, /* special_function */
568 "R_MIPS_64", /* name */
569 true, /* partial_inplace */
570 0xffffffff, /* src_mask */
571 0xffffffff, /* dst_mask */
572 false); /* pcrel_offset */
574 /* The reloc used for the mips16 jump instruction. */
575 static reloc_howto_type elf_mips16_jump_howto
=
576 HOWTO (R_MIPS16_26
, /* type */
578 2, /* size (0 = byte, 1 = short, 2 = long) */
580 false, /* pc_relative */
582 complain_overflow_dont
, /* complain_on_overflow */
583 /* This needs complex overflow
584 detection, because the upper four
585 bits must match the PC. */
586 mips16_jump_reloc
, /* special_function */
587 "R_MIPS16_26", /* name */
588 true, /* partial_inplace */
589 0x3ffffff, /* src_mask */
590 0x3ffffff, /* dst_mask */
591 false); /* pcrel_offset */
593 /* The reloc used for the mips16 gprel instruction. */
594 static reloc_howto_type elf_mips16_gprel_howto
=
595 HOWTO (R_MIPS16_GPREL
, /* type */
597 2, /* size (0 = byte, 1 = short, 2 = long) */
599 false, /* pc_relative */
601 complain_overflow_signed
, /* complain_on_overflow */
602 mips16_gprel_reloc
, /* special_function */
603 "R_MIPS16_GPREL", /* name */
604 true, /* partial_inplace */
605 0x07ff001f, /* src_mask */
606 0x07ff001f, /* dst_mask */
607 false); /* pcrel_offset */
609 /* GNU extensions for embedded-pic. */
610 /* High 16 bits of symbol value, pc-relative. */
611 static reloc_howto_type elf_mips_gnu_rel_hi16
=
612 HOWTO (R_MIPS_GNU_REL_HI16
, /* type */
614 2, /* size (0 = byte, 1 = short, 2 = long) */
616 true, /* pc_relative */
618 complain_overflow_dont
, /* complain_on_overflow */
619 mips_elf_hi16_reloc
, /* special_function */
620 "R_MIPS_GNU_REL_HI16", /* name */
621 true, /* partial_inplace */
622 0xffff, /* src_mask */
623 0xffff, /* dst_mask */
624 true); /* pcrel_offset */
626 /* Low 16 bits of symbol value, pc-relative. */
627 static reloc_howto_type elf_mips_gnu_rel_lo16
=
628 HOWTO (R_MIPS_GNU_REL_LO16
, /* type */
630 2, /* size (0 = byte, 1 = short, 2 = long) */
632 true, /* pc_relative */
634 complain_overflow_dont
, /* complain_on_overflow */
635 mips_elf_lo16_reloc
, /* special_function */
636 "R_MIPS_GNU_REL_LO16", /* name */
637 true, /* partial_inplace */
638 0xffff, /* src_mask */
639 0xffff, /* dst_mask */
640 true); /* pcrel_offset */
642 /* 16 bit offset for pc-relative branches. */
643 static reloc_howto_type elf_mips_gnu_rel16_s2
=
644 HOWTO (R_MIPS_GNU_REL16_S2
, /* type */
646 2, /* size (0 = byte, 1 = short, 2 = long) */
648 true, /* pc_relative */
650 complain_overflow_signed
, /* complain_on_overflow */
651 bfd_elf_generic_reloc
, /* special_function */
652 "R_MIPS_GNU_REL16_S2", /* name */
653 true, /* partial_inplace */
654 0xffff, /* src_mask */
655 0xffff, /* dst_mask */
656 true); /* pcrel_offset */
658 /* 64 bit pc-relative. */
659 static reloc_howto_type elf_mips_gnu_pcrel64
=
660 HOWTO (R_MIPS_PC64
, /* type */
662 4, /* size (0 = byte, 1 = short, 2 = long) */
664 true, /* pc_relative */
666 complain_overflow_signed
, /* complain_on_overflow */
667 bfd_elf_generic_reloc
, /* special_function */
668 "R_MIPS_PC64", /* name */
669 true, /* partial_inplace */
670 MINUS_ONE
, /* src_mask */
671 MINUS_ONE
, /* dst_mask */
672 true); /* pcrel_offset */
674 /* 32 bit pc-relative. */
675 static reloc_howto_type elf_mips_gnu_pcrel32
=
676 HOWTO (R_MIPS_PC32
, /* type */
678 2, /* size (0 = byte, 1 = short, 2 = long) */
680 true, /* pc_relative */
682 complain_overflow_signed
, /* complain_on_overflow */
683 bfd_elf_generic_reloc
, /* special_function */
684 "R_MIPS_PC32", /* name */
685 true, /* partial_inplace */
686 0xffffffff, /* src_mask */
687 0xffffffff, /* dst_mask */
688 true); /* pcrel_offset */
690 /* GNU extension to record C++ vtable hierarchy */
691 static reloc_howto_type elf_mips_gnu_vtinherit_howto
=
692 HOWTO (R_MIPS_GNU_VTINHERIT
, /* type */
694 2, /* size (0 = byte, 1 = short, 2 = long) */
696 false, /* pc_relative */
698 complain_overflow_dont
, /* complain_on_overflow */
699 NULL
, /* special_function */
700 "R_MIPS_GNU_VTINHERIT", /* name */
701 false, /* partial_inplace */
704 false); /* pcrel_offset */
706 /* GNU extension to record C++ vtable member usage */
707 static reloc_howto_type elf_mips_gnu_vtentry_howto
=
708 HOWTO (R_MIPS_GNU_VTENTRY
, /* type */
710 2, /* size (0 = byte, 1 = short, 2 = long) */
712 false, /* pc_relative */
714 complain_overflow_dont
, /* complain_on_overflow */
715 _bfd_elf_rel_vtable_reloc_fn
, /* special_function */
716 "R_MIPS_GNU_VTENTRY", /* name */
717 false, /* partial_inplace */
720 false); /* pcrel_offset */
722 /* Do a R_MIPS_HI16 relocation. This has to be done in combination
723 with a R_MIPS_LO16 reloc, because there is a carry from the LO16 to
724 the HI16. Here we just save the information we need; we do the
725 actual relocation when we see the LO16.
727 MIPS ELF requires that the LO16 immediately follow the HI16. As a
728 GNU extension, for non-pc-relative relocations, we permit an
729 arbitrary number of HI16 relocs to be associated with a single LO16
730 reloc. This extension permits gcc to output the HI and LO relocs
733 This cannot be done for PC-relative relocations because both the HI16
734 and LO16 parts of the relocations must be done relative to the LO16
735 part, and there can be carry to or borrow from the HI16 part. */
739 struct mips_hi16
*next
;
744 /* FIXME: This should not be a static variable. */
746 static struct mips_hi16
*mips_hi16_list
;
748 static bfd_reloc_status_type
749 mips_elf_hi16_reloc (abfd
, reloc_entry
, symbol
, data
, input_section
,
750 output_bfd
, error_message
)
751 bfd
*abfd ATTRIBUTE_UNUSED
;
752 arelent
*reloc_entry
;
755 asection
*input_section
;
757 char **error_message
;
759 bfd_reloc_status_type ret
;
763 /* If we're relocating, and this is an external symbol, we don't want
764 to change anything. */
765 if (output_bfd
!= (bfd
*) NULL
766 && (symbol
->flags
& BSF_SECTION_SYM
) == 0
767 && reloc_entry
->addend
== 0)
769 reloc_entry
->address
+= input_section
->output_offset
;
775 if (strcmp (bfd_asymbol_name (symbol
), "_gp_disp") == 0)
777 boolean relocateable
;
780 if (ret
== bfd_reloc_undefined
)
783 if (output_bfd
!= NULL
)
787 relocateable
= false;
788 output_bfd
= symbol
->section
->output_section
->owner
;
791 ret
= mips_elf_final_gp (output_bfd
, symbol
, relocateable
,
793 if (ret
!= bfd_reloc_ok
)
796 relocation
= gp
- reloc_entry
->address
;
800 if (bfd_is_und_section (symbol
->section
)
801 && output_bfd
== (bfd
*) NULL
)
802 ret
= bfd_reloc_undefined
;
804 if (bfd_is_com_section (symbol
->section
))
807 relocation
= symbol
->value
;
810 relocation
+= symbol
->section
->output_section
->vma
;
811 relocation
+= symbol
->section
->output_offset
;
812 relocation
+= reloc_entry
->addend
;
814 if (reloc_entry
->address
> input_section
->_cooked_size
)
815 return bfd_reloc_outofrange
;
817 /* Save the information, and let LO16 do the actual relocation. */
818 n
= (struct mips_hi16
*) bfd_malloc ((bfd_size_type
) sizeof *n
);
820 return bfd_reloc_outofrange
;
821 n
->addr
= (bfd_byte
*) data
+ reloc_entry
->address
;
822 n
->addend
= relocation
;
823 n
->next
= mips_hi16_list
;
826 if (output_bfd
!= (bfd
*) NULL
)
827 reloc_entry
->address
+= input_section
->output_offset
;
832 /* Do a R_MIPS_LO16 relocation. This is a straightforward 16 bit
833 inplace relocation; this function exists in order to do the
834 R_MIPS_HI16 relocation described above. */
836 static bfd_reloc_status_type
837 mips_elf_lo16_reloc (abfd
, reloc_entry
, symbol
, data
, input_section
,
838 output_bfd
, error_message
)
840 arelent
*reloc_entry
;
843 asection
*input_section
;
845 char **error_message
;
847 arelent gp_disp_relent
;
849 if (mips_hi16_list
!= NULL
)
859 struct mips_hi16
*next
;
861 /* Do the HI16 relocation. Note that we actually don't need
862 to know anything about the LO16 itself, except where to
863 find the low 16 bits of the addend needed by the LO16. */
864 insn
= bfd_get_32 (abfd
, l
->addr
);
865 vallo
= bfd_get_32 (abfd
, (bfd_byte
*) data
+ reloc_entry
->address
);
867 /* The low order 16 bits are always treated as a signed
869 vallo
= ((vallo
& 0xffff) ^ 0x8000) - 0x8000;
870 val
= ((insn
& 0xffff) << 16) + vallo
;
873 /* If PC-relative, we need to subtract out the address of the LO
874 half of the HI/LO. (The actual relocation is relative
875 to that instruction.) */
876 if (reloc_entry
->howto
->pc_relative
)
877 val
-= reloc_entry
->address
;
879 /* At this point, "val" has the value of the combined HI/LO
880 pair. If the low order 16 bits (which will be used for
881 the LO16 insn) are negative, then we will need an
882 adjustment for the high order 16 bits. */
884 val
= (val
>> 16) & 0xffff;
886 insn
&= ~ (bfd_vma
) 0xffff;
888 bfd_put_32 (abfd
, (bfd_vma
) insn
, l
->addr
);
890 if (strcmp (bfd_asymbol_name (symbol
), "_gp_disp") == 0)
892 gp_disp_relent
= *reloc_entry
;
893 reloc_entry
= &gp_disp_relent
;
894 reloc_entry
->addend
= l
->addend
;
902 mips_hi16_list
= NULL
;
904 else if (strcmp (bfd_asymbol_name (symbol
), "_gp_disp") == 0)
906 bfd_reloc_status_type ret
;
907 bfd_vma gp
, relocation
;
909 /* FIXME: Does this case ever occur? */
911 ret
= mips_elf_final_gp (output_bfd
, symbol
, true, error_message
, &gp
);
912 if (ret
!= bfd_reloc_ok
)
915 relocation
= gp
- reloc_entry
->address
;
916 relocation
+= symbol
->section
->output_section
->vma
;
917 relocation
+= symbol
->section
->output_offset
;
918 relocation
+= reloc_entry
->addend
;
920 if (reloc_entry
->address
> input_section
->_cooked_size
)
921 return bfd_reloc_outofrange
;
923 gp_disp_relent
= *reloc_entry
;
924 reloc_entry
= &gp_disp_relent
;
925 reloc_entry
->addend
= relocation
- 4;
928 /* Now do the LO16 reloc in the usual way. */
929 return bfd_elf_generic_reloc (abfd
, reloc_entry
, symbol
, data
,
930 input_section
, output_bfd
, error_message
);
933 /* Do a R_MIPS_GOT16 reloc. This is a reloc against the global offset
934 table used for PIC code. If the symbol is an external symbol, the
935 instruction is modified to contain the offset of the appropriate
936 entry in the global offset table. If the symbol is a section
937 symbol, the next reloc is a R_MIPS_LO16 reloc. The two 16 bit
938 addends are combined to form the real addend against the section
939 symbol; the GOT16 is modified to contain the offset of an entry in
940 the global offset table, and the LO16 is modified to offset it
941 appropriately. Thus an offset larger than 16 bits requires a
942 modified value in the global offset table.
944 This implementation suffices for the assembler, but the linker does
945 not yet know how to create global offset tables. */
947 static bfd_reloc_status_type
948 mips_elf_got16_reloc (abfd
, reloc_entry
, symbol
, data
, input_section
,
949 output_bfd
, error_message
)
951 arelent
*reloc_entry
;
954 asection
*input_section
;
956 char **error_message
;
958 /* If we're relocating, and this is an external symbol, we don't want
959 to change anything. */
960 if (output_bfd
!= (bfd
*) NULL
961 && (symbol
->flags
& BSF_SECTION_SYM
) == 0
962 && reloc_entry
->addend
== 0)
964 reloc_entry
->address
+= input_section
->output_offset
;
968 /* If we're relocating, and this is a local symbol, we can handle it
970 if (output_bfd
!= (bfd
*) NULL
971 && (symbol
->flags
& BSF_SECTION_SYM
) != 0)
972 return mips_elf_hi16_reloc (abfd
, reloc_entry
, symbol
, data
,
973 input_section
, output_bfd
, error_message
);
978 /* Set the GP value for OUTPUT_BFD. Returns false if this is a
979 dangerous relocation. */
982 mips_elf_assign_gp (output_bfd
, pgp
)
990 /* If we've already figured out what GP will be, just return it. */
991 *pgp
= _bfd_get_gp_value (output_bfd
);
995 count
= bfd_get_symcount (output_bfd
);
996 sym
= bfd_get_outsymbols (output_bfd
);
998 /* The linker script will have created a symbol named `_gp' with the
999 appropriate value. */
1000 if (sym
== (asymbol
**) NULL
)
1004 for (i
= 0; i
< count
; i
++, sym
++)
1006 register const char *name
;
1008 name
= bfd_asymbol_name (*sym
);
1009 if (*name
== '_' && strcmp (name
, "_gp") == 0)
1011 *pgp
= bfd_asymbol_value (*sym
);
1012 _bfd_set_gp_value (output_bfd
, *pgp
);
1020 /* Only get the error once. */
1022 _bfd_set_gp_value (output_bfd
, *pgp
);
1029 /* We have to figure out the gp value, so that we can adjust the
1030 symbol value correctly. We look up the symbol _gp in the output
1031 BFD. If we can't find it, we're stuck. We cache it in the ELF
1032 target data. We don't need to adjust the symbol value for an
1033 external symbol if we are producing relocateable output. */
1035 static bfd_reloc_status_type
1036 mips_elf_final_gp (output_bfd
, symbol
, relocateable
, error_message
, pgp
)
1039 boolean relocateable
;
1040 char **error_message
;
1043 if (bfd_is_und_section (symbol
->section
)
1047 return bfd_reloc_undefined
;
1050 *pgp
= _bfd_get_gp_value (output_bfd
);
1053 || (symbol
->flags
& BSF_SECTION_SYM
) != 0))
1057 /* Make up a value. */
1058 *pgp
= symbol
->section
->output_section
->vma
+ 0x4000;
1059 _bfd_set_gp_value (output_bfd
, *pgp
);
1061 else if (!mips_elf_assign_gp (output_bfd
, pgp
))
1064 (char *) _("GP relative relocation when _gp not defined");
1065 return bfd_reloc_dangerous
;
1069 return bfd_reloc_ok
;
1072 /* Do a R_MIPS_GPREL16 relocation. This is a 16 bit value which must
1073 become the offset from the gp register. This function also handles
1074 R_MIPS_LITERAL relocations, although those can be handled more
1075 cleverly because the entries in the .lit8 and .lit4 sections can be
1078 bfd_reloc_status_type
1079 _bfd_mips_elf32_gprel16_reloc (abfd
, reloc_entry
, symbol
, data
, input_section
,
1080 output_bfd
, error_message
)
1082 arelent
*reloc_entry
;
1085 asection
*input_section
;
1087 char **error_message
;
1089 boolean relocateable
;
1090 bfd_reloc_status_type ret
;
1093 /* If we're relocating, and this is an external symbol with no
1094 addend, we don't want to change anything. We will only have an
1095 addend if this is a newly created reloc, not read from an ELF
1097 if (output_bfd
!= (bfd
*) NULL
1098 && (symbol
->flags
& BSF_SECTION_SYM
) == 0
1099 && reloc_entry
->addend
== 0)
1101 reloc_entry
->address
+= input_section
->output_offset
;
1102 return bfd_reloc_ok
;
1105 if (output_bfd
!= (bfd
*) NULL
)
1106 relocateable
= true;
1109 relocateable
= false;
1110 output_bfd
= symbol
->section
->output_section
->owner
;
1113 ret
= mips_elf_final_gp (output_bfd
, symbol
, relocateable
, error_message
,
1115 if (ret
!= bfd_reloc_ok
)
1118 return _bfd_mips_elf_gprel16_with_gp (abfd
, symbol
, reloc_entry
,
1119 input_section
, relocateable
,
1123 /* Do a R_MIPS_GPREL32 relocation. This is a 32 bit value which must
1124 become the offset from the gp register. */
1126 static bfd_reloc_status_type gprel32_with_gp
PARAMS ((bfd
*, asymbol
*,
1127 arelent
*, asection
*,
1128 boolean
, PTR
, bfd_vma
));
1130 static bfd_reloc_status_type
1131 mips_elf_gprel32_reloc (abfd
, reloc_entry
, symbol
, data
, input_section
,
1132 output_bfd
, error_message
)
1134 arelent
*reloc_entry
;
1137 asection
*input_section
;
1139 char **error_message
;
1141 boolean relocateable
;
1142 bfd_reloc_status_type ret
;
1145 /* If we're relocating, and this is an external symbol with no
1146 addend, we don't want to change anything. We will only have an
1147 addend if this is a newly created reloc, not read from an ELF
1149 if (output_bfd
!= (bfd
*) NULL
1150 && (symbol
->flags
& BSF_SECTION_SYM
) == 0
1151 && reloc_entry
->addend
== 0)
1153 *error_message
= (char *)
1154 _("32bits gp relative relocation occurs for an external symbol");
1155 return bfd_reloc_outofrange
;
1158 if (output_bfd
!= (bfd
*) NULL
)
1160 relocateable
= true;
1161 gp
= _bfd_get_gp_value (output_bfd
);
1165 relocateable
= false;
1166 output_bfd
= symbol
->section
->output_section
->owner
;
1168 ret
= mips_elf_final_gp (output_bfd
, symbol
, relocateable
,
1169 error_message
, &gp
);
1170 if (ret
!= bfd_reloc_ok
)
1174 return gprel32_with_gp (abfd
, symbol
, reloc_entry
, input_section
,
1175 relocateable
, data
, gp
);
1178 static bfd_reloc_status_type
1179 gprel32_with_gp (abfd
, symbol
, reloc_entry
, input_section
, relocateable
, data
,
1183 arelent
*reloc_entry
;
1184 asection
*input_section
;
1185 boolean relocateable
;
1192 if (bfd_is_com_section (symbol
->section
))
1195 relocation
= symbol
->value
;
1197 relocation
+= symbol
->section
->output_section
->vma
;
1198 relocation
+= symbol
->section
->output_offset
;
1200 if (reloc_entry
->address
> input_section
->_cooked_size
)
1201 return bfd_reloc_outofrange
;
1203 if (reloc_entry
->howto
->src_mask
== 0)
1205 /* This case arises with the 64-bit MIPS ELF ABI. */
1209 val
= bfd_get_32 (abfd
, (bfd_byte
*) data
+ reloc_entry
->address
);
1211 /* Set val to the offset into the section or symbol. */
1212 val
+= reloc_entry
->addend
;
1214 /* Adjust val for the final section location and GP value. If we
1215 are producing relocateable output, we don't want to do this for
1216 an external symbol. */
1218 || (symbol
->flags
& BSF_SECTION_SYM
) != 0)
1219 val
+= relocation
- gp
;
1221 bfd_put_32 (abfd
, (bfd_vma
) val
, (bfd_byte
*) data
+ reloc_entry
->address
);
1224 reloc_entry
->address
+= input_section
->output_offset
;
1226 return bfd_reloc_ok
;
1229 /* Handle a 64 bit reloc in a 32 bit MIPS ELF file. These are
1230 generated when addresses are 64 bits. The upper 32 bits are a simple
1233 static bfd_reloc_status_type
1234 mips32_64bit_reloc (abfd
, reloc_entry
, symbol
, data
, input_section
,
1235 output_bfd
, error_message
)
1237 arelent
*reloc_entry
;
1240 asection
*input_section
;
1242 char **error_message
;
1244 bfd_reloc_status_type r
;
1249 r
= bfd_elf_generic_reloc (abfd
, reloc_entry
, symbol
, data
,
1250 input_section
, output_bfd
, error_message
);
1251 if (r
!= bfd_reloc_continue
)
1254 /* Do a normal 32 bit relocation on the lower 32 bits. */
1255 reloc32
= *reloc_entry
;
1256 if (bfd_big_endian (abfd
))
1257 reloc32
.address
+= 4;
1258 reloc32
.howto
= &elf_mips_howto_table_rel
[R_MIPS_32
];
1259 r
= bfd_perform_relocation (abfd
, &reloc32
, data
, input_section
,
1260 output_bfd
, error_message
);
1262 /* Sign extend into the upper 32 bits. */
1263 val
= bfd_get_32 (abfd
, (bfd_byte
*) data
+ reloc32
.address
);
1264 if ((val
& 0x80000000) != 0)
1268 addr
= reloc_entry
->address
;
1269 if (bfd_little_endian (abfd
))
1271 bfd_put_32 (abfd
, (bfd_vma
) val
, (bfd_byte
*) data
+ addr
);
1276 /* Handle a mips16 jump. */
1278 static bfd_reloc_status_type
1279 mips16_jump_reloc (abfd
, reloc_entry
, symbol
, data
, input_section
,
1280 output_bfd
, error_message
)
1281 bfd
*abfd ATTRIBUTE_UNUSED
;
1282 arelent
*reloc_entry
;
1284 PTR data ATTRIBUTE_UNUSED
;
1285 asection
*input_section
;
1287 char **error_message ATTRIBUTE_UNUSED
;
1289 if (output_bfd
!= (bfd
*) NULL
1290 && (symbol
->flags
& BSF_SECTION_SYM
) == 0
1291 && reloc_entry
->addend
== 0)
1293 reloc_entry
->address
+= input_section
->output_offset
;
1294 return bfd_reloc_ok
;
1299 static boolean warned
;
1302 (*_bfd_error_handler
)
1303 (_("Linking mips16 objects into %s format is not supported"),
1304 bfd_get_target (input_section
->output_section
->owner
));
1308 return bfd_reloc_undefined
;
1311 /* Handle a mips16 GP relative reloc. */
1313 static bfd_reloc_status_type
1314 mips16_gprel_reloc (abfd
, reloc_entry
, symbol
, data
, input_section
,
1315 output_bfd
, error_message
)
1317 arelent
*reloc_entry
;
1320 asection
*input_section
;
1322 char **error_message
;
1324 boolean relocateable
;
1325 bfd_reloc_status_type ret
;
1327 unsigned short extend
, insn
;
1328 unsigned long final
;
1330 /* If we're relocating, and this is an external symbol with no
1331 addend, we don't want to change anything. We will only have an
1332 addend if this is a newly created reloc, not read from an ELF
1334 if (output_bfd
!= NULL
1335 && (symbol
->flags
& BSF_SECTION_SYM
) == 0
1336 && reloc_entry
->addend
== 0)
1338 reloc_entry
->address
+= input_section
->output_offset
;
1339 return bfd_reloc_ok
;
1342 if (output_bfd
!= NULL
)
1343 relocateable
= true;
1346 relocateable
= false;
1347 output_bfd
= symbol
->section
->output_section
->owner
;
1350 ret
= mips_elf_final_gp (output_bfd
, symbol
, relocateable
, error_message
,
1352 if (ret
!= bfd_reloc_ok
)
1355 if (reloc_entry
->address
> input_section
->_cooked_size
)
1356 return bfd_reloc_outofrange
;
1358 /* Pick up the mips16 extend instruction and the real instruction. */
1359 extend
= bfd_get_16 (abfd
, (bfd_byte
*) data
+ reloc_entry
->address
);
1360 insn
= bfd_get_16 (abfd
, (bfd_byte
*) data
+ reloc_entry
->address
+ 2);
1362 /* Stuff the current addend back as a 32 bit value, do the usual
1363 relocation, and then clean up. */
1365 (bfd_vma
) (((extend
& 0x1f) << 11)
1368 (bfd_byte
*) data
+ reloc_entry
->address
);
1370 ret
= _bfd_mips_elf_gprel16_with_gp (abfd
, symbol
, reloc_entry
,
1371 input_section
, relocateable
, data
, gp
);
1373 final
= bfd_get_32 (abfd
, (bfd_byte
*) data
+ reloc_entry
->address
);
1375 (bfd_vma
) ((extend
& 0xf800)
1376 | ((final
>> 11) & 0x1f)
1378 (bfd_byte
*) data
+ reloc_entry
->address
);
1380 (bfd_vma
) ((insn
& 0xffe0)
1382 (bfd_byte
*) data
+ reloc_entry
->address
+ 2);
1387 /* A mapping from BFD reloc types to MIPS ELF reloc types. */
1389 struct elf_reloc_map
{
1390 bfd_reloc_code_real_type bfd_val
;
1391 enum elf_mips_reloc_type elf_val
;
1394 static const struct elf_reloc_map mips_reloc_map
[] =
1396 { BFD_RELOC_NONE
, R_MIPS_NONE
, },
1397 { BFD_RELOC_16
, R_MIPS_16
},
1398 { BFD_RELOC_32
, R_MIPS_32
},
1399 /* There is no BFD reloc for R_MIPS_REL32. */
1400 { BFD_RELOC_64
, R_MIPS_64
},
1401 { BFD_RELOC_MIPS_JMP
, R_MIPS_26
},
1402 { BFD_RELOC_HI16_S
, R_MIPS_HI16
},
1403 { BFD_RELOC_LO16
, R_MIPS_LO16
},
1404 { BFD_RELOC_GPREL16
, R_MIPS_GPREL16
},
1405 { BFD_RELOC_MIPS_LITERAL
, R_MIPS_LITERAL
},
1406 { BFD_RELOC_MIPS_GOT16
, R_MIPS_GOT16
},
1407 { BFD_RELOC_16_PCREL
, R_MIPS_PC16
},
1408 { BFD_RELOC_MIPS_CALL16
, R_MIPS_CALL16
},
1409 { BFD_RELOC_GPREL32
, R_MIPS_GPREL32
},
1410 { BFD_RELOC_MIPS_GOT_HI16
, R_MIPS_GOT_HI16
},
1411 { BFD_RELOC_MIPS_GOT_LO16
, R_MIPS_GOT_LO16
},
1412 { BFD_RELOC_MIPS_CALL_HI16
, R_MIPS_CALL_HI16
},
1413 { BFD_RELOC_MIPS_CALL_LO16
, R_MIPS_CALL_LO16
},
1414 { BFD_RELOC_MIPS_SUB
, R_MIPS_SUB
},
1415 { BFD_RELOC_MIPS_GOT_PAGE
, R_MIPS_GOT_PAGE
},
1416 { BFD_RELOC_MIPS_GOT_OFST
, R_MIPS_GOT_OFST
},
1417 { BFD_RELOC_MIPS_GOT_DISP
, R_MIPS_GOT_DISP
}
1420 /* Given a BFD reloc type, return a howto structure. */
1422 static reloc_howto_type
*
1423 bfd_elf32_bfd_reloc_type_lookup (abfd
, code
)
1425 bfd_reloc_code_real_type code
;
1428 reloc_howto_type
*howto_table
= elf_mips_howto_table_rel
;
1430 for (i
= 0; i
< sizeof (mips_reloc_map
) / sizeof (struct elf_reloc_map
);
1433 if (mips_reloc_map
[i
].bfd_val
== code
)
1434 return &howto_table
[(int) mips_reloc_map
[i
].elf_val
];
1440 bfd_set_error (bfd_error_bad_value
);
1443 case BFD_RELOC_CTOR
:
1444 /* We need to handle BFD_RELOC_CTOR specially.
1445 Select the right relocation (R_MIPS_32 or R_MIPS_64) based on the
1446 size of addresses on this architecture. */
1447 if (bfd_arch_bits_per_address (abfd
) == 32)
1448 return &howto_table
[(int) R_MIPS_32
];
1450 return &elf_mips_ctor64_howto
;
1452 case BFD_RELOC_MIPS16_JMP
:
1453 return &elf_mips16_jump_howto
;
1454 case BFD_RELOC_MIPS16_GPREL
:
1455 return &elf_mips16_gprel_howto
;
1456 case BFD_RELOC_VTABLE_INHERIT
:
1457 return &elf_mips_gnu_vtinherit_howto
;
1458 case BFD_RELOC_VTABLE_ENTRY
:
1459 return &elf_mips_gnu_vtentry_howto
;
1460 case BFD_RELOC_PCREL_HI16_S
:
1461 return &elf_mips_gnu_rel_hi16
;
1462 case BFD_RELOC_PCREL_LO16
:
1463 return &elf_mips_gnu_rel_lo16
;
1464 case BFD_RELOC_16_PCREL_S2
:
1465 return &elf_mips_gnu_rel16_s2
;
1466 case BFD_RELOC_64_PCREL
:
1467 return &elf_mips_gnu_pcrel64
;
1468 case BFD_RELOC_32_PCREL
:
1469 return &elf_mips_gnu_pcrel32
;
1473 /* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */
1475 static reloc_howto_type
*
1476 mips_elf32_rtype_to_howto (r_type
, rela_p
)
1477 unsigned int r_type
;
1478 boolean rela_p ATTRIBUTE_UNUSED
;
1483 return &elf_mips16_jump_howto
;
1484 case R_MIPS16_GPREL
:
1485 return &elf_mips16_gprel_howto
;
1486 case R_MIPS_GNU_VTINHERIT
:
1487 return &elf_mips_gnu_vtinherit_howto
;
1488 case R_MIPS_GNU_VTENTRY
:
1489 return &elf_mips_gnu_vtentry_howto
;
1490 case R_MIPS_GNU_REL_HI16
:
1491 return &elf_mips_gnu_rel_hi16
;
1492 case R_MIPS_GNU_REL_LO16
:
1493 return &elf_mips_gnu_rel_lo16
;
1494 case R_MIPS_GNU_REL16_S2
:
1495 return &elf_mips_gnu_rel16_s2
;
1497 return &elf_mips_gnu_pcrel64
;
1499 return &elf_mips_gnu_pcrel32
;
1501 BFD_ASSERT (r_type
< (unsigned int) R_MIPS_max
);
1502 return &elf_mips_howto_table_rel
[r_type
];
1506 /* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */
1509 mips_info_to_howto_rel (abfd
, cache_ptr
, dst
)
1512 Elf32_Internal_Rel
*dst
;
1514 unsigned int r_type
;
1516 r_type
= ELF32_R_TYPE (dst
->r_info
);
1517 cache_ptr
->howto
= mips_elf32_rtype_to_howto (r_type
, false);
1519 /* The addend for a GPREL16 or LITERAL relocation comes from the GP
1520 value for the object file. We get the addend now, rather than
1521 when we do the relocation, because the symbol manipulations done
1522 by the linker may cause us to lose track of the input BFD. */
1523 if (((*cache_ptr
->sym_ptr_ptr
)->flags
& BSF_SECTION_SYM
) != 0
1524 && (r_type
== (unsigned int) R_MIPS_GPREL16
1525 || r_type
== (unsigned int) R_MIPS_LITERAL
))
1526 cache_ptr
->addend
= elf_gp (abfd
);
1529 /* Given a MIPS Elf32_Internal_Rela, fill in an arelent structure. */
1532 mips_info_to_howto_rela (abfd
, cache_ptr
, dst
)
1535 Elf32_Internal_Rela
*dst
;
1537 /* Since an Elf32_Internal_Rel is an initial prefix of an
1538 Elf32_Internal_Rela, we can just use mips_info_to_howto_rel
1540 mips_info_to_howto_rel (abfd
, cache_ptr
, (Elf32_Internal_Rel
*) dst
);
1542 /* If we ever need to do any extra processing with dst->r_addend
1543 (the field omitted in an Elf32_Internal_Rel) we can do it here. */
1546 /* Determine whether a symbol is global for the purposes of splitting
1547 the symbol table into global symbols and local symbols. At least
1548 on Irix 5, this split must be between section symbols and all other
1549 symbols. On most ELF targets the split is between static symbols
1550 and externally visible symbols. */
1553 mips_elf_sym_is_global (abfd
, sym
)
1554 bfd
*abfd ATTRIBUTE_UNUSED
;
1557 if (SGI_COMPAT (abfd
))
1558 return (sym
->flags
& BSF_SECTION_SYM
) == 0;
1560 return ((sym
->flags
& (BSF_GLOBAL
| BSF_WEAK
)) != 0
1561 || bfd_is_und_section (bfd_get_section (sym
))
1562 || bfd_is_com_section (bfd_get_section (sym
)));
1565 /* Set the right machine number for a MIPS ELF file. */
1568 mips_elf32_object_p (abfd
)
1573 /* Irix 5 and 6 are broken. Object file symbol tables are not always
1574 sorted correctly such that local symbols precede global symbols,
1575 and the sh_info field in the symbol table is not always right. */
1576 if (SGI_COMPAT (abfd
))
1577 elf_bad_symtab (abfd
) = true;
1579 mach
= _bfd_elf_mips_mach (elf_elfheader (abfd
)->e_flags
);
1580 bfd_default_set_arch_mach (abfd
, bfd_arch_mips
, mach
);
1585 /* MIPS ELF local labels start with '$', not 'L'. */
1588 mips_elf_is_local_label_name (abfd
, name
)
1595 /* On Irix 6, the labels go back to starting with '.', so we accept
1596 the generic ELF local label syntax as well. */
1597 return _bfd_elf_is_local_label_name (abfd
, name
);
1600 /* Support for core dump NOTE sections. */
1602 elf32_mips_grok_prstatus (abfd
, note
)
1604 Elf_Internal_Note
*note
;
1607 unsigned int raw_size
;
1609 switch (note
->descsz
)
1614 case 256: /* Linux/MIPS */
1616 elf_tdata (abfd
)->core_signal
= bfd_get_16 (abfd
, note
->descdata
+ 12);
1619 elf_tdata (abfd
)->core_pid
= bfd_get_32 (abfd
, note
->descdata
+ 24);
1628 /* Make a ".reg/999" section. */
1629 return _bfd_elfcore_make_pseudosection (abfd
, ".reg",
1630 raw_size
, note
->descpos
+ offset
);
1634 elf32_mips_grok_psinfo (abfd
, note
)
1636 Elf_Internal_Note
*note
;
1638 switch (note
->descsz
)
1643 case 128: /* Linux/MIPS elf_prpsinfo */
1644 elf_tdata (abfd
)->core_program
1645 = _bfd_elfcore_strndup (abfd
, note
->descdata
+ 32, 16);
1646 elf_tdata (abfd
)->core_command
1647 = _bfd_elfcore_strndup (abfd
, note
->descdata
+ 48, 80);
1650 /* Note that for some reason, a spurious space is tacked
1651 onto the end of the args in some (at least one anyway)
1652 implementations, so strip it off if it exists. */
1655 char *command
= elf_tdata (abfd
)->core_command
;
1656 int n
= strlen (command
);
1658 if (0 < n
&& command
[n
- 1] == ' ')
1659 command
[n
- 1] = '\0';
1668 elf32_mips_discard_info (abfd
, cookie
, info
)
1670 struct elf_reloc_cookie
*cookie
;
1671 struct bfd_link_info
*info
;
1674 boolean ret
= false;
1675 unsigned char *tdata
;
1678 o
= bfd_get_section_by_name (abfd
, ".pdr");
1681 if (o
->_raw_size
== 0)
1683 if (o
->_raw_size
% PDR_SIZE
!= 0)
1685 if (o
->output_section
!= NULL
1686 && bfd_is_abs_section (o
->output_section
))
1689 tdata
= bfd_zmalloc (o
->_raw_size
/ PDR_SIZE
);
1693 cookie
->rels
= _bfd_elf32_link_read_relocs (abfd
, o
, (PTR
) NULL
,
1694 (Elf_Internal_Rela
*) NULL
,
1702 cookie
->rel
= cookie
->rels
;
1703 cookie
->relend
= cookie
->rels
+ o
->reloc_count
;
1705 for (i
= 0, skip
= 0; i
< o
->_raw_size
; i
++)
1707 if (_bfd_elf32_reloc_symbol_deleted_p (i
* PDR_SIZE
, cookie
))
1716 elf_section_data (o
)->tdata
= tdata
;
1717 o
->_cooked_size
= o
->_raw_size
- skip
* PDR_SIZE
;
1723 if (! info
->keep_memory
)
1724 free (cookie
->rels
);
1730 elf32_mips_ignore_discarded_relocs (sec
)
1733 if (strcmp (sec
->name
, ".pdr") == 0)
1739 elf32_mips_write_section (output_bfd
, sec
, contents
)
1744 bfd_byte
*to
, *from
, *end
;
1747 if (strcmp (sec
->name
, ".pdr") != 0)
1750 if (elf_section_data (sec
)->tdata
== NULL
)
1754 end
= contents
+ sec
->_raw_size
;
1755 for (from
= contents
, i
= 0;
1757 from
+= PDR_SIZE
, i
++)
1759 if (((unsigned char *)elf_section_data (sec
)->tdata
)[i
] == 1)
1762 memcpy (to
, from
, PDR_SIZE
);
1765 bfd_set_section_contents (output_bfd
, sec
->output_section
, contents
,
1766 (file_ptr
) sec
->output_offset
,
1771 /* Depending on the target vector we generate some version of Irix
1772 executables or "normal" MIPS ELF ABI executables. */
1773 static irix_compat_t
1774 elf32_mips_irix_compat (abfd
)
1777 if ((abfd
->xvec
== &bfd_elf32_bigmips_vec
)
1778 || (abfd
->xvec
== &bfd_elf32_littlemips_vec
))
1784 /* Given a data section and an in-memory embedded reloc section, store
1785 relocation information into the embedded reloc section which can be
1786 used at runtime to relocate the data section. This is called by the
1787 linker when the --embedded-relocs switch is used. This is called
1788 after the add_symbols entry point has been called for all the
1789 objects, and before the final_link entry point is called. */
1792 bfd_mips_elf32_create_embedded_relocs (abfd
, info
, datasec
, relsec
, errmsg
)
1794 struct bfd_link_info
*info
;
1799 Elf_Internal_Shdr
*symtab_hdr
;
1800 Elf_Internal_Shdr
*shndx_hdr
;
1801 Elf32_External_Sym
*extsyms
;
1802 Elf32_External_Sym
*free_extsyms
= NULL
;
1803 Elf_External_Sym_Shndx
*shndx_buf
= NULL
;
1804 Elf_Internal_Rela
*internal_relocs
;
1805 Elf_Internal_Rela
*free_relocs
= NULL
;
1806 Elf_Internal_Rela
*irel
, *irelend
;
1810 BFD_ASSERT (! info
->relocateable
);
1814 if (datasec
->reloc_count
== 0)
1817 symtab_hdr
= &elf_tdata (abfd
)->symtab_hdr
;
1818 /* Read this BFD's symbols if we haven't done so already, or get the cached
1819 copy if it exists. */
1820 if (symtab_hdr
->contents
!= NULL
)
1821 extsyms
= (Elf32_External_Sym
*) symtab_hdr
->contents
;
1824 /* Go get them off disk. */
1825 if (info
->keep_memory
)
1826 extsyms
= ((Elf32_External_Sym
*)
1827 bfd_alloc (abfd
, symtab_hdr
->sh_size
));
1829 extsyms
= ((Elf32_External_Sym
*)
1830 bfd_malloc (symtab_hdr
->sh_size
));
1831 if (extsyms
== NULL
)
1833 if (! info
->keep_memory
)
1834 free_extsyms
= extsyms
;
1835 if (bfd_seek (abfd
, symtab_hdr
->sh_offset
, SEEK_SET
) != 0
1836 || (bfd_bread (extsyms
, symtab_hdr
->sh_size
, abfd
)
1837 != symtab_hdr
->sh_size
))
1839 if (info
->keep_memory
)
1840 symtab_hdr
->contents
= (unsigned char *) extsyms
;
1843 shndx_hdr
= &elf_tdata (abfd
)->symtab_shndx_hdr
;
1844 if (shndx_hdr
->sh_size
!= 0)
1846 amt
= symtab_hdr
->sh_info
* sizeof (Elf_External_Sym_Shndx
);
1847 shndx_buf
= (Elf_External_Sym_Shndx
*) bfd_malloc (amt
);
1848 if (shndx_buf
== NULL
)
1850 if (bfd_seek (abfd
, shndx_hdr
->sh_offset
, SEEK_SET
) != 0
1851 || bfd_bread ((PTR
) shndx_buf
, amt
, abfd
) != amt
)
1855 /* Get a copy of the native relocations. */
1856 internal_relocs
= (_bfd_elf32_link_read_relocs
1857 (abfd
, datasec
, (PTR
) NULL
, (Elf_Internal_Rela
*) NULL
,
1858 info
->keep_memory
));
1859 if (internal_relocs
== NULL
)
1861 if (! info
->keep_memory
)
1862 free_relocs
= internal_relocs
;
1864 relsec
->contents
= (bfd_byte
*) bfd_alloc (abfd
, datasec
->reloc_count
* 12);
1865 if (relsec
->contents
== NULL
)
1868 p
= relsec
->contents
;
1870 irelend
= internal_relocs
+ datasec
->reloc_count
;
1872 for (irel
= internal_relocs
; irel
< irelend
; irel
++, p
+= 12)
1874 asection
*targetsec
;
1876 /* We are going to write a four byte longword into the runtime
1877 reloc section. The longword will be the address in the data
1878 section which must be relocated. It is followed by the name
1879 of the target section NUL-padded or truncated to 8
1882 /* We can only relocate absolute longword relocs at run time. */
1883 if ((ELF32_R_TYPE (irel
->r_info
) != (int) R_MIPS_32
) &&
1884 (ELF32_R_TYPE (irel
->r_info
) != (int) R_MIPS_64
))
1886 *errmsg
= _("unsupported reloc type");
1887 bfd_set_error (bfd_error_bad_value
);
1890 /* Get the target section referred to by the reloc. */
1891 if (ELF32_R_SYM (irel
->r_info
) < symtab_hdr
->sh_info
)
1893 Elf32_External_Sym
*esym
;
1894 Elf_External_Sym_Shndx
*shndx
;
1895 Elf_Internal_Sym isym
;
1897 /* A local symbol. */
1898 esym
= extsyms
+ ELF32_R_SYM (irel
->r_info
);
1899 shndx
= shndx_buf
+ (shndx_buf
? ELF32_R_SYM (irel
->r_info
) : 0);
1900 bfd_elf32_swap_symbol_in (abfd
, esym
, shndx
, &isym
);
1902 targetsec
= bfd_section_from_elf_index (abfd
, isym
.st_shndx
);
1907 struct elf_link_hash_entry
*h
;
1909 /* An external symbol. */
1910 indx
= ELF32_R_SYM (irel
->r_info
);
1911 h
= elf_sym_hashes (abfd
)[indx
];
1914 For some reason, in certain programs, the symbol will
1915 not be in the hash table. It seems to happen when you
1916 declare a static table of pointers to const external structures.
1917 In this case, the relocs are relative to data, not
1918 text, so just treating it like an undefined link
1919 should be sufficient. */
1920 BFD_ASSERT(h
!= NULL
);
1921 if (h
->root
.type
== bfd_link_hash_defined
1922 || h
->root
.type
== bfd_link_hash_defweak
)
1923 targetsec
= h
->root
.u
.def
.section
;
1928 Set the low bit of the relocation offset if it's a MIPS64 reloc.
1929 Relocations will always be on (at least) 32-bit boundaries. */
1931 bfd_put_32 (abfd
, ((irel
->r_offset
+ datasec
->output_offset
) +
1932 ((ELF32_R_TYPE (irel
->r_info
) == (int) R_MIPS_64
) ? 1 : 0)),
1934 memset (p
+ 4, 0, 8);
1935 if (targetsec
!= NULL
)
1936 strncpy (p
+ 4, targetsec
->output_section
->name
, 8);
1939 if (shndx_buf
!= NULL
)
1941 if (free_extsyms
!= NULL
)
1942 free (free_extsyms
);
1943 if (free_relocs
!= NULL
)
1948 if (shndx_buf
!= NULL
)
1950 if (free_extsyms
!= NULL
)
1951 free (free_extsyms
);
1952 if (free_relocs
!= NULL
)
1957 /* ECOFF swapping routines. These are used when dealing with the
1958 .mdebug section, which is in the ECOFF debugging format. */
1959 static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap
= {
1960 /* Symbol table magic number. */
1962 /* Alignment of debugging information. E.g., 4. */
1964 /* Sizes of external symbolic information. */
1965 sizeof (struct hdr_ext
),
1966 sizeof (struct dnr_ext
),
1967 sizeof (struct pdr_ext
),
1968 sizeof (struct sym_ext
),
1969 sizeof (struct opt_ext
),
1970 sizeof (struct fdr_ext
),
1971 sizeof (struct rfd_ext
),
1972 sizeof (struct ext_ext
),
1973 /* Functions to swap in external symbolic data. */
1982 _bfd_ecoff_swap_tir_in
,
1983 _bfd_ecoff_swap_rndx_in
,
1984 /* Functions to swap out external symbolic data. */
1993 _bfd_ecoff_swap_tir_out
,
1994 _bfd_ecoff_swap_rndx_out
,
1995 /* Function to read in symbolic data. */
1996 _bfd_mips_elf_read_ecoff_info
1999 #define ELF_ARCH bfd_arch_mips
2000 #define ELF_MACHINE_CODE EM_MIPS
2002 /* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses
2003 a value of 0x1000, and we are compatible. */
2004 #define ELF_MAXPAGESIZE 0x1000
2006 #define elf_backend_collect true
2007 #define elf_backend_type_change_ok true
2008 #define elf_backend_can_gc_sections true
2009 #define elf_info_to_howto mips_info_to_howto_rela
2010 #define elf_info_to_howto_rel mips_info_to_howto_rel
2011 #define elf_backend_sym_is_global mips_elf_sym_is_global
2012 #define elf_backend_object_p mips_elf32_object_p
2013 #define elf_backend_symbol_processing _bfd_mips_elf_symbol_processing
2014 #define elf_backend_section_processing _bfd_mips_elf_section_processing
2015 #define elf_backend_section_from_shdr _bfd_mips_elf_section_from_shdr
2016 #define elf_backend_fake_sections _bfd_mips_elf_fake_sections
2017 #define elf_backend_section_from_bfd_section \
2018 _bfd_mips_elf_section_from_bfd_section
2019 #define elf_backend_add_symbol_hook _bfd_mips_elf_add_symbol_hook
2020 #define elf_backend_link_output_symbol_hook \
2021 _bfd_mips_elf_link_output_symbol_hook
2022 #define elf_backend_create_dynamic_sections \
2023 _bfd_mips_elf_create_dynamic_sections
2024 #define elf_backend_check_relocs _bfd_mips_elf_check_relocs
2025 #define elf_backend_adjust_dynamic_symbol \
2026 _bfd_mips_elf_adjust_dynamic_symbol
2027 #define elf_backend_always_size_sections \
2028 _bfd_mips_elf_always_size_sections
2029 #define elf_backend_size_dynamic_sections \
2030 _bfd_mips_elf_size_dynamic_sections
2031 #define elf_backend_relocate_section _bfd_mips_elf_relocate_section
2032 #define elf_backend_finish_dynamic_symbol \
2033 _bfd_mips_elf_finish_dynamic_symbol
2034 #define elf_backend_finish_dynamic_sections \
2035 _bfd_mips_elf_finish_dynamic_sections
2036 #define elf_backend_final_write_processing \
2037 _bfd_mips_elf_final_write_processing
2038 #define elf_backend_additional_program_headers \
2039 _bfd_mips_elf_additional_program_headers
2040 #define elf_backend_modify_segment_map _bfd_mips_elf_modify_segment_map
2041 #define elf_backend_gc_mark_hook _bfd_mips_elf_gc_mark_hook
2042 #define elf_backend_gc_sweep_hook _bfd_mips_elf_gc_sweep_hook
2043 #define elf_backend_copy_indirect_symbol \
2044 _bfd_mips_elf_copy_indirect_symbol
2045 #define elf_backend_hide_symbol _bfd_mips_elf_hide_symbol
2046 #define elf_backend_grok_prstatus elf32_mips_grok_prstatus
2047 #define elf_backend_grok_psinfo elf32_mips_grok_psinfo
2048 #define elf_backend_ecoff_debug_swap &mips_elf32_ecoff_debug_swap
2050 #define elf_backend_got_header_size (4 * MIPS_RESERVED_GOTNO)
2051 #define elf_backend_plt_header_size 0
2052 #define elf_backend_may_use_rel_p 1
2053 #define elf_backend_may_use_rela_p 0
2054 #define elf_backend_default_use_rela_p 0
2055 #define elf_backend_sign_extend_vma true
2057 #define elf_backend_discard_info elf32_mips_discard_info
2058 #define elf_backend_ignore_discarded_relocs \
2059 elf32_mips_ignore_discarded_relocs
2060 #define elf_backend_write_section elf32_mips_write_section
2061 #define elf_backend_mips_irix_compat elf32_mips_irix_compat
2062 #define elf_backend_mips_rtype_to_howto mips_elf32_rtype_to_howto
2063 #define bfd_elf32_bfd_is_local_label_name \
2064 mips_elf_is_local_label_name
2065 #define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line
2066 #define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents
2067 #define bfd_elf32_bfd_get_relocated_section_contents \
2068 _bfd_elf_mips_get_relocated_section_contents
2069 #define bfd_elf32_bfd_link_hash_table_create \
2070 _bfd_mips_elf_link_hash_table_create
2071 #define bfd_elf32_bfd_final_link _bfd_mips_elf_final_link
2072 #define bfd_elf32_bfd_merge_private_bfd_data \
2073 _bfd_mips_elf_merge_private_bfd_data
2074 #define bfd_elf32_bfd_set_private_flags _bfd_mips_elf_set_private_flags
2075 #define bfd_elf32_bfd_print_private_bfd_data \
2076 _bfd_mips_elf_print_private_bfd_data
2078 /* Support for SGI-ish mips targets. */
2079 #define TARGET_LITTLE_SYM bfd_elf32_littlemips_vec
2080 #define TARGET_LITTLE_NAME "elf32-littlemips"
2081 #define TARGET_BIG_SYM bfd_elf32_bigmips_vec
2082 #define TARGET_BIG_NAME "elf32-bigmips"
2084 #include "elf32-target.h"
2086 /* Support for traditional mips targets. */
2087 #define INCLUDED_TARGET_FILE /* More a type of flag. */
2089 #undef TARGET_LITTLE_SYM
2090 #undef TARGET_LITTLE_NAME
2091 #undef TARGET_BIG_SYM
2092 #undef TARGET_BIG_NAME
2094 #define TARGET_LITTLE_SYM bfd_elf32_tradlittlemips_vec
2095 #define TARGET_LITTLE_NAME "elf32-tradlittlemips"
2096 #define TARGET_BIG_SYM bfd_elf32_tradbigmips_vec
2097 #define TARGET_BIG_NAME "elf32-tradbigmips"
2099 /* Include the target file again for this target. */
2100 #include "elf32-target.h"