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 | |
129 | #define bfd_elfNN_bfd_gc_sections _bfd_elfNN_gc_sections | |
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 | |
8ea2e4bd NC |
192 | #else /* ! defined (elf_backend_relocate_section) */ |
193 | /* If no backend relocate_section routine, use the generic linker. | |
194 | Note - this will prevent the port from being able to use some of | |
195 | the other features of the ELF linker, because the generic hash structure | |
196 | does not have the fields needed by the ELF linker. In particular it | |
197 | means that linking directly to S-records will not work. */ | |
198 | #ifndef bfd_elfNN_bfd_link_hash_table_create | |
199 | #define bfd_elfNN_bfd_link_hash_table_create \ | |
200 | _bfd_generic_link_hash_table_create | |
201 | #endif | |
252b5132 RH |
202 | #ifndef bfd_elfNN_bfd_link_add_symbols |
203 | #define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols | |
204 | #endif | |
205 | #ifndef bfd_elfNN_bfd_final_link | |
206 | #define bfd_elfNN_bfd_final_link _bfd_generic_final_link | |
207 | #endif | |
208 | #endif /* ! defined (elf_backend_relocate_section) */ | |
2d653fc7 AM |
209 | |
210 | #ifndef bfd_elfNN_bfd_link_just_syms | |
211 | #define bfd_elfNN_bfd_link_just_syms _bfd_elf_link_just_syms | |
212 | #endif | |
213 | ||
252b5132 RH |
214 | #ifndef bfd_elfNN_bfd_link_split_section |
215 | #define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section | |
216 | #endif | |
217 | ||
218 | #ifndef bfd_elfNN_archive_p | |
219 | #define bfd_elfNN_archive_p bfd_generic_archive_p | |
220 | #endif | |
221 | ||
222 | #ifndef bfd_elfNN_write_archive_contents | |
223 | #define bfd_elfNN_write_archive_contents _bfd_write_archive_contents | |
224 | #endif | |
225 | ||
226 | #ifndef bfd_elfNN_mkobject | |
227 | #define bfd_elfNN_mkobject bfd_elf_mkobject | |
228 | #endif | |
229 | ||
230 | #ifndef bfd_elfNN_mkcorefile | |
231 | #define bfd_elfNN_mkcorefile bfd_elf_mkcorefile | |
232 | #endif | |
233 | ||
234 | #ifndef bfd_elfNN_mkarchive | |
235 | #define bfd_elfNN_mkarchive _bfd_generic_mkarchive | |
236 | #endif | |
237 | ||
238 | #ifndef elf_symbol_leading_char | |
239 | #define elf_symbol_leading_char 0 | |
240 | #endif | |
241 | ||
242 | #ifndef elf_info_to_howto | |
243 | #define elf_info_to_howto 0 | |
244 | #endif | |
245 | ||
246 | #ifndef elf_info_to_howto_rel | |
247 | #define elf_info_to_howto_rel 0 | |
248 | #endif | |
249 | ||
250 | #ifndef ELF_MAXPAGESIZE | |
79e5982f NC |
251 | #error ELF_MAXPAGESIZE is not defined |
252 | #define ELF_MAXPAGESIZE 1 | |
252b5132 RH |
253 | #endif |
254 | ||
255 | #ifndef elf_backend_collect | |
b34976b6 | 256 | #define elf_backend_collect FALSE |
252b5132 RH |
257 | #endif |
258 | #ifndef elf_backend_type_change_ok | |
b34976b6 | 259 | #define elf_backend_type_change_ok FALSE |
252b5132 RH |
260 | #endif |
261 | ||
262 | #ifndef elf_backend_sym_is_global | |
263 | #define elf_backend_sym_is_global 0 | |
264 | #endif | |
265 | #ifndef elf_backend_object_p | |
266 | #define elf_backend_object_p 0 | |
267 | #endif | |
268 | #ifndef elf_backend_symbol_processing | |
269 | #define elf_backend_symbol_processing 0 | |
270 | #endif | |
271 | #ifndef elf_backend_symbol_table_processing | |
272 | #define elf_backend_symbol_table_processing 0 | |
273 | #endif | |
274 | #ifndef elf_backend_get_symbol_type | |
275 | #define elf_backend_get_symbol_type 0 | |
276 | #endif | |
174fd7f9 RS |
277 | #ifndef elf_backend_name_local_section_symbols |
278 | #define elf_backend_name_local_section_symbols 0 | |
279 | #endif | |
252b5132 RH |
280 | #ifndef elf_backend_section_processing |
281 | #define elf_backend_section_processing 0 | |
282 | #endif | |
283 | #ifndef elf_backend_section_from_shdr | |
284 | #define elf_backend_section_from_shdr 0 | |
285 | #endif | |
fa152c49 JW |
286 | #ifndef elf_backend_section_flags |
287 | #define elf_backend_section_flags 0 | |
288 | #endif | |
20cfcaae NC |
289 | #ifndef elf_backend_section_from_phdr |
290 | #define elf_backend_section_from_phdr 0 | |
291 | #endif | |
252b5132 RH |
292 | #ifndef elf_backend_fake_sections |
293 | #define elf_backend_fake_sections 0 | |
294 | #endif | |
295 | #ifndef elf_backend_section_from_bfd_section | |
296 | #define elf_backend_section_from_bfd_section 0 | |
297 | #endif | |
298 | #ifndef elf_backend_add_symbol_hook | |
299 | #define elf_backend_add_symbol_hook 0 | |
300 | #endif | |
301 | #ifndef elf_backend_link_output_symbol_hook | |
302 | #define elf_backend_link_output_symbol_hook 0 | |
303 | #endif | |
304 | #ifndef elf_backend_create_dynamic_sections | |
305 | #define elf_backend_create_dynamic_sections 0 | |
306 | #endif | |
307 | #ifndef elf_backend_check_relocs | |
308 | #define elf_backend_check_relocs 0 | |
309 | #endif | |
310 | #ifndef elf_backend_adjust_dynamic_symbol | |
311 | #define elf_backend_adjust_dynamic_symbol 0 | |
312 | #endif | |
313 | #ifndef elf_backend_always_size_sections | |
314 | #define elf_backend_always_size_sections 0 | |
315 | #endif | |
316 | #ifndef elf_backend_size_dynamic_sections | |
317 | #define elf_backend_size_dynamic_sections 0 | |
318 | #endif | |
319 | #ifndef elf_backend_relocate_section | |
320 | #define elf_backend_relocate_section 0 | |
321 | #endif | |
322 | #ifndef elf_backend_finish_dynamic_symbol | |
323 | #define elf_backend_finish_dynamic_symbol 0 | |
324 | #endif | |
325 | #ifndef elf_backend_finish_dynamic_sections | |
326 | #define elf_backend_finish_dynamic_sections 0 | |
327 | #endif | |
328 | #ifndef elf_backend_begin_write_processing | |
329 | #define elf_backend_begin_write_processing 0 | |
330 | #endif | |
331 | #ifndef elf_backend_final_write_processing | |
332 | #define elf_backend_final_write_processing 0 | |
333 | #endif | |
334 | #ifndef elf_backend_additional_program_headers | |
335 | #define elf_backend_additional_program_headers 0 | |
336 | #endif | |
337 | #ifndef elf_backend_modify_segment_map | |
338 | #define elf_backend_modify_segment_map 0 | |
339 | #endif | |
340 | #ifndef elf_backend_ecoff_debug_swap | |
341 | #define elf_backend_ecoff_debug_swap 0 | |
342 | #endif | |
8d6337fe RM |
343 | #ifndef elf_backend_bfd_from_remote_memory |
344 | #define elf_backend_bfd_from_remote_memory _bfd_elfNN_bfd_from_remote_memory | |
345 | #endif | |
252b5132 RH |
346 | #ifndef elf_backend_got_header_size |
347 | #define elf_backend_got_header_size 0 | |
348 | #endif | |
e6c51ed4 NC |
349 | #ifndef elf_backend_post_process_headers |
350 | #define elf_backend_post_process_headers NULL | |
351 | #endif | |
587ff49e RH |
352 | #ifndef elf_backend_print_symbol_all |
353 | #define elf_backend_print_symbol_all NULL | |
354 | #endif | |
355 | #ifndef elf_backend_output_arch_syms | |
356 | #define elf_backend_output_arch_syms NULL | |
357 | #endif | |
c61b8717 RH |
358 | #ifndef elf_backend_copy_indirect_symbol |
359 | #define elf_backend_copy_indirect_symbol _bfd_elf_link_hash_copy_indirect | |
360 | #endif | |
361 | #ifndef elf_backend_hide_symbol | |
362 | #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol | |
363 | #endif | |
9bf7216d KK |
364 | #ifndef elf_backend_merge_symbol_attribute |
365 | #define elf_backend_merge_symbol_attribute NULL | |
366 | #endif | |
9317eacc CM |
367 | #ifndef elf_backend_emit_relocs |
368 | #define elf_backend_emit_relocs NULL | |
369 | #endif | |
370 | #ifndef elf_backend_count_relocs | |
371 | #define elf_backend_count_relocs NULL | |
372 | #endif | |
bb0082d6 AM |
373 | #ifndef elf_backend_grok_prstatus |
374 | #define elf_backend_grok_prstatus NULL | |
375 | #endif | |
376 | #ifndef elf_backend_grok_psinfo | |
377 | #define elf_backend_grok_psinfo NULL | |
378 | #endif | |
4e771d61 NC |
379 | #ifndef elf_backend_sprintf_vma |
380 | #define elf_backend_sprintf_vma _bfd_elf_sprintf_vma | |
381 | #endif | |
382 | #ifndef elf_backend_fprintf_vma | |
383 | #define elf_backend_fprintf_vma _bfd_elf_fprintf_vma | |
384 | #endif | |
db6751f2 JJ |
385 | #ifndef elf_backend_reloc_type_class |
386 | #define elf_backend_reloc_type_class _bfd_elf_reloc_type_class | |
387 | #endif | |
73d074b4 DJ |
388 | #ifndef elf_backend_discard_info |
389 | #define elf_backend_discard_info NULL | |
390 | #endif | |
391 | #ifndef elf_backend_ignore_discarded_relocs | |
392 | #define elf_backend_ignore_discarded_relocs NULL | |
393 | #endif | |
ec3391e7 AO |
394 | #ifndef elf_backend_can_make_relative_eh_frame |
395 | #define elf_backend_can_make_relative_eh_frame _bfd_elf_can_make_relative | |
396 | #endif | |
397 | #ifndef elf_backend_can_make_lsda_relative_eh_frame | |
398 | #define elf_backend_can_make_lsda_relative_eh_frame _bfd_elf_can_make_relative | |
399 | #endif | |
400 | #ifndef elf_backend_encode_eh_address | |
401 | #define elf_backend_encode_eh_address _bfd_elf_encode_eh_address | |
402 | #endif | |
73d074b4 DJ |
403 | #ifndef elf_backend_write_section |
404 | #define elf_backend_write_section NULL | |
405 | #endif | |
c6e90b02 TS |
406 | #ifndef elf_backend_mips_irix_compat |
407 | #define elf_backend_mips_irix_compat NULL | |
408 | #endif | |
409 | #ifndef elf_backend_mips_rtype_to_howto | |
410 | #define elf_backend_mips_rtype_to_howto NULL | |
411 | #endif | |
c61b8717 | 412 | |
bf572ba0 MM |
413 | /* Previously, backends could only use SHT_REL or SHT_RELA relocation |
414 | sections, but not both. They defined USE_REL to indicate SHT_REL | |
415 | sections, and left it undefined to indicated SHT_RELA sections. | |
416 | For backwards compatibility, we still support this usage. */ | |
417 | #ifndef USE_REL | |
418 | #define USE_REL 0 | |
3e932841 | 419 | #endif |
bf572ba0 MM |
420 | |
421 | /* Use these in new code. */ | |
3e932841 | 422 | #ifndef elf_backend_may_use_rel_p |
bf572ba0 | 423 | #define elf_backend_may_use_rel_p USE_REL |
3e932841 | 424 | #endif |
bf572ba0 MM |
425 | #ifndef elf_backend_may_use_rela_p |
426 | #define elf_backend_may_use_rela_p !USE_REL | |
427 | #endif | |
3e932841 | 428 | #ifndef elf_backend_default_use_rela_p |
bf572ba0 MM |
429 | #define elf_backend_default_use_rela_p !USE_REL |
430 | #endif | |
431 | ||
b491616a AM |
432 | #ifndef elf_backend_rela_normal |
433 | #define elf_backend_rela_normal 0 | |
434 | #endif | |
435 | ||
252b5132 RH |
436 | #ifndef ELF_MACHINE_ALT1 |
437 | #define ELF_MACHINE_ALT1 0 | |
438 | #endif | |
439 | ||
440 | #ifndef ELF_MACHINE_ALT2 | |
441 | #define ELF_MACHINE_ALT2 0 | |
442 | #endif | |
443 | ||
444 | #ifndef elf_backend_size_info | |
445 | #define elf_backend_size_info _bfd_elfNN_size_info | |
446 | #endif | |
447 | ||
2f89ff8d L |
448 | #ifndef elf_backend_special_sections |
449 | #define elf_backend_special_sections NULL | |
450 | #endif | |
451 | ||
86dc0f79 RH |
452 | #ifndef elf_backend_sign_extend_vma |
453 | #define elf_backend_sign_extend_vma 0 | |
454 | #endif | |
455 | ||
252b5132 RH |
456 | extern const struct elf_size_info _bfd_elfNN_size_info; |
457 | ||
dd745cfa | 458 | #ifndef INCLUDED_TARGET_FILE |
dc810e39 | 459 | static const struct elf_backend_data elfNN_bed = |
252b5132 | 460 | { |
252b5132 RH |
461 | ELF_ARCH, /* arch */ |
462 | ELF_MACHINE_CODE, /* elf_machine_code */ | |
463 | ELF_MAXPAGESIZE, /* maxpagesize */ | |
252b5132 RH |
464 | elf_info_to_howto, |
465 | elf_info_to_howto_rel, | |
466 | elf_backend_sym_is_global, | |
467 | elf_backend_object_p, | |
468 | elf_backend_symbol_processing, | |
469 | elf_backend_symbol_table_processing, | |
470 | elf_backend_get_symbol_type, | |
174fd7f9 | 471 | elf_backend_name_local_section_symbols, |
252b5132 RH |
472 | elf_backend_section_processing, |
473 | elf_backend_section_from_shdr, | |
fa152c49 | 474 | elf_backend_section_flags, |
20cfcaae | 475 | elf_backend_section_from_phdr, |
252b5132 RH |
476 | elf_backend_fake_sections, |
477 | elf_backend_section_from_bfd_section, | |
478 | elf_backend_add_symbol_hook, | |
479 | elf_backend_link_output_symbol_hook, | |
480 | elf_backend_create_dynamic_sections, | |
481 | elf_backend_check_relocs, | |
482 | elf_backend_adjust_dynamic_symbol, | |
483 | elf_backend_always_size_sections, | |
484 | elf_backend_size_dynamic_sections, | |
485 | elf_backend_relocate_section, | |
486 | elf_backend_finish_dynamic_symbol, | |
487 | elf_backend_finish_dynamic_sections, | |
488 | elf_backend_begin_write_processing, | |
489 | elf_backend_final_write_processing, | |
490 | elf_backend_additional_program_headers, | |
491 | elf_backend_modify_segment_map, | |
492 | elf_backend_gc_mark_hook, | |
493 | elf_backend_gc_sweep_hook, | |
e6c51ed4 | 494 | elf_backend_post_process_headers, |
587ff49e RH |
495 | elf_backend_print_symbol_all, |
496 | elf_backend_output_arch_syms, | |
c61b8717 RH |
497 | elf_backend_copy_indirect_symbol, |
498 | elf_backend_hide_symbol, | |
9bf7216d | 499 | elf_backend_merge_symbol_attribute, |
9317eacc CM |
500 | elf_backend_emit_relocs, |
501 | elf_backend_count_relocs, | |
bb0082d6 AM |
502 | elf_backend_grok_prstatus, |
503 | elf_backend_grok_psinfo, | |
4e771d61 NC |
504 | elf_backend_sprintf_vma, |
505 | elf_backend_fprintf_vma, | |
db6751f2 | 506 | elf_backend_reloc_type_class, |
73d074b4 DJ |
507 | elf_backend_discard_info, |
508 | elf_backend_ignore_discarded_relocs, | |
ec3391e7 AO |
509 | elf_backend_can_make_relative_eh_frame, |
510 | elf_backend_can_make_lsda_relative_eh_frame, | |
511 | elf_backend_encode_eh_address, | |
73d074b4 | 512 | elf_backend_write_section, |
c6e90b02 TS |
513 | elf_backend_mips_irix_compat, |
514 | elf_backend_mips_rtype_to_howto, | |
252b5132 | 515 | elf_backend_ecoff_debug_swap, |
8d6337fe | 516 | elf_backend_bfd_from_remote_memory, |
252b5132 RH |
517 | ELF_MACHINE_ALT1, |
518 | ELF_MACHINE_ALT2, | |
519 | &elf_backend_size_info, | |
2f89ff8d | 520 | elf_backend_special_sections, |
252b5132 RH |
521 | elf_backend_got_symbol_offset, |
522 | elf_backend_got_header_size, | |
86dc0f79 RH |
523 | elf_backend_collect, |
524 | elf_backend_type_change_ok, | |
bf572ba0 MM |
525 | elf_backend_may_use_rel_p, |
526 | elf_backend_may_use_rela_p, | |
527 | elf_backend_default_use_rela_p, | |
b491616a | 528 | elf_backend_rela_normal, |
86dc0f79 | 529 | elf_backend_sign_extend_vma, |
252b5132 RH |
530 | elf_backend_want_got_plt, |
531 | elf_backend_plt_readonly, | |
532 | elf_backend_want_plt_sym, | |
533 | elf_backend_plt_not_loaded, | |
534 | elf_backend_plt_alignment, | |
2ac8ce5f | 535 | elf_backend_can_gc_sections, |
51b64d56 | 536 | elf_backend_can_refcount, |
7fda6dbc | 537 | elf_backend_want_got_sym, |
5e8d7549 NC |
538 | elf_backend_want_dynbss, |
539 | elf_backend_want_p_paddr_set_to_zero | |
252b5132 | 540 | }; |
dd745cfa | 541 | #endif |
252b5132 | 542 | |
c3c89269 NC |
543 | /* Forward declaration for use when initialising alternative_target field. */ |
544 | #ifdef TARGET_LITTLE_SYM | |
545 | extern const bfd_target TARGET_LITTLE_SYM; | |
546 | #endif | |
547 | ||
252b5132 RH |
548 | #ifdef TARGET_BIG_SYM |
549 | const bfd_target TARGET_BIG_SYM = | |
550 | { | |
551 | /* name: identify kind of target */ | |
552 | TARGET_BIG_NAME, | |
553 | ||
554 | /* flavour: general indication about file */ | |
555 | bfd_target_elf_flavour, | |
556 | ||
557 | /* byteorder: data is big endian */ | |
558 | BFD_ENDIAN_BIG, | |
559 | ||
560 | /* header_byteorder: header is also big endian */ | |
561 | BFD_ENDIAN_BIG, | |
562 | ||
563 | /* object_flags: mask of all file flags */ | |
e0aae569 RH |
564 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
565 | | DYNAMIC | WP_TEXT | D_PAGED), | |
252b5132 RH |
566 | |
567 | /* section_flags: mask of all section flags */ | |
e0aae569 RH |
568 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
569 | | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES | |
dbb410c3 | 570 | | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP), |
252b5132 RH |
571 | |
572 | /* leading_symbol_char: is the first char of a user symbol | |
573 | predictable, and if so what is it */ | |
574 | elf_symbol_leading_char, | |
575 | ||
576 | /* ar_pad_char: pad character for filenames within an archive header | |
577 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
578 | of the archiver and/or os and should be independently tunable */ | |
579 | '/', | |
580 | ||
581 | /* ar_max_namelen: maximum number of characters in an archive header | |
582 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
a1aefc76 NC |
583 | of the archiver and should be independently tunable. The System V ABI, |
584 | Chapter 7 (Formats & Protocols), Archive section sets this as 15. */ | |
585 | 15, | |
252b5132 RH |
586 | |
587 | /* Routines to byte-swap various sized integers from the data sections */ | |
588 | bfd_getb64, bfd_getb_signed_64, bfd_putb64, | |
589 | bfd_getb32, bfd_getb_signed_32, bfd_putb32, | |
590 | bfd_getb16, bfd_getb_signed_16, bfd_putb16, | |
591 | ||
592 | /* Routines to byte-swap various sized integers from the file headers */ | |
593 | bfd_getb64, bfd_getb_signed_64, bfd_putb64, | |
594 | bfd_getb32, bfd_getb_signed_32, bfd_putb32, | |
595 | bfd_getb16, bfd_getb_signed_16, bfd_putb16, | |
596 | ||
597 | /* bfd_check_format: check the format of a file being read */ | |
598 | { _bfd_dummy_target, /* unknown format */ | |
599 | bfd_elfNN_object_p, /* assembler/linker output (object file) */ | |
600 | bfd_elfNN_archive_p, /* an archive */ | |
601 | bfd_elfNN_core_file_p /* a core file */ | |
602 | }, | |
603 | ||
604 | /* bfd_set_format: set the format of a file being written */ | |
605 | { bfd_false, | |
606 | bfd_elfNN_mkobject, | |
607 | bfd_elfNN_mkarchive, | |
608 | bfd_elfNN_mkcorefile | |
609 | }, | |
610 | ||
611 | /* bfd_write_contents: write cached information into a file being written */ | |
612 | { bfd_false, | |
613 | bfd_elfNN_write_object_contents, | |
614 | bfd_elfNN_write_archive_contents, | |
615 | bfd_elfNN_write_corefile_contents, | |
616 | }, | |
617 | ||
e656e369 AM |
618 | BFD_JUMP_TABLE_GENERIC (bfd_elfNN), |
619 | BFD_JUMP_TABLE_COPY (bfd_elfNN), | |
620 | BFD_JUMP_TABLE_CORE (bfd_elfNN), | |
252b5132 | 621 | #ifdef bfd_elfNN_archive_functions |
e656e369 | 622 | BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), |
252b5132 | 623 | #else |
e656e369 | 624 | BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), |
252b5132 | 625 | #endif |
e656e369 AM |
626 | BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), |
627 | BFD_JUMP_TABLE_RELOCS (bfd_elfNN), | |
628 | BFD_JUMP_TABLE_WRITE (bfd_elfNN), | |
629 | BFD_JUMP_TABLE_LINK (bfd_elfNN), | |
630 | BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), | |
252b5132 | 631 | |
c3c89269 NC |
632 | /* Alternative endian target. */ |
633 | #ifdef TARGET_LITTLE_SYM | |
634 | & TARGET_LITTLE_SYM, | |
635 | #else | |
636 | NULL, | |
637 | #endif | |
638 | ||
252b5132 | 639 | /* backend_data: */ |
9c5bfbb7 | 640 | &elfNN_bed |
252b5132 RH |
641 | }; |
642 | #endif | |
643 | ||
644 | #ifdef TARGET_LITTLE_SYM | |
645 | const bfd_target TARGET_LITTLE_SYM = | |
646 | { | |
647 | /* name: identify kind of target */ | |
648 | TARGET_LITTLE_NAME, | |
649 | ||
650 | /* flavour: general indication about file */ | |
651 | bfd_target_elf_flavour, | |
652 | ||
653 | /* byteorder: data is little endian */ | |
654 | BFD_ENDIAN_LITTLE, | |
655 | ||
656 | /* header_byteorder: header is also little endian */ | |
657 | BFD_ENDIAN_LITTLE, | |
658 | ||
659 | /* object_flags: mask of all file flags */ | |
e0aae569 RH |
660 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
661 | | DYNAMIC | WP_TEXT | D_PAGED), | |
252b5132 RH |
662 | |
663 | /* section_flags: mask of all section flags */ | |
e0aae569 RH |
664 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
665 | | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES | |
dbb410c3 | 666 | | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP), |
252b5132 RH |
667 | |
668 | /* leading_symbol_char: is the first char of a user symbol | |
669 | predictable, and if so what is it */ | |
670 | elf_symbol_leading_char, | |
671 | ||
672 | /* ar_pad_char: pad character for filenames within an archive header | |
673 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
674 | of the archiver and/or os and should be independently tunable */ | |
675 | '/', | |
676 | ||
677 | /* ar_max_namelen: maximum number of characters in an archive header | |
678 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
a1aefc76 NC |
679 | of the archiver and should be independently tunable. The System V ABI, |
680 | Chapter 7 (Formats & Protocols), Archive section sets this as 15. */ | |
681 | 15, | |
252b5132 RH |
682 | |
683 | /* Routines to byte-swap various sized integers from the data sections */ | |
684 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
685 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
686 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
687 | ||
688 | /* Routines to byte-swap various sized integers from the file headers */ | |
689 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
690 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
691 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
692 | ||
693 | /* bfd_check_format: check the format of a file being read */ | |
694 | { _bfd_dummy_target, /* unknown format */ | |
695 | bfd_elfNN_object_p, /* assembler/linker output (object file) */ | |
696 | bfd_elfNN_archive_p, /* an archive */ | |
697 | bfd_elfNN_core_file_p /* a core file */ | |
698 | }, | |
699 | ||
700 | /* bfd_set_format: set the format of a file being written */ | |
701 | { bfd_false, | |
702 | bfd_elfNN_mkobject, | |
703 | bfd_elfNN_mkarchive, | |
704 | bfd_elfNN_mkcorefile | |
705 | }, | |
706 | ||
707 | /* bfd_write_contents: write cached information into a file being written */ | |
708 | { bfd_false, | |
709 | bfd_elfNN_write_object_contents, | |
710 | bfd_elfNN_write_archive_contents, | |
711 | bfd_elfNN_write_corefile_contents, | |
712 | }, | |
713 | ||
e656e369 AM |
714 | BFD_JUMP_TABLE_GENERIC (bfd_elfNN), |
715 | BFD_JUMP_TABLE_COPY (bfd_elfNN), | |
716 | BFD_JUMP_TABLE_CORE (bfd_elfNN), | |
252b5132 | 717 | #ifdef bfd_elfNN_archive_functions |
e656e369 | 718 | BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), |
252b5132 | 719 | #else |
e656e369 | 720 | BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), |
252b5132 | 721 | #endif |
e656e369 AM |
722 | BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), |
723 | BFD_JUMP_TABLE_RELOCS (bfd_elfNN), | |
724 | BFD_JUMP_TABLE_WRITE (bfd_elfNN), | |
725 | BFD_JUMP_TABLE_LINK (bfd_elfNN), | |
726 | BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), | |
252b5132 | 727 | |
c3c89269 NC |
728 | /* Alternative endian target. */ |
729 | #ifdef TARGET_BIG_SYM | |
730 | & TARGET_BIG_SYM, | |
731 | #else | |
732 | NULL, | |
733 | #endif | |
3e932841 | 734 | |
252b5132 | 735 | /* backend_data: */ |
9c5bfbb7 | 736 | &elfNN_bed |
252b5132 RH |
737 | }; |
738 | #endif |