Commit | Line | Data |
---|---|---|
1f29e30b JG |
1 | /* BFD back-end for MIPS Extended-Coff files. |
2 | Copyright 1990, 1991, 1992 Free Software Foundation, Inc. | |
68b70212 | 3 | Written by Per Bothner. |
1327fb29 | 4 | |
68b70212 | 5 | This file is part of BFD, the Binary File Descriptor library. |
23b0b558 | 6 | |
68b70212 | 7 | This program is free software; you can redistribute it and/or modify |
23b0b558 | 8 | it under the terms of the GNU General Public License as published by |
68b70212 JG |
9 | the Free Software Foundation; either version 2 of the License, or |
10 | (at your option) any later version. | |
23b0b558 | 11 | |
68b70212 | 12 | This program is distributed in the hope that it will be useful, |
23b0b558 JG |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
68b70212 JG |
18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
1327fb29 | 20 | |
23b0b558 | 21 | #include "bfd.h" |
dd4646ca | 22 | #include "sysdep.h" |
1327fb29 | 23 | #include "libbfd.h" |
294eaca4 SC |
24 | #include "coff/mips.h" |
25 | #include "coff/internal.h" | |
23b0b558 | 26 | #include "libcoff.h" /* to allow easier abstraction-breaking */ |
1327fb29 | 27 | |
8e3c8f47 | 28 | #define BADMAG(x) ECOFFBADMAG(x) |
2b1d8a50 | 29 | |
c9301d7b SC |
30 | /* Can't read these relocs */ |
31 | #define RTYPE2HOWTO(a,b) ; | |
68b70212 JG |
32 | /* Define NO_COFF_SYMBOLS and NO_COFF_LINENOS to avoid coffcode.h |
33 | defining a mess of useless functions. */ | |
34 | #define NO_COFF_SYMBOLS | |
35 | #define NO_COFF_LINENOS | |
dd4646ca JG |
36 | /* Define MIPS to get MIPS magic numbers and such */ |
37 | #define MIPS 1 | |
853f0a70 JG |
38 | /* Define additional MIPS section types */ |
39 | #define STYP_OTHER_LOAD 0x98000300 | |
7ed4093a | 40 | #include "coffcode.h" |
68b70212 | 41 | |
68b70212 JG |
42 | /* We do not implement symbols for ecoff. */ |
43 | #define coff_get_symtab_upper_bound (PROTO(unsigned int, (*),(bfd *)))bfd_false | |
44 | #define coff_get_symtab (PROTO(unsigned int, (*), (bfd *, asymbol **)))bfd_0 | |
45 | #define coff_print_symbol \ | |
46 | (PROTO(void,(*),(bfd *, PTR, asymbol *, enum bfd_print_symbol))) bfd_void | |
47 | #define coff_swap_sym_in (PROTO(void,(*),(bfd *,PTR,PTR))) bfd_void | |
dd4646ca | 48 | #define coff_swap_aux_in (PROTO(void,(*),(bfd *,PTR,int,int,PTR))) bfd_void |
853f0a70 JG |
49 | #define coff_swap_sym_out (PROTO(unsigned,(*),(bfd *,PTR,PTR))) bfd_void |
50 | #define coff_swap_aux_out (PROTO(unsigned,(*),(bfd *,PTR,int,int,PTR))) bfd_void | |
68b70212 JG |
51 | |
52 | /* We do not implement linenos for ecoff. */ | |
53 | #define coff_get_lineno (struct lineno_cache_entry *(*)()) bfd_nullvoidptr | |
54 | #define coff_swap_lineno_in (PROTO(void,(*),(bfd *,PTR,PTR))) bfd_void | |
55 | #define coff_find_nearest_line (PROTO(boolean, (*),(bfd*,asection*,asymbol**,bfd_vma, CONST char**, CONST char**, unsigned int *))) bfd_false | |
853f0a70 | 56 | #define coff_swap_lineno_out (PROTO(unsigned,(*),(bfd *,PTR,PTR))) bfd_void |
c9301d7b | 57 | |
1327fb29 | 58 | bfd_target ecoff_little_vec = |
294eaca4 SC |
59 | { |
60 | "ecoff-littlemips", /* name */ | |
61 | bfd_target_coff_flavour, | |
62 | false, /* data byte order is little */ | |
63 | false, /* header byte order is little */ | |
64 | ||
65 | (HAS_RELOC | EXEC_P | /* object flags */ | |
66 | HAS_LINENO | HAS_DEBUG | | |
67 | HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT), | |
68 | ||
69 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* sect | |
70 | flags */ | |
71 | 0, /* leading underscore */ | |
72 | '/', /* ar_pad_char */ | |
73 | 15, /* ar_max_namelen */ | |
74 | 3, /* minimum alignment power */ | |
75 | _do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */ | |
76 | _do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* hdrs */ | |
77 | ||
78 | {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ | |
79 | bfd_generic_archive_p, _bfd_dummy_target}, | |
80 | {bfd_false, coff_mkobject, bfd_false, /* bfd_set_format */ | |
81 | bfd_false}, | |
82 | {bfd_false, coff_write_object_contents, bfd_false, bfd_false}, | |
83 | JUMP_TABLE (coff) | |
84 | }; | |
1327fb29 SC |
85 | |
86 | bfd_target ecoff_big_vec = | |
294eaca4 SC |
87 | { |
88 | "ecoff-bigmips", /* name */ | |
89 | bfd_target_coff_flavour, | |
90 | true, /* data byte order is big */ | |
91 | true, /* header byte order is big */ | |
92 | ||
93 | (HAS_RELOC | EXEC_P | /* object flags */ | |
94 | HAS_LINENO | HAS_DEBUG | | |
95 | HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT), | |
96 | ||
97 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* sect flags */ | |
98 | 0, /* leading underscore */ | |
99 | ' ', /* ar_pad_char */ | |
100 | 16, /* ar_max_namelen */ | |
101 | 3, /* minimum alignment power */ | |
102 | _do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, | |
103 | _do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, | |
104 | {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ | |
105 | bfd_generic_archive_p, _bfd_dummy_target}, | |
106 | {bfd_false, coff_mkobject, bfd_false, /* bfd_set_format */ | |
107 | bfd_false}, | |
108 | {bfd_false, coff_write_object_contents, /* bfd_write_contents */ | |
109 | bfd_false, bfd_false}, | |
110 | JUMP_TABLE(coff), | |
111 | COFF_SWAP_TABLE | |
112 | }; |