]>
Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* Target definitions for NN-bit ELF |
f0abc2a1 AM |
2 | Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
3 | 2003 Free Software Foundation, Inc. | |
252b5132 | 4 | |
5e8d7549 | 5 | This file is part of BFD, the Binary File Descriptor library. |
252b5132 | 6 | |
5e8d7549 NC |
7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2 of the License, or | |
10 | (at your option) any later version. | |
252b5132 | 11 | |
5e8d7549 NC |
12 | This program is distributed in the hope that it will be useful, |
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. | |
252b5132 | 16 | |
5e8d7549 NC |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
252b5132 RH |
20 | |
21 | /* This structure contains everything that BFD knows about a target. | |
22 | It includes things like its byte order, name, what routines to call | |
23 | to do various operations, etc. Every BFD points to a target structure | |
24 | with its "xvec" member. | |
25 | ||
26 | There are two such structures here: one for big-endian machines and | |
27 | one for little-endian machines. */ | |
28 | ||
29 | #define bfd_elfNN_close_and_cleanup _bfd_elf_close_and_cleanup | |
30 | #define bfd_elfNN_bfd_free_cached_info _bfd_generic_bfd_free_cached_info | |
31 | #ifndef bfd_elfNN_get_section_contents | |
32 | #define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents | |
33 | #endif | |
34 | ||
e656e369 AM |
35 | #define bfd_elfNN_canonicalize_dynamic_symtab \ |
36 | _bfd_elf_canonicalize_dynamic_symtab | |
fee24f1c | 37 | #ifndef bfd_elfNN_canonicalize_reloc |
252b5132 | 38 | #define bfd_elfNN_canonicalize_reloc _bfd_elf_canonicalize_reloc |
fee24f1c | 39 | #endif |
252b5132 RH |
40 | #ifndef bfd_elfNN_find_nearest_line |
41 | #define bfd_elfNN_find_nearest_line _bfd_elf_find_nearest_line | |
42 | #endif | |
43 | #define bfd_elfNN_read_minisymbols _bfd_elf_read_minisymbols | |
44 | #define bfd_elfNN_minisymbol_to_symbol _bfd_elf_minisymbol_to_symbol | |
e656e369 AM |
45 | #define bfd_elfNN_get_dynamic_symtab_upper_bound \ |
46 | _bfd_elf_get_dynamic_symtab_upper_bound | |
252b5132 RH |
47 | #define bfd_elfNN_get_lineno _bfd_elf_get_lineno |
48 | #ifndef bfd_elfNN_get_reloc_upper_bound | |
49 | #define bfd_elfNN_get_reloc_upper_bound _bfd_elf_get_reloc_upper_bound | |
50 | #endif | |
7cdc5bba | 51 | #ifndef bfd_elfNN_get_symbol_info |
252b5132 | 52 | #define bfd_elfNN_get_symbol_info _bfd_elf_get_symbol_info |
7cdc5bba | 53 | #endif |
6cee3f79 | 54 | #define bfd_elfNN_canonicalize_symtab _bfd_elf_canonicalize_symtab |
252b5132 | 55 | #define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound |
252b5132 | 56 | #define bfd_elfNN_make_empty_symbol _bfd_elf_make_empty_symbol |
f0abc2a1 | 57 | #ifndef bfd_elfNN_new_section_hook |
252b5132 | 58 | #define bfd_elfNN_new_section_hook _bfd_elf_new_section_hook |
f0abc2a1 | 59 | #endif |
252b5132 RH |
60 | #define bfd_elfNN_set_arch_mach _bfd_elf_set_arch_mach |
61 | #ifndef bfd_elfNN_set_section_contents | |
62 | #define bfd_elfNN_set_section_contents _bfd_elf_set_section_contents | |
63 | #endif | |
64 | #define bfd_elfNN_sizeof_headers _bfd_elf_sizeof_headers | |
65 | #define bfd_elfNN_write_object_contents _bfd_elf_write_object_contents | |
66 | #define bfd_elfNN_write_corefile_contents _bfd_elf_write_corefile_contents | |
67 | ||
68 | #define bfd_elfNN_get_section_contents_in_window \ | |
69 | _bfd_generic_get_section_contents_in_window | |
70 | ||
71 | #ifndef elf_backend_got_symbol_offset | |
72 | #define elf_backend_got_symbol_offset (bfd_vma) 0 | |
73 | #endif | |
3c3bdf30 NC |
74 | #ifndef elf_backend_can_refcount |
75 | #define elf_backend_can_refcount 0 | |
76 | #endif | |
252b5132 RH |
77 | #ifndef elf_backend_want_got_plt |
78 | #define elf_backend_want_got_plt 0 | |
79 | #endif | |
80 | #ifndef elf_backend_plt_readonly | |
81 | #define elf_backend_plt_readonly 0 | |
82 | #endif | |
83 | #ifndef elf_backend_want_plt_sym | |
84 | #define elf_backend_want_plt_sym 0 | |
85 | #endif | |
86 | #ifndef elf_backend_plt_not_loaded | |
87 | #define elf_backend_plt_not_loaded 0 | |
88 | #endif | |
89 | #ifndef elf_backend_plt_alignment | |
90 | #define elf_backend_plt_alignment 2 | |
91 | #endif | |
3018b441 RH |
92 | #ifndef elf_backend_want_dynbss |
93 | #define elf_backend_want_dynbss 1 | |
94 | #endif | |
5e8d7549 NC |
95 | #ifndef elf_backend_want_p_paddr_set_to_zero |
96 | #define elf_backend_want_p_paddr_set_to_zero 0 | |
97 | #endif | |
252b5132 RH |
98 | |
99 | #define bfd_elfNN_bfd_debug_info_start bfd_void | |
100 | #define bfd_elfNN_bfd_debug_info_end bfd_void | |
dc810e39 | 101 | #define bfd_elfNN_bfd_debug_info_accumulate \ |
198beae2 | 102 | ((void (*) (bfd*, struct bfd_section *)) bfd_void) |
252b5132 RH |
103 | |
104 | #ifndef bfd_elfNN_bfd_get_relocated_section_contents | |
105 | #define bfd_elfNN_bfd_get_relocated_section_contents \ | |
e656e369 | 106 | bfd_generic_get_relocated_section_contents |
252b5132 RH |
107 | #endif |
108 | ||
109 | #ifndef bfd_elfNN_bfd_relax_section | |
110 | #define bfd_elfNN_bfd_relax_section bfd_generic_relax_section | |
111 | #endif | |
112 | ||
113 | #ifndef elf_backend_can_gc_sections | |
114 | #define elf_backend_can_gc_sections 0 | |
115 | #endif | |
51b64d56 AM |
116 | #ifndef elf_backend_can_refcount |
117 | #define elf_backend_can_refcount 0 | |
118 | #endif | |
2517a57f AM |
119 | #ifndef elf_backend_want_got_sym |
120 | #define elf_backend_want_got_sym 1 | |
121 | #endif | |
252b5132 RH |
122 | #ifndef elf_backend_gc_mark_hook |
123 | #define elf_backend_gc_mark_hook NULL | |
124 | #endif | |
125 | #ifndef elf_backend_gc_sweep_hook | |
126 | #define elf_backend_gc_sweep_hook NULL | |
127 | #endif | |
128 | #ifndef bfd_elfNN_bfd_gc_sections | |
c152c796 | 129 | #define bfd_elfNN_bfd_gc_sections bfd_elf_gc_sections |
252b5132 RH |
130 | #endif |
131 | ||
8550eb6e JJ |
132 | #ifndef bfd_elfNN_bfd_merge_sections |
133 | #define bfd_elfNN_bfd_merge_sections \ | |
134 | _bfd_elf_merge_sections | |
135 | #endif | |
136 | ||
e61463e1 AM |
137 | #ifndef bfd_elfNN_bfd_discard_group |
138 | #define bfd_elfNN_bfd_discard_group bfd_elf_discard_group | |
139 | #endif | |
140 | ||
d1cf510e | 141 | #ifndef bfd_elfNN_bfd_make_debug_symbol |
252b5132 | 142 | #define bfd_elfNN_bfd_make_debug_symbol \ |
e656e369 | 143 | ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) |
d1cf510e | 144 | #endif |
252b5132 RH |
145 | |
146 | #ifndef bfd_elfNN_bfd_copy_private_symbol_data | |
147 | #define bfd_elfNN_bfd_copy_private_symbol_data \ | |
148 | _bfd_elf_copy_private_symbol_data | |
149 | #endif | |
150 | ||
151 | #ifndef bfd_elfNN_bfd_copy_private_section_data | |
152 | #define bfd_elfNN_bfd_copy_private_section_data \ | |
153 | _bfd_elf_copy_private_section_data | |
154 | #endif | |
155 | #ifndef bfd_elfNN_bfd_copy_private_bfd_data | |
156 | #define bfd_elfNN_bfd_copy_private_bfd_data \ | |
2d502050 | 157 | _bfd_elf_copy_private_bfd_data |
252b5132 RH |
158 | #endif |
159 | #ifndef bfd_elfNN_bfd_print_private_bfd_data | |
160 | #define bfd_elfNN_bfd_print_private_bfd_data \ | |
161 | _bfd_elf_print_private_bfd_data | |
162 | #endif | |
163 | #ifndef bfd_elfNN_bfd_merge_private_bfd_data | |
164 | #define bfd_elfNN_bfd_merge_private_bfd_data \ | |
e656e369 | 165 | ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) |
252b5132 RH |
166 | #endif |
167 | #ifndef bfd_elfNN_bfd_set_private_flags | |
168 | #define bfd_elfNN_bfd_set_private_flags \ | |
e656e369 | 169 | ((bfd_boolean (*) (bfd *, flagword)) bfd_true) |
252b5132 RH |
170 | #endif |
171 | #ifndef bfd_elfNN_bfd_is_local_label_name | |
172 | #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name | |
173 | #endif | |
174 | ||
175 | #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound | |
176 | #define bfd_elfNN_get_dynamic_reloc_upper_bound \ | |
177 | _bfd_elf_get_dynamic_reloc_upper_bound | |
178 | #endif | |
179 | #ifndef bfd_elfNN_canonicalize_dynamic_reloc | |
180 | #define bfd_elfNN_canonicalize_dynamic_reloc \ | |
181 | _bfd_elf_canonicalize_dynamic_reloc | |
182 | #endif | |
183 | ||
e2d34d7d DJ |
184 | #ifndef bfd_elfNN_bfd_link_hash_table_free |
185 | #define bfd_elfNN_bfd_link_hash_table_free _bfd_generic_link_hash_table_free | |
186 | #endif | |
187 | ||
8ea2e4bd | 188 | #ifdef elf_backend_relocate_section |
252b5132 RH |
189 | #ifndef bfd_elfNN_bfd_link_hash_table_create |
190 | #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create | |
191 | #endif | |
4ad4eba5 AM |
192 | #ifndef bfd_elfNN_bfd_link_add_symbols |
193 | #define bfd_elfNN_bfd_link_add_symbols bfd_elf_link_add_symbols | |
194 | #endif | |
c152c796 AM |
195 | #ifndef bfd_elfNN_bfd_final_link |
196 | #define bfd_elfNN_bfd_final_link bfd_elf_final_link | |
197 | #endif | |
8ea2e4bd NC |
198 | #else /* ! defined (elf_backend_relocate_section) */ |
199 | /* If no backend relocate_section routine, use the generic linker. | |
200 | Note - this will prevent the port from being able to use some of | |
201 | the other features of the ELF linker, because the generic hash structure | |
202 | does not have the fields needed by the ELF linker. In particular it | |
203 | means that linking directly to S-records will not work. */ | |
204 | #ifndef bfd_elfNN_bfd_link_hash_table_create | |
205 | #define bfd_elfNN_bfd_link_hash_table_create \ | |
206 | _bfd_generic_link_hash_table_create | |
207 | #endif | |
252b5132 RH |
208 | #ifndef bfd_elfNN_bfd_link_add_symbols |
209 | #define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols | |
210 | #endif | |
211 | #ifndef bfd_elfNN_bfd_final_link | |
212 | #define bfd_elfNN_bfd_final_link _bfd_generic_final_link | |
213 | #endif | |
214 | #endif /* ! defined (elf_backend_relocate_section) */ | |
2d653fc7 AM |
215 | |
216 | #ifndef bfd_elfNN_bfd_link_just_syms | |
217 | #define bfd_elfNN_bfd_link_just_syms _bfd_elf_link_just_syms | |
218 | #endif | |
219 | ||
252b5132 RH |
220 | #ifndef bfd_elfNN_bfd_link_split_section |
221 | #define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section | |
222 | #endif | |
223 | ||
224 | #ifndef bfd_elfNN_archive_p | |
225 | #define bfd_elfNN_archive_p bfd_generic_archive_p | |
226 | #endif | |
227 | ||
228 | #ifndef bfd_elfNN_write_archive_contents | |
229 | #define bfd_elfNN_write_archive_contents _bfd_write_archive_contents | |
230 | #endif | |
231 | ||
232 | #ifndef bfd_elfNN_mkobject | |
233 | #define bfd_elfNN_mkobject bfd_elf_mkobject | |
234 | #endif | |
235 | ||
236 | #ifndef bfd_elfNN_mkcorefile | |
237 | #define bfd_elfNN_mkcorefile bfd_elf_mkcorefile | |
238 | #endif | |
239 | ||
240 | #ifndef bfd_elfNN_mkarchive | |
241 | #define bfd_elfNN_mkarchive _bfd_generic_mkarchive | |
242 | #endif | |
243 | ||
c152c796 AM |
244 | #ifndef bfd_elfNN_print_symbol |
245 | #define bfd_elfNN_print_symbol bfd_elf_print_symbol | |
246 | #endif | |
247 | ||
252b5132 RH |
248 | #ifndef elf_symbol_leading_char |
249 | #define elf_symbol_leading_char 0 | |
250 | #endif | |
251 | ||
252 | #ifndef elf_info_to_howto | |
253 | #define elf_info_to_howto 0 | |
254 | #endif | |
255 | ||
256 | #ifndef elf_info_to_howto_rel | |
257 | #define elf_info_to_howto_rel 0 | |
258 | #endif | |
259 | ||
260 | #ifndef ELF_MAXPAGESIZE | |
79e5982f NC |
261 | #error ELF_MAXPAGESIZE is not defined |
262 | #define ELF_MAXPAGESIZE 1 | |
252b5132 RH |
263 | #endif |
264 | ||
265 | #ifndef elf_backend_collect | |
b34976b6 | 266 | #define elf_backend_collect FALSE |
252b5132 RH |
267 | #endif |
268 | #ifndef elf_backend_type_change_ok | |
b34976b6 | 269 | #define elf_backend_type_change_ok FALSE |
252b5132 RH |
270 | #endif |
271 | ||
272 | #ifndef elf_backend_sym_is_global | |
273 | #define elf_backend_sym_is_global 0 | |
274 | #endif | |
275 | #ifndef elf_backend_object_p | |
276 | #define elf_backend_object_p 0 | |
277 | #endif | |
278 | #ifndef elf_backend_symbol_processing | |
279 | #define elf_backend_symbol_processing 0 | |
280 | #endif | |
281 | #ifndef elf_backend_symbol_table_processing | |
282 | #define elf_backend_symbol_table_processing 0 | |
283 | #endif | |
284 | #ifndef elf_backend_get_symbol_type | |
285 | #define elf_backend_get_symbol_type 0 | |
286 | #endif | |
174fd7f9 RS |
287 | #ifndef elf_backend_name_local_section_symbols |
288 | #define elf_backend_name_local_section_symbols 0 | |
289 | #endif | |
252b5132 RH |
290 | #ifndef elf_backend_section_processing |
291 | #define elf_backend_section_processing 0 | |
292 | #endif | |
293 | #ifndef elf_backend_section_from_shdr | |
294 | #define elf_backend_section_from_shdr 0 | |
295 | #endif | |
fa152c49 JW |
296 | #ifndef elf_backend_section_flags |
297 | #define elf_backend_section_flags 0 | |
298 | #endif | |
20cfcaae NC |
299 | #ifndef elf_backend_section_from_phdr |
300 | #define elf_backend_section_from_phdr 0 | |
301 | #endif | |
252b5132 RH |
302 | #ifndef elf_backend_fake_sections |
303 | #define elf_backend_fake_sections 0 | |
304 | #endif | |
305 | #ifndef elf_backend_section_from_bfd_section | |
306 | #define elf_backend_section_from_bfd_section 0 | |
307 | #endif | |
308 | #ifndef elf_backend_add_symbol_hook | |
309 | #define elf_backend_add_symbol_hook 0 | |
310 | #endif | |
311 | #ifndef elf_backend_link_output_symbol_hook | |
312 | #define elf_backend_link_output_symbol_hook 0 | |
313 | #endif | |
314 | #ifndef elf_backend_create_dynamic_sections | |
315 | #define elf_backend_create_dynamic_sections 0 | |
316 | #endif | |
317 | #ifndef elf_backend_check_relocs | |
318 | #define elf_backend_check_relocs 0 | |
319 | #endif | |
320 | #ifndef elf_backend_adjust_dynamic_symbol | |
321 | #define elf_backend_adjust_dynamic_symbol 0 | |
322 | #endif | |
323 | #ifndef elf_backend_always_size_sections | |
324 | #define elf_backend_always_size_sections 0 | |
325 | #endif | |
326 | #ifndef elf_backend_size_dynamic_sections | |
327 | #define elf_backend_size_dynamic_sections 0 | |
328 | #endif | |
329 | #ifndef elf_backend_relocate_section | |
330 | #define elf_backend_relocate_section 0 | |
331 | #endif | |
332 | #ifndef elf_backend_finish_dynamic_symbol | |
333 | #define elf_backend_finish_dynamic_symbol 0 | |
334 | #endif | |
335 | #ifndef elf_backend_finish_dynamic_sections | |
336 | #define elf_backend_finish_dynamic_sections 0 | |
337 | #endif | |
338 | #ifndef elf_backend_begin_write_processing | |
339 | #define elf_backend_begin_write_processing 0 | |
340 | #endif | |
341 | #ifndef elf_backend_final_write_processing | |
342 | #define elf_backend_final_write_processing 0 | |
343 | #endif | |
344 | #ifndef elf_backend_additional_program_headers | |
345 | #define elf_backend_additional_program_headers 0 | |
346 | #endif | |
347 | #ifndef elf_backend_modify_segment_map | |
348 | #define elf_backend_modify_segment_map 0 | |
349 | #endif | |
350 | #ifndef elf_backend_ecoff_debug_swap | |
351 | #define elf_backend_ecoff_debug_swap 0 | |
352 | #endif | |
8d6337fe RM |
353 | #ifndef elf_backend_bfd_from_remote_memory |
354 | #define elf_backend_bfd_from_remote_memory _bfd_elfNN_bfd_from_remote_memory | |
355 | #endif | |
252b5132 RH |
356 | #ifndef elf_backend_got_header_size |
357 | #define elf_backend_got_header_size 0 | |
358 | #endif | |
e6c51ed4 NC |
359 | #ifndef elf_backend_post_process_headers |
360 | #define elf_backend_post_process_headers NULL | |
361 | #endif | |
587ff49e RH |
362 | #ifndef elf_backend_print_symbol_all |
363 | #define elf_backend_print_symbol_all NULL | |
364 | #endif | |
365 | #ifndef elf_backend_output_arch_syms | |
366 | #define elf_backend_output_arch_syms NULL | |
367 | #endif | |
c61b8717 RH |
368 | #ifndef elf_backend_copy_indirect_symbol |
369 | #define elf_backend_copy_indirect_symbol _bfd_elf_link_hash_copy_indirect | |
370 | #endif | |
371 | #ifndef elf_backend_hide_symbol | |
372 | #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol | |
373 | #endif | |
9bf7216d KK |
374 | #ifndef elf_backend_merge_symbol_attribute |
375 | #define elf_backend_merge_symbol_attribute NULL | |
376 | #endif | |
9317eacc CM |
377 | #ifndef elf_backend_emit_relocs |
378 | #define elf_backend_emit_relocs NULL | |
379 | #endif | |
380 | #ifndef elf_backend_count_relocs | |
381 | #define elf_backend_count_relocs NULL | |
382 | #endif | |
bb0082d6 AM |
383 | #ifndef elf_backend_grok_prstatus |
384 | #define elf_backend_grok_prstatus NULL | |
385 | #endif | |
386 | #ifndef elf_backend_grok_psinfo | |
387 | #define elf_backend_grok_psinfo NULL | |
388 | #endif | |
4e771d61 NC |
389 | #ifndef elf_backend_sprintf_vma |
390 | #define elf_backend_sprintf_vma _bfd_elf_sprintf_vma | |
391 | #endif | |
392 | #ifndef elf_backend_fprintf_vma | |
393 | #define elf_backend_fprintf_vma _bfd_elf_fprintf_vma | |
394 | #endif | |
db6751f2 JJ |
395 | #ifndef elf_backend_reloc_type_class |
396 | #define elf_backend_reloc_type_class _bfd_elf_reloc_type_class | |
397 | #endif | |
73d074b4 DJ |
398 | #ifndef elf_backend_discard_info |
399 | #define elf_backend_discard_info NULL | |
400 | #endif | |
401 | #ifndef elf_backend_ignore_discarded_relocs | |
402 | #define elf_backend_ignore_discarded_relocs NULL | |
403 | #endif | |
ec3391e7 AO |
404 | #ifndef elf_backend_can_make_relative_eh_frame |
405 | #define elf_backend_can_make_relative_eh_frame _bfd_elf_can_make_relative | |
406 | #endif | |
407 | #ifndef elf_backend_can_make_lsda_relative_eh_frame | |
408 | #define elf_backend_can_make_lsda_relative_eh_frame _bfd_elf_can_make_relative | |
409 | #endif | |
410 | #ifndef elf_backend_encode_eh_address | |
411 | #define elf_backend_encode_eh_address _bfd_elf_encode_eh_address | |
412 | #endif | |
73d074b4 DJ |
413 | #ifndef elf_backend_write_section |
414 | #define elf_backend_write_section NULL | |
415 | #endif | |
c6e90b02 TS |
416 | #ifndef elf_backend_mips_irix_compat |
417 | #define elf_backend_mips_irix_compat NULL | |
418 | #endif | |
419 | #ifndef elf_backend_mips_rtype_to_howto | |
420 | #define elf_backend_mips_rtype_to_howto NULL | |
421 | #endif | |
c61b8717 | 422 | |
bf572ba0 MM |
423 | /* Previously, backends could only use SHT_REL or SHT_RELA relocation |
424 | sections, but not both. They defined USE_REL to indicate SHT_REL | |
425 | sections, and left it undefined to indicated SHT_RELA sections. | |
426 | For backwards compatibility, we still support this usage. */ | |
427 | #ifndef USE_REL | |
428 | #define USE_REL 0 | |
3e932841 | 429 | #endif |
bf572ba0 MM |
430 | |
431 | /* Use these in new code. */ | |
3e932841 | 432 | #ifndef elf_backend_may_use_rel_p |
bf572ba0 | 433 | #define elf_backend_may_use_rel_p USE_REL |
3e932841 | 434 | #endif |
bf572ba0 MM |
435 | #ifndef elf_backend_may_use_rela_p |
436 | #define elf_backend_may_use_rela_p !USE_REL | |
437 | #endif | |
3e932841 | 438 | #ifndef elf_backend_default_use_rela_p |
bf572ba0 MM |
439 | #define elf_backend_default_use_rela_p !USE_REL |
440 | #endif | |
441 | ||
b491616a AM |
442 | #ifndef elf_backend_rela_normal |
443 | #define elf_backend_rela_normal 0 | |
444 | #endif | |
445 | ||
252b5132 RH |
446 | #ifndef ELF_MACHINE_ALT1 |
447 | #define ELF_MACHINE_ALT1 0 | |
448 | #endif | |
449 | ||
450 | #ifndef ELF_MACHINE_ALT2 | |
451 | #define ELF_MACHINE_ALT2 0 | |
452 | #endif | |
453 | ||
454 | #ifndef elf_backend_size_info | |
455 | #define elf_backend_size_info _bfd_elfNN_size_info | |
456 | #endif | |
457 | ||
2f89ff8d L |
458 | #ifndef elf_backend_special_sections |
459 | #define elf_backend_special_sections NULL | |
460 | #endif | |
461 | ||
86dc0f79 RH |
462 | #ifndef elf_backend_sign_extend_vma |
463 | #define elf_backend_sign_extend_vma 0 | |
464 | #endif | |
465 | ||
252b5132 RH |
466 | extern const struct elf_size_info _bfd_elfNN_size_info; |
467 | ||
dd745cfa | 468 | #ifndef INCLUDED_TARGET_FILE |
dc810e39 | 469 | static const struct elf_backend_data elfNN_bed = |
252b5132 | 470 | { |
252b5132 RH |
471 | ELF_ARCH, /* arch */ |
472 | ELF_MACHINE_CODE, /* elf_machine_code */ | |
473 | ELF_MAXPAGESIZE, /* maxpagesize */ | |
252b5132 RH |
474 | elf_info_to_howto, |
475 | elf_info_to_howto_rel, | |
476 | elf_backend_sym_is_global, | |
477 | elf_backend_object_p, | |
478 | elf_backend_symbol_processing, | |
479 | elf_backend_symbol_table_processing, | |
480 | elf_backend_get_symbol_type, | |
174fd7f9 | 481 | elf_backend_name_local_section_symbols, |
252b5132 RH |
482 | elf_backend_section_processing, |
483 | elf_backend_section_from_shdr, | |
fa152c49 | 484 | elf_backend_section_flags, |
20cfcaae | 485 | elf_backend_section_from_phdr, |
252b5132 RH |
486 | elf_backend_fake_sections, |
487 | elf_backend_section_from_bfd_section, | |
488 | elf_backend_add_symbol_hook, | |
489 | elf_backend_link_output_symbol_hook, | |
490 | elf_backend_create_dynamic_sections, | |
491 | elf_backend_check_relocs, | |
492 | elf_backend_adjust_dynamic_symbol, | |
493 | elf_backend_always_size_sections, | |
494 | elf_backend_size_dynamic_sections, | |
495 | elf_backend_relocate_section, | |
496 | elf_backend_finish_dynamic_symbol, | |
497 | elf_backend_finish_dynamic_sections, | |
498 | elf_backend_begin_write_processing, | |
499 | elf_backend_final_write_processing, | |
500 | elf_backend_additional_program_headers, | |
501 | elf_backend_modify_segment_map, | |
502 | elf_backend_gc_mark_hook, | |
503 | elf_backend_gc_sweep_hook, | |
e6c51ed4 | 504 | elf_backend_post_process_headers, |
587ff49e RH |
505 | elf_backend_print_symbol_all, |
506 | elf_backend_output_arch_syms, | |
c61b8717 RH |
507 | elf_backend_copy_indirect_symbol, |
508 | elf_backend_hide_symbol, | |
9bf7216d | 509 | elf_backend_merge_symbol_attribute, |
9317eacc CM |
510 | elf_backend_emit_relocs, |
511 | elf_backend_count_relocs, | |
bb0082d6 AM |
512 | elf_backend_grok_prstatus, |
513 | elf_backend_grok_psinfo, | |
4e771d61 NC |
514 | elf_backend_sprintf_vma, |
515 | elf_backend_fprintf_vma, | |
db6751f2 | 516 | elf_backend_reloc_type_class, |
73d074b4 DJ |
517 | elf_backend_discard_info, |
518 | elf_backend_ignore_discarded_relocs, | |
ec3391e7 AO |
519 | elf_backend_can_make_relative_eh_frame, |
520 | elf_backend_can_make_lsda_relative_eh_frame, | |
521 | elf_backend_encode_eh_address, | |
73d074b4 | 522 | elf_backend_write_section, |
c6e90b02 TS |
523 | elf_backend_mips_irix_compat, |
524 | elf_backend_mips_rtype_to_howto, | |
252b5132 | 525 | elf_backend_ecoff_debug_swap, |
8d6337fe | 526 | elf_backend_bfd_from_remote_memory, |
252b5132 RH |
527 | ELF_MACHINE_ALT1, |
528 | ELF_MACHINE_ALT2, | |
529 | &elf_backend_size_info, | |
2f89ff8d | 530 | elf_backend_special_sections, |
252b5132 RH |
531 | elf_backend_got_symbol_offset, |
532 | elf_backend_got_header_size, | |
86dc0f79 RH |
533 | elf_backend_collect, |
534 | elf_backend_type_change_ok, | |
bf572ba0 MM |
535 | elf_backend_may_use_rel_p, |
536 | elf_backend_may_use_rela_p, | |
537 | elf_backend_default_use_rela_p, | |
b491616a | 538 | elf_backend_rela_normal, |
86dc0f79 | 539 | elf_backend_sign_extend_vma, |
252b5132 RH |
540 | elf_backend_want_got_plt, |
541 | elf_backend_plt_readonly, | |
542 | elf_backend_want_plt_sym, | |
543 | elf_backend_plt_not_loaded, | |
544 | elf_backend_plt_alignment, | |
2ac8ce5f | 545 | elf_backend_can_gc_sections, |
51b64d56 | 546 | elf_backend_can_refcount, |
7fda6dbc | 547 | elf_backend_want_got_sym, |
5e8d7549 NC |
548 | elf_backend_want_dynbss, |
549 | elf_backend_want_p_paddr_set_to_zero | |
252b5132 | 550 | }; |
dd745cfa | 551 | #endif |
252b5132 | 552 | |
c3c89269 NC |
553 | /* Forward declaration for use when initialising alternative_target field. */ |
554 | #ifdef TARGET_LITTLE_SYM | |
555 | extern const bfd_target TARGET_LITTLE_SYM; | |
556 | #endif | |
557 | ||
252b5132 RH |
558 | #ifdef TARGET_BIG_SYM |
559 | const bfd_target TARGET_BIG_SYM = | |
560 | { | |
561 | /* name: identify kind of target */ | |
562 | TARGET_BIG_NAME, | |
563 | ||
564 | /* flavour: general indication about file */ | |
565 | bfd_target_elf_flavour, | |
566 | ||
567 | /* byteorder: data is big endian */ | |
568 | BFD_ENDIAN_BIG, | |
569 | ||
570 | /* header_byteorder: header is also big endian */ | |
571 | BFD_ENDIAN_BIG, | |
572 | ||
573 | /* object_flags: mask of all file flags */ | |
e0aae569 RH |
574 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
575 | | DYNAMIC | WP_TEXT | D_PAGED), | |
252b5132 RH |
576 | |
577 | /* section_flags: mask of all section flags */ | |
e0aae569 RH |
578 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
579 | | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES | |
dbb410c3 | 580 | | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP), |
252b5132 RH |
581 | |
582 | /* leading_symbol_char: is the first char of a user symbol | |
583 | predictable, and if so what is it */ | |
584 | elf_symbol_leading_char, | |
585 | ||
586 | /* ar_pad_char: pad character for filenames within an archive header | |
587 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
588 | of the archiver and/or os and should be independently tunable */ | |
589 | '/', | |
590 | ||
591 | /* ar_max_namelen: maximum number of characters in an archive header | |
592 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
a1aefc76 NC |
593 | of the archiver and should be independently tunable. The System V ABI, |
594 | Chapter 7 (Formats & Protocols), Archive section sets this as 15. */ | |
595 | 15, | |
252b5132 RH |
596 | |
597 | /* Routines to byte-swap various sized integers from the data sections */ | |
598 | bfd_getb64, bfd_getb_signed_64, bfd_putb64, | |
599 | bfd_getb32, bfd_getb_signed_32, bfd_putb32, | |
600 | bfd_getb16, bfd_getb_signed_16, bfd_putb16, | |
601 | ||
602 | /* Routines to byte-swap various sized integers from the file headers */ | |
603 | bfd_getb64, bfd_getb_signed_64, bfd_putb64, | |
604 | bfd_getb32, bfd_getb_signed_32, bfd_putb32, | |
605 | bfd_getb16, bfd_getb_signed_16, bfd_putb16, | |
606 | ||
607 | /* bfd_check_format: check the format of a file being read */ | |
608 | { _bfd_dummy_target, /* unknown format */ | |
609 | bfd_elfNN_object_p, /* assembler/linker output (object file) */ | |
610 | bfd_elfNN_archive_p, /* an archive */ | |
611 | bfd_elfNN_core_file_p /* a core file */ | |
612 | }, | |
613 | ||
614 | /* bfd_set_format: set the format of a file being written */ | |
615 | { bfd_false, | |
616 | bfd_elfNN_mkobject, | |
617 | bfd_elfNN_mkarchive, | |
618 | bfd_elfNN_mkcorefile | |
619 | }, | |
620 | ||
621 | /* bfd_write_contents: write cached information into a file being written */ | |
622 | { bfd_false, | |
623 | bfd_elfNN_write_object_contents, | |
624 | bfd_elfNN_write_archive_contents, | |
625 | bfd_elfNN_write_corefile_contents, | |
626 | }, | |
627 | ||
e656e369 AM |
628 | BFD_JUMP_TABLE_GENERIC (bfd_elfNN), |
629 | BFD_JUMP_TABLE_COPY (bfd_elfNN), | |
630 | BFD_JUMP_TABLE_CORE (bfd_elfNN), | |
252b5132 | 631 | #ifdef bfd_elfNN_archive_functions |
e656e369 | 632 | BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), |
252b5132 | 633 | #else |
e656e369 | 634 | BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), |
252b5132 | 635 | #endif |
e656e369 AM |
636 | BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), |
637 | BFD_JUMP_TABLE_RELOCS (bfd_elfNN), | |
638 | BFD_JUMP_TABLE_WRITE (bfd_elfNN), | |
639 | BFD_JUMP_TABLE_LINK (bfd_elfNN), | |
640 | BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), | |
252b5132 | 641 | |
c3c89269 NC |
642 | /* Alternative endian target. */ |
643 | #ifdef TARGET_LITTLE_SYM | |
644 | & TARGET_LITTLE_SYM, | |
645 | #else | |
646 | NULL, | |
647 | #endif | |
648 | ||
252b5132 | 649 | /* backend_data: */ |
9c5bfbb7 | 650 | &elfNN_bed |
252b5132 RH |
651 | }; |
652 | #endif | |
653 | ||
654 | #ifdef TARGET_LITTLE_SYM | |
655 | const bfd_target TARGET_LITTLE_SYM = | |
656 | { | |
657 | /* name: identify kind of target */ | |
658 | TARGET_LITTLE_NAME, | |
659 | ||
660 | /* flavour: general indication about file */ | |
661 | bfd_target_elf_flavour, | |
662 | ||
663 | /* byteorder: data is little endian */ | |
664 | BFD_ENDIAN_LITTLE, | |
665 | ||
666 | /* header_byteorder: header is also little endian */ | |
667 | BFD_ENDIAN_LITTLE, | |
668 | ||
669 | /* object_flags: mask of all file flags */ | |
e0aae569 RH |
670 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
671 | | DYNAMIC | WP_TEXT | D_PAGED), | |
252b5132 RH |
672 | |
673 | /* section_flags: mask of all section flags */ | |
e0aae569 RH |
674 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
675 | | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES | |
dbb410c3 | 676 | | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP), |
252b5132 RH |
677 | |
678 | /* leading_symbol_char: is the first char of a user symbol | |
679 | predictable, and if so what is it */ | |
680 | elf_symbol_leading_char, | |
681 | ||
682 | /* ar_pad_char: pad character for filenames within an archive header | |
683 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
684 | of the archiver and/or os and should be independently tunable */ | |
685 | '/', | |
686 | ||
687 | /* ar_max_namelen: maximum number of characters in an archive header | |
688 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
a1aefc76 NC |
689 | of the archiver and should be independently tunable. The System V ABI, |
690 | Chapter 7 (Formats & Protocols), Archive section sets this as 15. */ | |
691 | 15, | |
252b5132 RH |
692 | |
693 | /* Routines to byte-swap various sized integers from the data sections */ | |
694 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
695 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
696 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
697 | ||
698 | /* Routines to byte-swap various sized integers from the file headers */ | |
699 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
700 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
701 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
702 | ||
703 | /* bfd_check_format: check the format of a file being read */ | |
704 | { _bfd_dummy_target, /* unknown format */ | |
705 | bfd_elfNN_object_p, /* assembler/linker output (object file) */ | |
706 | bfd_elfNN_archive_p, /* an archive */ | |
707 | bfd_elfNN_core_file_p /* a core file */ | |
708 | }, | |
709 | ||
710 | /* bfd_set_format: set the format of a file being written */ | |
711 | { bfd_false, | |
712 | bfd_elfNN_mkobject, | |
713 | bfd_elfNN_mkarchive, | |
714 | bfd_elfNN_mkcorefile | |
715 | }, | |
716 | ||
717 | /* bfd_write_contents: write cached information into a file being written */ | |
718 | { bfd_false, | |
719 | bfd_elfNN_write_object_contents, | |
720 | bfd_elfNN_write_archive_contents, | |
721 | bfd_elfNN_write_corefile_contents, | |
722 | }, | |
723 | ||
e656e369 AM |
724 | BFD_JUMP_TABLE_GENERIC (bfd_elfNN), |
725 | BFD_JUMP_TABLE_COPY (bfd_elfNN), | |
726 | BFD_JUMP_TABLE_CORE (bfd_elfNN), | |
252b5132 | 727 | #ifdef bfd_elfNN_archive_functions |
e656e369 | 728 | BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), |
252b5132 | 729 | #else |
e656e369 | 730 | BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), |
252b5132 | 731 | #endif |
e656e369 AM |
732 | BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), |
733 | BFD_JUMP_TABLE_RELOCS (bfd_elfNN), | |
734 | BFD_JUMP_TABLE_WRITE (bfd_elfNN), | |
735 | BFD_JUMP_TABLE_LINK (bfd_elfNN), | |
736 | BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), | |
252b5132 | 737 | |
c3c89269 NC |
738 | /* Alternative endian target. */ |
739 | #ifdef TARGET_BIG_SYM | |
740 | & TARGET_BIG_SYM, | |
741 | #else | |
742 | NULL, | |
743 | #endif | |
3e932841 | 744 | |
252b5132 | 745 | /* backend_data: */ |
9c5bfbb7 | 746 | &elfNN_bed |
252b5132 RH |
747 | }; |
748 | #endif |