Commit | Line | Data |
---|---|---|
68b70212 JG |
1 | /* MIPS Extended-Coff back-end for BFD. |
2 | Copyright (C) 1990-1991 Free Software Foundation, Inc. | |
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 | |
7ed4093a | 21 | #include <sysdep.h> |
1327fb29 | 22 | #define MIPS 1 |
23b0b558 | 23 | #include "bfd.h" |
1327fb29 | 24 | #include "libbfd.h" |
19b03b7a | 25 | |
41f50af0 SC |
26 | #include "ecoff.h" |
27 | #include "internalcoff.h" | |
23b0b558 | 28 | #include "libcoff.h" /* to allow easier abstraction-breaking */ |
68b70212 | 29 | #include "trad-core.h" |
1327fb29 | 30 | |
8e3c8f47 | 31 | #define BADMAG(x) ECOFFBADMAG(x) |
2b1d8a50 | 32 | |
68b70212 JG |
33 | /* Define NO_COFF_SYMBOLS and NO_COFF_LINENOS to avoid coffcode.h |
34 | defining a mess of useless functions. */ | |
35 | #define NO_COFF_SYMBOLS | |
36 | #define NO_COFF_LINENOS | |
7ed4093a | 37 | #include "coffcode.h" |
68b70212 JG |
38 | |
39 | #if HOST_SYS==DEC3100_SYS | |
40 | /* If compiling on host, implement traditional Unix core files with upage */ | |
41 | #undef coff_core_file_failing_command | |
42 | #define coff_core_file_failing_command trad_unix_core_file_failing_command | |
43 | #undef coff_core_file_failing_signal | |
44 | #define coff_core_file_failing_signal trad_unix_core_file_failing_signal | |
45 | #undef coff_core_file_matches_executable_p | |
46 | #define coff_core_file_matches_executable_p trad_unix_core_file_matches_executable_p | |
47 | #endif | |
48 | ||
49 | /* We do not implement symbols for ecoff. */ | |
50 | #define coff_get_symtab_upper_bound (PROTO(unsigned int, (*),(bfd *)))bfd_false | |
51 | #define coff_get_symtab (PROTO(unsigned int, (*), (bfd *, asymbol **)))bfd_0 | |
52 | #define coff_print_symbol \ | |
53 | (PROTO(void,(*),(bfd *, PTR, asymbol *, enum bfd_print_symbol))) bfd_void | |
54 | #define coff_swap_sym_in (PROTO(void,(*),(bfd *,PTR,PTR))) bfd_void | |
55 | #define coff_swap_aux_in (PROTO(void,(*),(bfd *,PTR,PTR))) bfd_void | |
56 | ||
57 | /* We do not implement linenos for ecoff. */ | |
58 | #define coff_get_lineno (struct lineno_cache_entry *(*)()) bfd_nullvoidptr | |
59 | #define coff_swap_lineno_in (PROTO(void,(*),(bfd *,PTR,PTR))) bfd_void | |
60 | #define coff_find_nearest_line (PROTO(boolean, (*),(bfd*,asection*,asymbol**,bfd_vma, CONST char**, CONST char**, unsigned int *))) bfd_false | |
61 | ||
1327fb29 SC |
62 | bfd_target ecoff_little_vec = |
63 | {"ecoff-littlemips", /* name */ | |
2b1d8a50 JG |
64 | bfd_target_coff_flavour_enum, |
65 | false, /* data byte order is little */ | |
66 | false, /* header byte order is little */ | |
1327fb29 | 67 | |
2b1d8a50 JG |
68 | (HAS_RELOC | EXEC_P | /* object flags */ |
69 | HAS_LINENO | HAS_DEBUG | | |
70 | HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT), | |
1327fb29 | 71 | |
2b1d8a50 JG |
72 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* sect flags */ |
73 | '/', /* ar_pad_char */ | |
74 | 15, /* ar_max_namelen */ | |
41f50af0 | 75 | 3, /* minimum alignment power */ |
19b03b7a SC |
76 | _do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */ |
77 | _do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* hdrs */ | |
1327fb29 | 78 | |
8e3c8f47 | 79 | {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ |
1327fb29 | 80 | bfd_generic_archive_p, _bfd_dummy_target}, |
8e3c8f47 | 81 | {bfd_false, coff_mkobject, bfd_false, /* bfd_set_format */ |
1327fb29 | 82 | bfd_false}, |
8e3c8f47 SC |
83 | {bfd_false, coff_write_object_contents, bfd_false, bfd_false}, |
84 | JUMP_TABLE (coff) | |
23b0b558 | 85 | }; |
1327fb29 SC |
86 | |
87 | bfd_target ecoff_big_vec = | |
88 | {"ecoff-bigmips", /* name */ | |
2b1d8a50 JG |
89 | bfd_target_coff_flavour_enum, |
90 | true, /* data byte order is big */ | |
91 | true, /* header byte order is big */ | |
1327fb29 | 92 | |
2b1d8a50 JG |
93 | (HAS_RELOC | EXEC_P | /* object flags */ |
94 | HAS_LINENO | HAS_DEBUG | | |
95 | HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT), | |
1327fb29 | 96 | |
2b1d8a50 JG |
97 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* sect flags */ |
98 | ' ', /* ar_pad_char */ | |
99 | 16, /* ar_max_namelen */ | |
41f50af0 | 100 | 3, /* minimum alignment power */ |
19b03b7a SC |
101 | _do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* data */ |
102 | _do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */ | |
8e3c8f47 | 103 | {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ |
68b70212 JG |
104 | bfd_generic_archive_p, |
105 | #if HOST_SYS==DEC3100_SYS | |
106 | trad_unix_core_file_p /* On host, this works */ | |
107 | #else | |
108 | _bfd_dummy_target /* Other folks get no core support */ | |
109 | #endif | |
110 | }, | |
8e3c8f47 | 111 | {bfd_false, coff_mkobject, bfd_false, /* bfd_set_format */ |
1327fb29 | 112 | bfd_false}, |
8e3c8f47 | 113 | {bfd_false, coff_write_object_contents, /* bfd_write_contents */ |
2b1d8a50 | 114 | bfd_false, bfd_false}, |
2700c3c7 SC |
115 | JUMP_TABLE(coff), |
116 | COFF_SWAP_TABLE | |
23b0b558 | 117 | }; |