Commit | Line | Data |
---|---|---|
81187b54 KR |
1 | /* Target definitions for 32-bit ELF |
2 | Copyright 1993 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of BFD, the Binary File Descriptor library. | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | ||
20 | /* This structure contains everything that BFD knows about a target. | |
21 | It includes things like its byte order, name, what routines to call | |
22 | to do various operations, etc. Every BFD points to a target structure | |
23 | with its "xvec" member. | |
24 | ||
25 | There are two such structures here: one for big-endian machines and | |
26 | one for little-endian machines. */ | |
27 | ||
28 | /* Archives are generic or unimplemented. */ | |
9942e684 KR |
29 | #ifndef bfd_elf32_slurp_armap |
30 | #define bfd_elf32_slurp_armap bfd_slurp_coff_armap | |
ae06054e | 31 | #endif |
9942e684 KR |
32 | #define bfd_elf32_slurp_extended_name_table _bfd_slurp_extended_name_table |
33 | #define bfd_elf32_truncate_arname bfd_dont_truncate_arname | |
34 | #define bfd_elf32_openr_next_archived_file bfd_generic_openr_next_archived_file | |
35 | #define bfd_elf32_generic_stat_arch_elt bfd_generic_stat_arch_elt | |
36 | #ifndef bfd_elf32_write_armap | |
37 | #define bfd_elf32_write_armap coff_write_armap | |
ae06054e | 38 | #endif |
81187b54 KR |
39 | |
40 | /* Ordinary section reading and writing */ | |
9942e684 KR |
41 | #define bfd_elf32_new_section_hook _bfd_dummy_new_section_hook |
42 | #define bfd_elf32_get_section_contents bfd_generic_get_section_contents | |
43 | #define bfd_elf32_close_and_cleanup bfd_generic_close_and_cleanup | |
44 | ||
45 | #define bfd_elf32_bfd_debug_info_start bfd_void | |
46 | #define bfd_elf32_bfd_debug_info_end bfd_void | |
47 | #define bfd_elf32_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void | |
48 | #define bfd_elf32_bfd_get_relocated_section_contents \ | |
81187b54 | 49 | bfd_generic_get_relocated_section_contents |
9942e684 KR |
50 | #define bfd_elf32_bfd_relax_section bfd_generic_relax_section |
51 | #define bfd_elf32_bfd_seclet_link bfd_generic_seclet_link | |
52 | #define bfd_elf32_bfd_make_debug_symbol \ | |
81187b54 KR |
53 | ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) |
54 | ||
9942e684 | 55 | static CONST struct elf32_backend_data elf32_bed = |
81187b54 KR |
56 | { |
57 | elf_info_to_howto, | |
58 | ELF_ARCH, | |
59 | }; | |
60 | ||
61 | #ifdef TARGET_BIG_SYM | |
62 | bfd_target TARGET_BIG_SYM = | |
63 | { | |
64 | /* name: identify kind of target */ | |
65 | TARGET_BIG_NAME, | |
66 | ||
67 | /* flavour: general indication about file */ | |
68 | bfd_target_elf_flavour, | |
69 | ||
70 | /* byteorder_big_p: data is big endian */ | |
71 | true, | |
72 | ||
73 | /* header_byteorder_big_p: header is also big endian */ | |
74 | true, | |
75 | ||
76 | /* object_flags: mask of all file flags */ | |
77 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | | |
78 | DYNAMIC | WP_TEXT), | |
79 | ||
80 | /* section_flags: mask of all section flags */ | |
81 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | | |
82 | SEC_CODE | SEC_DATA), | |
83 | ||
84 | /* leading_symbol_char: is the first char of a user symbol | |
85 | predictable, and if so what is it */ | |
86 | 0, | |
87 | ||
88 | /* ar_pad_char: pad character for filenames within an archive header | |
89 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
90 | of the archiver and/or os and should be independently tunable */ | |
91 | '/', | |
92 | ||
93 | /* ar_max_namelen: maximum number of characters in an archive header | |
94 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
95 | of the archiver and should be independently tunable. This value is | |
96 | a WAG (wild a** guess) */ | |
97 | 15, | |
98 | ||
99 | /* align_power_min: minimum alignment restriction for any section | |
100 | FIXME: this value may be target machine dependent */ | |
101 | 3, | |
102 | ||
103 | /* Routines to byte-swap various sized integers from the data sections */ | |
14e3c2e4 JK |
104 | _do_getb64, _do_getb_signed_64, _do_putb64, |
105 | _do_getb32, _do_getb_signed_32, _do_putb32, | |
106 | _do_getb16, _do_getb_signed_16, _do_putb16, | |
81187b54 KR |
107 | |
108 | /* Routines to byte-swap various sized integers from the file headers */ | |
14e3c2e4 JK |
109 | _do_getb64, _do_getb_signed_64, _do_putb64, |
110 | _do_getb32, _do_getb_signed_32, _do_putb32, | |
111 | _do_getb16, _do_getb_signed_16, _do_putb16, | |
81187b54 KR |
112 | |
113 | /* bfd_check_format: check the format of a file being read */ | |
114 | { _bfd_dummy_target, /* unknown format */ | |
9942e684 | 115 | bfd_elf32_object_p, /* assembler/linker output (object file) */ |
81187b54 | 116 | bfd_generic_archive_p, /* an archive */ |
9942e684 | 117 | bfd_elf32_core_file_p /* a core file */ |
81187b54 KR |
118 | }, |
119 | ||
120 | /* bfd_set_format: set the format of a file being written */ | |
121 | { bfd_false, | |
9942e684 | 122 | bfd_elf32_mkobject, |
81187b54 KR |
123 | _bfd_generic_mkarchive, |
124 | bfd_false | |
125 | }, | |
126 | ||
127 | /* bfd_write_contents: write cached information into a file being written */ | |
128 | { bfd_false, | |
9942e684 | 129 | bfd_elf32_write_object_contents, |
81187b54 KR |
130 | _bfd_write_archive_contents, |
131 | bfd_false | |
132 | }, | |
133 | ||
134 | /* Initialize a jump table with the standard macro. All names start with | |
135 | "elf" */ | |
9942e684 | 136 | JUMP_TABLE(bfd_elf32), |
81187b54 KR |
137 | |
138 | /* backend_data: */ | |
9942e684 | 139 | (PTR) &elf32_bed, |
81187b54 KR |
140 | }; |
141 | #endif | |
142 | ||
143 | #ifdef TARGET_LITTLE_SYM | |
144 | bfd_target TARGET_LITTLE_SYM = | |
145 | { | |
146 | /* name: identify kind of target */ | |
147 | TARGET_LITTLE_NAME, | |
148 | ||
149 | /* flavour: general indication about file */ | |
150 | bfd_target_elf_flavour, | |
151 | ||
152 | /* byteorder_big_p: data is big endian */ | |
153 | false, /* Nope -- this one's little endian */ | |
154 | ||
155 | /* header_byteorder_big_p: header is also big endian */ | |
156 | false, /* Nope -- this one's little endian */ | |
157 | ||
158 | /* object_flags: mask of all file flags */ | |
159 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | | |
160 | DYNAMIC | WP_TEXT), | |
161 | ||
162 | /* section_flags: mask of all section flags */ | |
163 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | | |
164 | SEC_DATA), | |
165 | ||
166 | /* leading_symbol_char: is the first char of a user symbol | |
167 | predictable, and if so what is it */ | |
168 | 0, | |
169 | ||
170 | /* ar_pad_char: pad character for filenames within an archive header | |
171 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
172 | of the archiver and/or os and should be independently tunable */ | |
173 | '/', | |
174 | ||
175 | /* ar_max_namelen: maximum number of characters in an archive header | |
176 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
177 | of the archiver and should be independently tunable. This value is | |
178 | a WAG (wild a** guess) */ | |
179 | 15, | |
180 | ||
181 | /* align_power_min: minimum alignment restriction for any section | |
182 | FIXME: this value may be target machine dependent */ | |
183 | 3, | |
184 | ||
185 | /* Routines to byte-swap various sized integers from the data sections */ | |
14e3c2e4 JK |
186 | _do_getl64, _do_getl_signed_64, _do_putl64, |
187 | _do_getl32, _do_getl_signed_32, _do_putl32, | |
188 | _do_getl16, _do_getl_signed_16, _do_putl16, | |
81187b54 KR |
189 | |
190 | /* Routines to byte-swap various sized integers from the file headers */ | |
14e3c2e4 JK |
191 | _do_getl64, _do_getl_signed_64, _do_putl64, |
192 | _do_getl32, _do_getl_signed_32, _do_putl32, | |
193 | _do_getl16, _do_getl_signed_16, _do_putl16, | |
81187b54 KR |
194 | |
195 | /* bfd_check_format: check the format of a file being read */ | |
196 | { _bfd_dummy_target, /* unknown format */ | |
9942e684 | 197 | bfd_elf32_object_p, /* assembler/linker output (object file) */ |
81187b54 | 198 | bfd_generic_archive_p, /* an archive */ |
9942e684 | 199 | bfd_elf32_core_file_p /* a core file */ |
81187b54 KR |
200 | }, |
201 | ||
202 | /* bfd_set_format: set the format of a file being written */ | |
203 | { bfd_false, | |
9942e684 | 204 | bfd_elf32_mkobject, |
81187b54 KR |
205 | _bfd_generic_mkarchive, |
206 | bfd_false | |
207 | }, | |
208 | ||
209 | /* bfd_write_contents: write cached information into a file being written */ | |
210 | { bfd_false, | |
9942e684 | 211 | bfd_elf32_write_object_contents, |
81187b54 KR |
212 | _bfd_write_archive_contents, |
213 | bfd_false | |
214 | }, | |
215 | ||
216 | /* Initialize a jump table with the standard macro. All names start with | |
217 | "elf" */ | |
9942e684 | 218 | JUMP_TABLE(bfd_elf32), |
81187b54 KR |
219 | |
220 | /* backend_data: */ | |
9942e684 | 221 | (PTR) &elf32_bed, |
81187b54 KR |
222 | }; |
223 | #endif |