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_section_data
44 #define bfd_elf64_bfd_copy_private_section_data \
45 ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true)
47 #ifndef bfd_elf64_bfd_copy_private_bfd_data
48 #define bfd_elf64_bfd_copy_private_bfd_data \
49 ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
51 #ifndef bfd_elf64_bfd_is_local_label
52 #define bfd_elf64_bfd_is_local_label bfd_generic_is_local_label
55 #ifndef bfd_elf64_get_dynamic_reloc_upper_bound
56 #define bfd_elf64_get_dynamic_reloc_upper_bound \
57 _bfd_nodynamic_get_dynamic_reloc_upper_bound
59 #ifndef bfd_elf64_canonicalize_dynamic_reloc
60 #define bfd_elf64_canonicalize_dynamic_reloc \
61 _bfd_nodynamic_canonicalize_dynamic_reloc
64 #ifdef elf_backend_relocate_section
65 #ifndef bfd_elf64_bfd_link_hash_table_create
66 #define bfd_elf64_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
68 #else /* ! defined (elf_backend_relocate_section) */
69 /* If no backend relocate_section routine, use the generic linker. */
70 #ifndef bfd_elf64_bfd_link_hash_table_create
71 #define bfd_elf64_bfd_link_hash_table_create \
72 _bfd_generic_link_hash_table_create
74 #ifndef bfd_elf64_bfd_link_add_symbols
75 #define bfd_elf64_bfd_link_add_symbols _bfd_generic_link_add_symbols
77 #ifndef bfd_elf64_bfd_final_link
78 #define bfd_elf64_bfd_final_link _bfd_generic_final_link
80 #endif /* ! defined (elf_backend_relocate_section) */
82 #ifndef elf_info_to_howto_rel
83 #define elf_info_to_howto_rel 0
86 #ifndef ELF_MAXPAGESIZE
87 #define ELF_MAXPAGESIZE 1
90 #ifndef elf_backend_collect
91 #define elf_backend_collect false
94 #ifndef elf_backend_sym_is_global
95 #define elf_backend_sym_is_global 0
97 #ifndef elf_backend_object_p
98 #define elf_backend_object_p 0
100 #ifndef elf_backend_symbol_processing
101 #define elf_backend_symbol_processing 0
103 #ifndef elf_backend_symbol_table_processing
104 #define elf_backend_symbol_table_processing 0
106 #ifndef elf_backend_section_processing
107 #define elf_backend_section_processing 0
109 #ifndef elf_backend_section_from_shdr
110 #define elf_backend_section_from_shdr 0
112 #ifndef elf_backend_fake_sections
113 #define elf_backend_fake_sections 0
115 #ifndef elf_backend_section_from_bfd_section
116 #define elf_backend_section_from_bfd_section 0
118 #ifndef elf_backend_add_symbol_hook
119 #define elf_backend_add_symbol_hook 0
121 #ifndef elf_backend_create_dynamic_sections
122 #define elf_backend_create_dynamic_sections 0
124 #ifndef elf_backend_adjust_dynamic_symbol
125 #define elf_backend_adjust_dynamic_symbol 0
127 #ifndef elf_backend_size_dynamic_sections
128 #define elf_backend_size_dynamic_sections 0
130 #ifndef elf_backend_relocate_section
131 #define elf_backend_relocate_section 0
133 #ifndef elf_backend_finish_dynamic_symbol
134 #define elf_backend_finish_dynamic_symbol 0
136 #ifndef elf_backend_finish_dynamic_sections
137 #define elf_backend_finish_dynamic_sections 0
139 #ifndef elf_backend_begin_write_processing
140 #define elf_backend_begin_write_processing 0
142 #ifndef elf_backend_final_write_processing
143 #define elf_backend_final_write_processing 0
145 #ifndef elf_backend_ecoff_debug_swap
146 #define elf_backend_ecoff_debug_swap 0
149 static CONST
struct elf_backend_data elf64_bed
=
158 ELF_MACHINE_CODE
, /* elf_machine_code */
159 ELF_MAXPAGESIZE
, /* maxpagesize */
162 elf_info_to_howto_rel
,
163 elf_backend_sym_is_global
,
164 elf_backend_object_p
,
165 elf_backend_symbol_processing
,
166 elf_backend_symbol_table_processing
,
167 elf_backend_section_processing
,
168 elf_backend_section_from_shdr
,
169 elf_backend_fake_sections
,
170 elf_backend_section_from_bfd_section
,
171 elf_backend_add_symbol_hook
,
172 elf_backend_create_dynamic_sections
,
173 elf_backend_adjust_dynamic_symbol
,
174 elf_backend_size_dynamic_sections
,
175 elf_backend_relocate_section
,
176 elf_backend_finish_dynamic_symbol
,
177 elf_backend_finish_dynamic_sections
,
178 elf_backend_begin_write_processing
,
179 elf_backend_final_write_processing
,
180 elf_backend_ecoff_debug_swap
183 #ifdef TARGET_BIG_SYM
184 bfd_target TARGET_BIG_SYM
=
186 /* name: identify kind of target */
189 /* flavour: general indication about file */
190 bfd_target_elf_flavour
,
192 /* byteorder_big_p: data is big endian */
195 /* header_byteorder_big_p: header is also big endian */
198 /* object_flags: mask of all file flags */
199 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
|
202 /* section_flags: mask of all section flags */
203 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
|
204 SEC_CODE
| SEC_DATA
| SEC_DEBUGGING
),
206 /* leading_symbol_char: is the first char of a user symbol
207 predictable, and if so what is it */
210 /* ar_pad_char: pad character for filenames within an archive header
211 FIXME: this really has nothing to do with ELF, this is a characteristic
212 of the archiver and/or os and should be independently tunable */
215 /* ar_max_namelen: maximum number of characters in an archive header
216 FIXME: this really has nothing to do with ELF, this is a characteristic
217 of the archiver and should be independently tunable. This value is
218 a WAG (wild a** guess) */
221 /* align_power_min: minimum alignment restriction for any section
222 FIXME: this value may be target machine dependent */
225 /* Routines to byte-swap various sized integers from the data sections */
226 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
227 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
228 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
,
230 /* Routines to byte-swap various sized integers from the file headers */
231 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
232 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
233 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
,
235 /* bfd_check_format: check the format of a file being read */
236 { _bfd_dummy_target
, /* unknown format */
237 bfd_elf64_object_p
, /* assembler/linker output (object file) */
238 bfd_generic_archive_p
, /* an archive */
239 bfd_elf64_core_file_p
/* a core file */
242 /* bfd_set_format: set the format of a file being written */
245 _bfd_generic_mkarchive
,
249 /* bfd_write_contents: write cached information into a file being written */
251 bfd_elf64_write_object_contents
,
252 _bfd_write_archive_contents
,
256 BFD_JUMP_TABLE_GENERIC (bfd_elf64
),
257 BFD_JUMP_TABLE_COPY (bfd_elf64
),
258 BFD_JUMP_TABLE_CORE (bfd_elf64
),
259 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
260 BFD_JUMP_TABLE_SYMBOLS (bfd_elf64
),
261 BFD_JUMP_TABLE_RELOCS (bfd_elf64
),
262 BFD_JUMP_TABLE_WRITE (bfd_elf64
),
263 BFD_JUMP_TABLE_LINK (bfd_elf64
),
264 BFD_JUMP_TABLE_DYNAMIC (bfd_elf64
),
271 #ifdef TARGET_LITTLE_SYM
272 bfd_target TARGET_LITTLE_SYM
=
274 /* name: identify kind of target */
277 /* flavour: general indication about file */
278 bfd_target_elf_flavour
,
280 /* byteorder_big_p: data is big endian */
281 false, /* Nope -- this one's little endian */
283 /* header_byteorder_big_p: header is also big endian */
284 false, /* Nope -- this one's little endian */
286 /* object_flags: mask of all file flags */
287 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
|
290 /* section_flags: mask of all section flags */
291 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
|
292 SEC_CODE
| SEC_DATA
| SEC_DEBUGGING
),
294 /* leading_symbol_char: is the first char of a user symbol
295 predictable, and if so what is it */
298 /* ar_pad_char: pad character for filenames within an archive header
299 FIXME: this really has nothing to do with ELF, this is a characteristic
300 of the archiver and/or os and should be independently tunable */
303 /* ar_max_namelen: maximum number of characters in an archive header
304 FIXME: this really has nothing to do with ELF, this is a characteristic
305 of the archiver and should be independently tunable. This value is
306 a WAG (wild a** guess) */
309 /* align_power_min: minimum alignment restriction for any section
310 FIXME: this value may be target machine dependent */
313 /* Routines to byte-swap various sized integers from the data sections */
314 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
315 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
316 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
318 /* Routines to byte-swap various sized integers from the file headers */
319 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
320 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
321 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
323 /* bfd_check_format: check the format of a file being read */
324 { _bfd_dummy_target
, /* unknown format */
325 bfd_elf64_object_p
, /* assembler/linker output (object file) */
326 bfd_generic_archive_p
, /* an archive */
327 bfd_elf64_core_file_p
/* a core file */
330 /* bfd_set_format: set the format of a file being written */
333 _bfd_generic_mkarchive
,
337 /* bfd_write_contents: write cached information into a file being written */
339 bfd_elf64_write_object_contents
,
340 _bfd_write_archive_contents
,
344 BFD_JUMP_TABLE_GENERIC (bfd_elf64
),
345 BFD_JUMP_TABLE_COPY (bfd_elf64
),
346 BFD_JUMP_TABLE_CORE (bfd_elf64
),
347 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
348 BFD_JUMP_TABLE_SYMBOLS (bfd_elf64
),
349 BFD_JUMP_TABLE_RELOCS (bfd_elf64
),
350 BFD_JUMP_TABLE_WRITE (bfd_elf64
),
351 BFD_JUMP_TABLE_LINK (bfd_elf64
),
352 BFD_JUMP_TABLE_DYNAMIC (bfd_elf64
),