1 /* BFD back-end for MIPS PE COFF files.
2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 Modified from coff-i386.c by DJ Delorie, dj@cygnus.com
6 This file is part of BFD, the Binary File Descriptor library.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23 #define COFF_LONG_SECTION_NAMES
24 #define PCRELOFFSET TRUE
30 #include "coff/mipspe.h"
32 #include "coff/internal.h"
38 static bfd_reloc_status_type coff_mips_reloc
39 PARAMS ((bfd
*, arelent
*, asymbol
*, PTR
, asection
*, bfd
*, char **));
40 static reloc_howto_type
*coff_mips_rtype_to_howto
41 PARAMS ((bfd
*, asection
*, struct internal_reloc
*,
42 struct coff_link_hash_entry
*, struct internal_syment
*,
45 static bfd_boolean in_reloc_p
46 PARAMS ((bfd
*, reloc_howto_type
*));
47 static reloc_howto_type
* coff_mips_reloc_type_lookup
48 PARAMS ((bfd
*, bfd_reloc_code_real_type
));
49 static void mips_swap_reloc_in
50 PARAMS ((bfd
*, PTR
, PTR
));
51 static unsigned int mips_swap_reloc_out
52 PARAMS ((bfd
*, PTR
, PTR
));
53 static bfd_boolean coff_pe_mips_relocate_section
54 PARAMS ((bfd
*, struct bfd_link_info
*, bfd
*, asection
*, bfd_byte
*,
55 struct internal_reloc
*, struct internal_syment
*, asection
**));
57 #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
58 /* The page size is a guess based on ELF. */
60 #define COFF_PAGE_SIZE 0x1000
62 /* For some reason when using mips COFF the value stored in the .text
63 section for a reference to a common symbol is the value itself plus
64 any desired offset. Ian Taylor, Cygnus Support. */
66 /* If we are producing relocatable output, we need to do some
67 adjustments to the object file that are not done by the
68 bfd_perform_relocation function. This function is called by every
69 reloc type to make any required adjustments. */
71 static bfd_reloc_status_type
72 coff_mips_reloc (abfd
, reloc_entry
, symbol
, data
, input_section
, output_bfd
,
78 asection
*input_section ATTRIBUTE_UNUSED
;
80 char **error_message ATTRIBUTE_UNUSED
;
84 if (output_bfd
== (bfd
*) NULL
)
85 return bfd_reloc_continue
;
87 if (bfd_is_com_section (symbol
->section
))
90 /* We are relocating a common symbol. The current value in the
91 object file is ORIG + OFFSET, where ORIG is the value of the
92 common symbol as seen by the object file when it was compiled
93 (this may be zero if the symbol was undefined) and OFFSET is
94 the offset into the common symbol (normally zero, but may be
95 non-zero when referring to a field in a common structure).
96 ORIG is the negative of reloc_entry->addend, which is set by
97 the CALC_ADDEND macro below. We want to replace the value in
98 the object file with NEW + OFFSET, where NEW is the value of
99 the common symbol which we are going to put in the final
100 object file. NEW is symbol->value. */
101 diff
= symbol
->value
+ reloc_entry
->addend
;
103 /* In PE mode, we do not offset the common symbol. */
104 diff
= reloc_entry
->addend
;
109 /* For some reason bfd_perform_relocation always effectively
110 ignores the addend for a COFF target when producing
111 relocatable output. This seems to be always wrong for 386
112 COFF, so we handle the addend here instead. */
113 diff
= reloc_entry
->addend
;
117 x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + (diff >> howto->rightshift)) & howto->dst_mask))
121 reloc_howto_type
*howto
= reloc_entry
->howto
;
122 unsigned char *addr
= (unsigned char *) data
+ reloc_entry
->address
;
128 char x
= bfd_get_8 (abfd
, addr
);
130 bfd_put_8 (abfd
, x
, addr
);
136 short x
= bfd_get_16 (abfd
, addr
);
138 bfd_put_16 (abfd
, (bfd_vma
) x
, addr
);
144 long x
= bfd_get_32 (abfd
, addr
);
146 bfd_put_32 (abfd
, (bfd_vma
) x
, addr
);
155 /* Now let bfd_perform_relocation finish everything up. */
156 return bfd_reloc_continue
;
160 /* Return TRUE if this relocation should
161 appear in the output .reloc section. */
164 in_reloc_p (abfd
, howto
)
165 bfd
* abfd ATTRIBUTE_UNUSED
;
166 reloc_howto_type
*howto
;
168 return ! howto
->pc_relative
&& howto
->type
!= MIPS_R_RVA
;
173 #define PCRELOFFSET FALSE
176 static reloc_howto_type howto_table
[] =
178 /* Reloc type 0 is ignored. The reloc reading code ensures that
179 this is a reference to the .abs section, which will cause
180 bfd_perform_relocation to do nothing. */
181 HOWTO (MIPS_R_ABSOLUTE
, /* type */
183 0, /* size (0 = byte, 1 = short, 2 = long) */
185 FALSE
, /* pc_relative */
187 complain_overflow_dont
, /* complain_on_overflow */
188 0, /* special_function */
190 FALSE
, /* partial_inplace */
193 FALSE
), /* pcrel_offset */
195 /* A 16 bit reference to a symbol, normally from a data section. */
196 HOWTO (MIPS_R_REFHALF
, /* type */
198 1, /* size (0 = byte, 1 = short, 2 = long) */
200 FALSE
, /* pc_relative */
202 complain_overflow_bitfield
, /* complain_on_overflow */
203 coff_mips_reloc
, /* special_function */
204 "REFHALF", /* name */
205 TRUE
, /* partial_inplace */
206 0xffff, /* src_mask */
207 0xffff, /* dst_mask */
208 FALSE
), /* pcrel_offset */
210 /* A 32 bit reference to a symbol, normally from a data section. */
211 HOWTO (MIPS_R_REFWORD
, /* type */
213 2, /* size (0 = byte, 1 = short, 2 = long) */
215 FALSE
, /* pc_relative */
217 complain_overflow_bitfield
, /* complain_on_overflow */
218 coff_mips_reloc
, /* special_function */
219 "REFWORD", /* name */
220 TRUE
, /* partial_inplace */
221 0xffffffff, /* src_mask */
222 0xffffffff, /* dst_mask */
223 FALSE
), /* pcrel_offset */
225 /* A 26 bit absolute jump address. */
226 HOWTO (MIPS_R_JMPADDR
, /* type */
228 2, /* size (0 = byte, 1 = short, 2 = long) */
230 FALSE
, /* pc_relative */
232 complain_overflow_dont
, /* complain_on_overflow */
233 /* This needs complex overflow
234 detection, because the upper four
235 bits must match the PC. */
236 coff_mips_reloc
, /* special_function */
237 "JMPADDR", /* name */
238 TRUE
, /* partial_inplace */
239 0x3ffffff, /* src_mask */
240 0x3ffffff, /* dst_mask */
241 FALSE
), /* pcrel_offset */
243 /* The high 16 bits of a symbol value. Handled by the function
245 HOWTO (MIPS_R_REFHI
, /* type */
247 2, /* size (0 = byte, 1 = short, 2 = long) */
249 FALSE
, /* pc_relative */
251 complain_overflow_bitfield
, /* complain_on_overflow */
252 coff_mips_reloc
, /* special_function */
254 TRUE
, /* partial_inplace */
255 0xffff, /* src_mask */
256 0xffff, /* dst_mask */
257 FALSE
), /* pcrel_offset */
259 /* The low 16 bits of a symbol value. */
260 HOWTO (MIPS_R_REFLO
, /* type */
262 2, /* size (0 = byte, 1 = short, 2 = long) */
264 FALSE
, /* pc_relative */
266 complain_overflow_dont
, /* complain_on_overflow */
267 coff_mips_reloc
, /* special_function */
269 TRUE
, /* partial_inplace */
270 0xffff, /* src_mask */
271 0xffff, /* dst_mask */
272 FALSE
), /* pcrel_offset */
274 /* A reference to an offset from the gp register. Handled by the
275 function mips_gprel_reloc. */
276 HOWTO (MIPS_R_GPREL
, /* type */
278 2, /* size (0 = byte, 1 = short, 2 = long) */
280 FALSE
, /* pc_relative */
282 complain_overflow_signed
, /* complain_on_overflow */
283 coff_mips_reloc
, /* special_function */
285 TRUE
, /* partial_inplace */
286 0xffff, /* src_mask */
287 0xffff, /* dst_mask */
288 FALSE
), /* pcrel_offset */
290 /* A reference to a literal using an offset from the gp register.
291 Handled by the function mips_gprel_reloc. */
292 HOWTO (MIPS_R_LITERAL
, /* type */
294 2, /* size (0 = byte, 1 = short, 2 = long) */
296 FALSE
, /* pc_relative */
298 complain_overflow_signed
, /* complain_on_overflow */
299 coff_mips_reloc
, /* special_function */
300 "LITERAL", /* name */
301 TRUE
, /* partial_inplace */
302 0xffff, /* src_mask */
303 0xffff, /* dst_mask */
304 FALSE
), /* pcrel_offset */
332 HOWTO (MIPS_R_RVA
, /* type */
334 2, /* size (0 = byte, 1 = short, 2 = long) */
336 FALSE
, /* pc_relative */
338 complain_overflow_bitfield
, /* complain_on_overflow */
339 coff_mips_reloc
, /* special_function */
341 TRUE
, /* partial_inplace */
342 0xffffffff, /* src_mask */
343 0xffffffff, /* dst_mask */
344 FALSE
), /* pcrel_offset */
347 HOWTO (MIPS_R_PAIR
, /* type */
349 2, /* size (0 = byte, 1 = short, 2 = long) */
351 FALSE
, /* pc_relative */
353 complain_overflow_bitfield
, /* complain_on_overflow */
354 coff_mips_reloc
, /* special_function */
356 TRUE
, /* partial_inplace */
357 0xffffffff, /* src_mask */
358 0xffffffff, /* dst_mask */
359 FALSE
), /* pcrel_offset */
362 /* Turn a howto into a reloc nunmber */
364 #define SELECT_RELOC(x,howto) { x.r_type = howto->type; }
365 #define BADMAG(x) MIPSBADMAG(x)
366 #define MIPS 1 /* Customize coffcode.h */
368 #define RTYPE2HOWTO(cache_ptr, dst) \
369 (cache_ptr)->howto = howto_table + (dst)->r_type;
371 /* Compute the addend of a reloc. If the reloc is to a common symbol,
372 the object file contains the value of the common symbol. By the
373 time this is called, the linker may be using a different symbol
374 from a different object file with a different value. Therefore, we
375 hack wildly to locate the original symbol from this file so that we
376 can make the correct adjustment. This macro sets coffsym to the
377 symbol from the original file, and uses it to set the addend value
378 correctly. If this is not a common symbol, the usual addend
379 calculation is done, except that an additional tweak is needed for
381 FIXME: This macro refers to symbols and asect; these are from the
382 calling function, not the macro arguments. */
384 #define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \
386 coff_symbol_type *coffsym = (coff_symbol_type *) NULL; \
387 if (ptr && bfd_asymbol_bfd (ptr) != abfd) \
388 coffsym = (obj_symbols (abfd) \
389 + (cache_ptr->sym_ptr_ptr - symbols)); \
391 coffsym = coff_symbol_from (abfd, ptr); \
392 if (coffsym != (coff_symbol_type *) NULL \
393 && coffsym->native->u.syment.n_scnum == 0) \
394 cache_ptr->addend = - coffsym->native->u.syment.n_value; \
395 else if (ptr && bfd_asymbol_bfd (ptr) == abfd \
396 && ptr->section != (asection *) NULL) \
397 cache_ptr->addend = - (ptr->section->vma + ptr->value); \
399 cache_ptr->addend = 0; \
400 if (ptr && howto_table[reloc.r_type].pc_relative) \
401 cache_ptr->addend += asect->vma; \
404 /* Convert an rtype to howto for the COFF backend linker. */
406 static reloc_howto_type
*
407 coff_mips_rtype_to_howto (abfd
, sec
, rel
, h
, sym
, addendp
)
408 bfd
*abfd ATTRIBUTE_UNUSED
;
410 struct internal_reloc
*rel
;
411 struct coff_link_hash_entry
*h
;
412 struct internal_syment
*sym
;
416 reloc_howto_type
*howto
;
418 howto
= howto_table
+ rel
->r_type
;
424 if (howto
->pc_relative
)
425 *addendp
+= sec
->vma
;
427 if (sym
!= NULL
&& sym
->n_scnum
== 0 && sym
->n_value
!= 0)
429 /* This is a common symbol. The section contents include the
430 size (sym->n_value) as an addend. The relocate_section
431 function will be adding in the final value of the symbol. We
432 need to subtract out the current size in order to get the
435 BFD_ASSERT (h
!= NULL
);
438 /* I think we *do* want to bypass this. If we don't, I have
439 seen some data parameters get the wrong relocation address.
440 If I link two versions with and without this section bypassed
441 and then do a binary comparison, the addresses which are
442 different can be looked up in the map. The case in which
443 this section has been bypassed has addresses which correspond
444 to values I can find in the map. */
445 *addendp
-= sym
->n_value
;
450 /* If the output symbol is common (in which case this must be a
451 relocatable link), we need to add in the final size of the
453 if (h
!= NULL
&& h
->root
.type
== bfd_link_hash_common
)
454 *addendp
+= h
->root
.u
.c
.size
;
458 if (howto
->pc_relative
)
462 /* If the symbol is defined, then the generic code is going to
463 add back the symbol value in order to cancel out an
464 adjustment it made to the addend. However, we set the addend
465 to 0 at the start of this function. We need to adjust here,
466 to avoid the adjustment the generic code will make. FIXME:
467 This is getting a bit hackish. */
468 if (sym
!= NULL
&& sym
->n_scnum
!= 0)
469 *addendp
-= sym
->n_value
;
472 if (rel
->r_type
== MIPS_R_RVA
)
474 *addendp
-= pe_data(sec
->output_section
->owner
)->pe_opthdr
.ImageBase
;
481 #define coff_rtype_to_howto coff_mips_rtype_to_howto
483 #define coff_bfd_reloc_type_lookup coff_mips_reloc_type_lookup
485 /* Get the howto structure for a generic reloc type. */
487 static reloc_howto_type
*
488 coff_mips_reloc_type_lookup (abfd
, code
)
489 bfd
*abfd ATTRIBUTE_UNUSED
;
490 bfd_reloc_code_real_type code
;
497 mips_type
= MIPS_R_REFHALF
;
501 mips_type
= MIPS_R_REFWORD
;
503 case BFD_RELOC_MIPS_JMP
:
504 mips_type
= MIPS_R_JMPADDR
;
506 case BFD_RELOC_HI16_S
:
507 mips_type
= MIPS_R_REFHI
;
510 mips_type
= MIPS_R_REFLO
;
512 case BFD_RELOC_GPREL16
:
513 mips_type
= MIPS_R_GPREL
;
515 case BFD_RELOC_MIPS_LITERAL
:
516 mips_type
= MIPS_R_LITERAL
;
519 mips_type
= MIPS_R_RVA
;
522 return (reloc_howto_type
*) NULL
;
525 return &howto_table
[mips_type
];
529 mips_swap_reloc_in (abfd
, src
, dst
)
534 static struct internal_reloc pair_prev
;
535 RELOC
*reloc_src
= (RELOC
*) src
;
536 struct internal_reloc
*reloc_dst
= (struct internal_reloc
*) dst
;
538 reloc_dst
->r_vaddr
= H_GET_32 (abfd
, reloc_src
->r_vaddr
);
539 reloc_dst
->r_symndx
= H_GET_S32 (abfd
, reloc_src
->r_symndx
);
540 reloc_dst
->r_type
= H_GET_16 (abfd
, reloc_src
->r_type
);
541 reloc_dst
->r_size
= 0;
542 reloc_dst
->r_extern
= 0;
543 reloc_dst
->r_offset
= 0;
545 switch (reloc_dst
->r_type
)
548 pair_prev
= *reloc_dst
;
551 reloc_dst
->r_offset
= reloc_dst
->r_symndx
;
552 if (reloc_dst
->r_offset
& 0x8000)
553 reloc_dst
->r_offset
-= 0x10000;
554 /*printf ("dj: pair offset is %08x\n", reloc_dst->r_offset);*/
555 reloc_dst
->r_symndx
= pair_prev
.r_symndx
;
561 mips_swap_reloc_out (abfd
, src
, dst
)
566 static int prev_offset
= 1;
567 static bfd_vma prev_addr
= 0;
568 struct internal_reloc
*reloc_src
= (struct internal_reloc
*)src
;
569 struct external_reloc
*reloc_dst
= (struct external_reloc
*)dst
;
571 switch (reloc_src
->r_type
)
574 prev_addr
= reloc_src
->r_vaddr
;
575 prev_offset
= reloc_src
->r_offset
;
578 if (reloc_src
->r_vaddr
== prev_addr
)
580 /* FIXME: only slightly hackish. If we see a REFLO pointing to
581 the same address as a REFHI, we assume this is the matching
582 PAIR reloc and output it accordingly. The symndx is really
583 the low 16 bits of the addend */
584 H_PUT_32 (abfd
, reloc_src
->r_vaddr
, reloc_dst
->r_vaddr
);
585 H_PUT_32 (abfd
, reloc_src
->r_symndx
, reloc_dst
->r_symndx
);
586 H_PUT_16 (abfd
, MIPS_R_PAIR
, reloc_dst
->r_type
);
592 H_PUT_32 (abfd
, reloc_src
->r_vaddr
, reloc_dst
->r_vaddr
);
593 H_PUT_32 (abfd
, reloc_src
->r_symndx
, reloc_dst
->r_symndx
);
595 H_PUT_16 (abfd
, reloc_src
->r_type
, reloc_dst
->r_type
);
599 #define coff_swap_reloc_in mips_swap_reloc_in
600 #define coff_swap_reloc_out mips_swap_reloc_out
601 #define NO_COFF_RELOCS
604 coff_pe_mips_relocate_section (output_bfd
, info
, input_bfd
,
605 input_section
, contents
, relocs
, syms
,
608 struct bfd_link_info
*info
;
610 asection
*input_section
;
612 struct internal_reloc
*relocs
;
613 struct internal_syment
*syms
;
617 bfd_boolean gp_undefined
;
619 struct internal_reloc
*rel
;
620 struct internal_reloc
*rel_end
;
624 if (info
->relocatable
)
626 (*_bfd_error_handler
)
627 (_("%B: `ld -r' not supported with PE MIPS objects\n"), input_bfd
);
628 bfd_set_error (bfd_error_bad_value
);
632 BFD_ASSERT (input_bfd
->xvec
->byteorder
633 == output_bfd
->xvec
->byteorder
);
635 gp
= _bfd_get_gp_value (output_bfd
);
639 gp_undefined
= FALSE
;
646 rel_end
= rel
+ input_section
->reloc_count
;
647 for (i
= 0; rel
< rel_end
; rel
++, i
++)
650 struct coff_link_hash_entry
*h
;
651 struct internal_syment
*sym
;
653 bfd_vma val
, tmp
, targ
, src
, low
;
654 reloc_howto_type
*howto
;
655 unsigned char *mem
= contents
+ rel
->r_vaddr
;
657 symndx
= rel
->r_symndx
;
666 h
= obj_coff_sym_hashes (input_bfd
)[symndx
];
670 /* COFF treats common symbols in one of two ways. Either the
671 size of the symbol is included in the section contents, or it
672 is not. We assume that the size is not included, and force
673 the rtype_to_howto function to adjust the addend as needed. */
675 if (sym
!= NULL
&& sym
->n_scnum
!= 0)
676 addend
= - sym
->n_value
;
680 howto
= bfd_coff_rtype_to_howto (input_bfd
, input_section
, rel
, h
,
685 /* If we are doing a relocatable link, then we can just ignore
686 a PC relative reloc that is pcrel_offset. It will already
687 have the correct value. If this is not a relocatable link,
688 then we should ignore the symbol value. */
689 if (howto
->pc_relative
&& howto
->pcrel_offset
)
691 if (info
->relocatable
)
693 if (sym
!= NULL
&& sym
->n_scnum
!= 0)
694 addend
+= sym
->n_value
;
705 sec
= bfd_abs_section_ptr
;
710 sec
= sections
[symndx
];
711 val
= (sec
->output_section
->vma
714 if (! obj_pe (input_bfd
))
720 if (h
->root
.type
== bfd_link_hash_defined
721 || h
->root
.type
== bfd_link_hash_defweak
)
725 sec
= h
->root
.u
.def
.section
;
726 val
= (h
->root
.u
.def
.value
727 + sec
->output_section
->vma
728 + sec
->output_offset
);
731 else if (! info
->relocatable
)
733 if (! ((*info
->callbacks
->undefined_symbol
)
734 (info
, h
->root
.root
.string
, input_bfd
, input_section
,
735 rel
->r_vaddr
- input_section
->vma
, TRUE
)))
740 src
= rel
->r_vaddr
+ input_section
->output_section
->vma
741 + input_section
->output_offset
;
743 /* OK, at this point the following variables are set up:
744 src = VMA of the memory we're fixing up
745 mem = pointer to memory we're fixing up
746 val = VMA of what we need to refer to
749 #define UI(x) (*_bfd_error_handler) (_("%B: unimplemented %s\n"), \
751 bfd_set_error (bfd_error_bad_value);
755 case MIPS_R_ABSOLUTE
:
764 tmp
= bfd_get_32(input_bfd
, mem
);
765 /* printf ("refword: src=%08x targ=%08x+%08x\n", src, tmp, val); */
767 bfd_put_32(input_bfd
, tmp
, mem
);
771 tmp
= bfd_get_32(input_bfd
, mem
);
772 targ
= val
+ (tmp
&0x03ffffff)*4;
773 if ((src
& 0xf0000000) != (targ
& 0xf0000000))
775 (*_bfd_error_handler
) (_("%B: jump too far away\n"), input_bfd
);
776 bfd_set_error (bfd_error_bad_value
);
780 tmp
|= (targ
/4) & 0x3ffffff;
781 bfd_put_32(input_bfd
, tmp
, mem
);
785 tmp
= bfd_get_32(input_bfd
, mem
);
786 switch (rel
[1].r_type
)
790 targ
= val
+ rel
[1].r_offset
+ ((tmp
& 0xffff) << 16);
793 /* GNU COFF object */
794 low
= bfd_get_32(input_bfd
, contents
+ rel
[1].r_vaddr
);
798 targ
= val
+ low
+ ((tmp
& 0xffff) << 16);
801 (*_bfd_error_handler
) (_("%B: bad pair/reflo after refhi\n"),
803 bfd_set_error (bfd_error_bad_value
);
807 tmp
|= (targ
>> 16) & 0xffff;
808 bfd_put_32(input_bfd
, tmp
, mem
);
812 tmp
= bfd_get_32(input_bfd
, mem
);
813 targ
= val
+ (tmp
& 0xffff);
814 /* printf ("refword: src=%08x targ=%08x\n", src, targ); */
816 tmp
|= targ
& 0xffff;
817 bfd_put_32(input_bfd
, tmp
, mem
);
833 case MIPS_R_SECRELLO
:
837 case MIPS_R_SECRELHI
:
842 tmp
= bfd_get_32 (input_bfd
, mem
);
843 /* printf ("rva: src=%08x targ=%08x+%08x\n", src, tmp, val); */
845 - pe_data (input_section
->output_section
->owner
)->pe_opthdr
.ImageBase
;
846 bfd_put_32 (input_bfd
, tmp
, mem
);
858 #define coff_relocate_section coff_pe_mips_relocate_section
860 #ifdef TARGET_UNDERSCORE
862 /* If mips gcc uses underscores for symbol names, then it does not use
863 a leading dot for local labels, so if TARGET_UNDERSCORE is defined
864 we treat all symbols starting with L as local. */
866 static bfd_boolean coff_mips_is_local_label_name
867 PARAMS ((bfd
*, const char *));
870 coff_mips_is_local_label_name (abfd
, name
)
877 return _bfd_coff_is_local_label_name (abfd
, name
);
880 #define coff_bfd_is_local_label_name coff_mips_is_local_label_name
882 #endif /* TARGET_UNDERSCORE */
884 #define COFF_NO_HACK_SCNHDR_SIZE
886 #include "coffcode.h"
898 "pe-mips", /* name */
900 bfd_target_coff_flavour
,
901 BFD_ENDIAN_LITTLE
, /* data byte order is little */
902 BFD_ENDIAN_LITTLE
, /* header byte order is little */
904 (HAS_RELOC
| EXEC_P
| /* object flags */
905 HAS_LINENO
| HAS_DEBUG
|
906 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
| D_PAGED
),
909 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
/* section flags */
910 | SEC_CODE
| SEC_DATA
),
912 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
/* section flags */
913 | SEC_CODE
| SEC_DATA
914 | SEC_LINK_ONCE
| SEC_LINK_DUPLICATES
),
917 #ifdef TARGET_UNDERSCORE
918 TARGET_UNDERSCORE
, /* leading underscore */
920 0, /* leading underscore */
922 '/', /* ar_pad_char */
923 15, /* ar_max_namelen */
925 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
926 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
927 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* data */
928 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
929 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
930 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* hdrs */
932 /* Note that we allow an object file to be treated as a core file as well. */
933 {_bfd_dummy_target
, coff_object_p
, /* bfd_check_format */
934 bfd_generic_archive_p
, coff_object_p
},
935 {bfd_false
, coff_mkobject
, _bfd_generic_mkarchive
, /* bfd_set_format */
937 {bfd_false
, coff_write_object_contents
, /* bfd_write_contents */
938 _bfd_write_archive_contents
, bfd_false
},
940 BFD_JUMP_TABLE_GENERIC (coff
),
941 BFD_JUMP_TABLE_COPY (coff
),
942 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
943 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
944 BFD_JUMP_TABLE_SYMBOLS (coff
),
945 BFD_JUMP_TABLE_RELOCS (coff
),
946 BFD_JUMP_TABLE_WRITE (coff
),
947 BFD_JUMP_TABLE_LINK (coff
),
948 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),