1 /* Target definitions for 64-bit ELF
2 Copyright 1993, 1994 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
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.
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.
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. */
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.
25 There are two such structures here: one for big-endian machines and
26 one for little-endian machines. */
28 #define bfd_elf64_close_and_cleanup _bfd_generic_close_and_cleanup
29 #define bfd_elf64_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
30 #ifndef bfd_elf64_get_section_contents
31 #define bfd_elf64_get_section_contents _bfd_generic_get_section_contents
34 #define bfd_elf64_bfd_debug_info_start bfd_void
35 #define bfd_elf64_bfd_debug_info_end bfd_void
36 #define bfd_elf64_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void
37 #define bfd_elf64_bfd_get_relocated_section_contents \
38 bfd_generic_get_relocated_section_contents
39 #define bfd_elf64_bfd_relax_section bfd_generic_relax_section
40 #define bfd_elf64_bfd_make_debug_symbol \
41 ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
43 #ifndef bfd_elf64_bfd_copy_private_symbol_data
44 #define bfd_elf64_bfd_copy_private_symbol_data \
45 ((boolean (*) PARAMS ((bfd *, asymbol *, bfd *, asymbol *))) bfd_true)
47 #ifndef bfd_elf64_bfd_copy_private_section_data
48 #define bfd_elf64_bfd_copy_private_section_data \
49 ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true)
51 #ifndef bfd_elf64_bfd_copy_private_bfd_data
52 #define bfd_elf64_bfd_copy_private_bfd_data \
53 ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
55 #ifndef bfd_elf64_bfd_merge_private_bfd_data
56 #define bfd_elf64_bfd_merge_private_bfd_data \
57 ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
59 #ifndef bfd_elf64_bfd_set_private_flags
60 #define bfd_elf64_bfd_set_private_flags \
61 ((boolean (*) PARAMS ((bfd *, flagword))) bfd_true)
63 #ifndef bfd_elf64_bfd_is_local_label
64 #define bfd_elf64_bfd_is_local_label bfd_generic_is_local_label
67 #ifndef bfd_elf64_get_dynamic_reloc_upper_bound
68 #define bfd_elf64_get_dynamic_reloc_upper_bound \
69 _bfd_nodynamic_get_dynamic_reloc_upper_bound
71 #ifndef bfd_elf64_canonicalize_dynamic_reloc
72 #define bfd_elf64_canonicalize_dynamic_reloc \
73 _bfd_nodynamic_canonicalize_dynamic_reloc
76 #ifdef elf_backend_relocate_section
77 #ifndef bfd_elf64_bfd_link_hash_table_create
78 #define bfd_elf64_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
80 #else /* ! defined (elf_backend_relocate_section) */
81 /* If no backend relocate_section routine, use the generic linker. */
82 #ifndef bfd_elf64_bfd_link_hash_table_create
83 #define bfd_elf64_bfd_link_hash_table_create \
84 _bfd_generic_link_hash_table_create
86 #ifndef bfd_elf64_bfd_link_add_symbols
87 #define bfd_elf64_bfd_link_add_symbols _bfd_generic_link_add_symbols
89 #ifndef bfd_elf64_bfd_final_link
90 #define bfd_elf64_bfd_final_link _bfd_generic_final_link
92 #endif /* ! defined (elf_backend_relocate_section) */
93 #ifndef bfd_elf64_bfd_link_split_section
94 #define bfd_elf64_bfd_link_split_section _bfd_generic_link_split_section
97 #ifndef elf_info_to_howto_rel
98 #define elf_info_to_howto_rel 0
101 #ifndef ELF_MAXPAGESIZE
102 #define ELF_MAXPAGESIZE 1
105 #ifndef elf_backend_collect
106 #define elf_backend_collect false
109 #ifndef elf_backend_sym_is_global
110 #define elf_backend_sym_is_global 0
112 #ifndef elf_backend_object_p
113 #define elf_backend_object_p 0
115 #ifndef elf_backend_symbol_processing
116 #define elf_backend_symbol_processing 0
118 #ifndef elf_backend_symbol_table_processing
119 #define elf_backend_symbol_table_processing 0
121 #ifndef elf_backend_section_processing
122 #define elf_backend_section_processing 0
124 #ifndef elf_backend_section_from_shdr
125 #define elf_backend_section_from_shdr 0
127 #ifndef elf_backend_fake_sections
128 #define elf_backend_fake_sections 0
130 #ifndef elf_backend_section_from_bfd_section
131 #define elf_backend_section_from_bfd_section 0
133 #ifndef elf_backend_add_symbol_hook
134 #define elf_backend_add_symbol_hook 0
136 #ifndef elf_backend_link_output_symbol_hook
137 #define elf_backend_link_output_symbol_hook 0
139 #ifndef elf_backend_create_dynamic_sections
140 #define elf_backend_create_dynamic_sections 0
142 #ifndef elf_backend_check_relocs
143 #define elf_backend_check_relocs 0
145 #ifndef elf_backend_adjust_dynamic_symbol
146 #define elf_backend_adjust_dynamic_symbol 0
148 #ifndef elf_backend_size_dynamic_sections
149 #define elf_backend_size_dynamic_sections 0
151 #ifndef elf_backend_relocate_section
152 #define elf_backend_relocate_section 0
154 #ifndef elf_backend_finish_dynamic_symbol
155 #define elf_backend_finish_dynamic_symbol 0
157 #ifndef elf_backend_finish_dynamic_sections
158 #define elf_backend_finish_dynamic_sections 0
160 #ifndef elf_backend_begin_write_processing
161 #define elf_backend_begin_write_processing 0
163 #ifndef elf_backend_final_write_processing
164 #define elf_backend_final_write_processing 0
166 #ifndef elf_backend_ecoff_debug_swap
167 #define elf_backend_ecoff_debug_swap 0
170 #ifndef ELF_MACHINE_ALT1
171 #define ELF_MACHINE_ALT1 0
174 #ifndef ELF_MACHINE_ALT2
175 #define ELF_MACHINE_ALT2 0
178 static CONST
struct elf_backend_data elf64_bed
=
187 ELF_MACHINE_CODE
, /* elf_machine_code */
188 ELF_MAXPAGESIZE
, /* maxpagesize */
191 elf_info_to_howto_rel
,
192 elf_backend_sym_is_global
,
193 elf_backend_object_p
,
194 elf_backend_symbol_processing
,
195 elf_backend_symbol_table_processing
,
196 elf_backend_section_processing
,
197 elf_backend_section_from_shdr
,
198 elf_backend_fake_sections
,
199 elf_backend_section_from_bfd_section
,
200 elf_backend_add_symbol_hook
,
201 elf_backend_link_output_symbol_hook
,
202 elf_backend_create_dynamic_sections
,
203 elf_backend_check_relocs
,
204 elf_backend_adjust_dynamic_symbol
,
205 elf_backend_size_dynamic_sections
,
206 elf_backend_relocate_section
,
207 elf_backend_finish_dynamic_symbol
,
208 elf_backend_finish_dynamic_sections
,
209 elf_backend_begin_write_processing
,
210 elf_backend_final_write_processing
,
211 elf_backend_ecoff_debug_swap
,
216 #ifdef TARGET_BIG_SYM
217 const bfd_target TARGET_BIG_SYM
=
219 /* name: identify kind of target */
222 /* flavour: general indication about file */
223 bfd_target_elf_flavour
,
225 /* byteorder_big_p: data is big endian */
228 /* header_byteorder_big_p: header is also big endian */
231 /* object_flags: mask of all file flags */
232 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
|
233 DYNAMIC
| WP_TEXT
| D_PAGED
),
235 /* section_flags: mask of all section flags */
236 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
|
237 SEC_CODE
| SEC_DATA
| SEC_DEBUGGING
),
239 /* leading_symbol_char: is the first char of a user symbol
240 predictable, and if so what is it */
243 /* ar_pad_char: pad character for filenames within an archive header
244 FIXME: this really has nothing to do with ELF, this is a characteristic
245 of the archiver and/or os and should be independently tunable */
248 /* ar_max_namelen: maximum number of characters in an archive header
249 FIXME: this really has nothing to do with ELF, this is a characteristic
250 of the archiver and should be independently tunable. This value is
251 a WAG (wild a** guess) */
254 /* align_power_min: minimum alignment restriction for any section
255 FIXME: this value may be target machine dependent */
258 /* Routines to byte-swap various sized integers from the data sections */
259 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
260 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
261 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
,
263 /* Routines to byte-swap various sized integers from the file headers */
264 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
265 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
266 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
,
268 /* bfd_check_format: check the format of a file being read */
269 { _bfd_dummy_target
, /* unknown format */
270 bfd_elf64_object_p
, /* assembler/linker output (object file) */
271 bfd_generic_archive_p
, /* an archive */
272 bfd_elf64_core_file_p
/* a core file */
275 /* bfd_set_format: set the format of a file being written */
278 _bfd_generic_mkarchive
,
282 /* bfd_write_contents: write cached information into a file being written */
284 bfd_elf64_write_object_contents
,
285 _bfd_write_archive_contents
,
289 BFD_JUMP_TABLE_GENERIC (bfd_elf64
),
290 BFD_JUMP_TABLE_COPY (bfd_elf64
),
291 BFD_JUMP_TABLE_CORE (bfd_elf64
),
292 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
293 BFD_JUMP_TABLE_SYMBOLS (bfd_elf64
),
294 BFD_JUMP_TABLE_RELOCS (bfd_elf64
),
295 BFD_JUMP_TABLE_WRITE (bfd_elf64
),
296 BFD_JUMP_TABLE_LINK (bfd_elf64
),
297 BFD_JUMP_TABLE_DYNAMIC (bfd_elf64
),
304 #ifdef TARGET_LITTLE_SYM
305 const bfd_target TARGET_LITTLE_SYM
=
307 /* name: identify kind of target */
310 /* flavour: general indication about file */
311 bfd_target_elf_flavour
,
313 /* byteorder_big_p: data is big endian */
314 false, /* Nope -- this one's little endian */
316 /* header_byteorder_big_p: header is also big endian */
317 false, /* Nope -- this one's little endian */
319 /* object_flags: mask of all file flags */
320 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
|
321 DYNAMIC
| WP_TEXT
| D_PAGED
),
323 /* section_flags: mask of all section flags */
324 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
|
325 SEC_CODE
| SEC_DATA
| SEC_DEBUGGING
),
327 /* leading_symbol_char: is the first char of a user symbol
328 predictable, and if so what is it */
331 /* ar_pad_char: pad character for filenames within an archive header
332 FIXME: this really has nothing to do with ELF, this is a characteristic
333 of the archiver and/or os and should be independently tunable */
336 /* ar_max_namelen: maximum number of characters in an archive header
337 FIXME: this really has nothing to do with ELF, this is a characteristic
338 of the archiver and should be independently tunable. This value is
339 a WAG (wild a** guess) */
342 /* align_power_min: minimum alignment restriction for any section
343 FIXME: this value may be target machine dependent */
346 /* Routines to byte-swap various sized integers from the data sections */
347 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
348 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
349 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
351 /* Routines to byte-swap various sized integers from the file headers */
352 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
353 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
354 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
356 /* bfd_check_format: check the format of a file being read */
357 { _bfd_dummy_target
, /* unknown format */
358 bfd_elf64_object_p
, /* assembler/linker output (object file) */
359 bfd_generic_archive_p
, /* an archive */
360 bfd_elf64_core_file_p
/* a core file */
363 /* bfd_set_format: set the format of a file being written */
366 _bfd_generic_mkarchive
,
370 /* bfd_write_contents: write cached information into a file being written */
372 bfd_elf64_write_object_contents
,
373 _bfd_write_archive_contents
,
377 BFD_JUMP_TABLE_GENERIC (bfd_elf64
),
378 BFD_JUMP_TABLE_COPY (bfd_elf64
),
379 BFD_JUMP_TABLE_CORE (bfd_elf64
),
380 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
381 BFD_JUMP_TABLE_SYMBOLS (bfd_elf64
),
382 BFD_JUMP_TABLE_RELOCS (bfd_elf64
),
383 BFD_JUMP_TABLE_WRITE (bfd_elf64
),
384 BFD_JUMP_TABLE_LINK (bfd_elf64
),
385 BFD_JUMP_TABLE_DYNAMIC (bfd_elf64
),