Reflect comings and goings of files.
[deliverable/binutils-gdb.git] / bfd / elf64-target.h
CommitLineData
3adad029 1/* Target definitions for 64-bit ELF
dfc1c006 2 Copyright 1993, 1994 Free Software Foundation, Inc.
3adad029
KR
3
4This file is part of BFD, the Binary File Descriptor library.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, 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
6812b607
ILT
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
3adad029 32#endif
3adad029
KR
33
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
3adad029
KR
40#define bfd_elf64_bfd_make_debug_symbol \
41 ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
42
6167a840
JL
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)
46#endif
5b3577cb
JL
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)
50#endif
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)
54#endif
d5fb1e2a
MM
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)
58#endif
59#ifndef bfd_elf64_bfd_set_private_flags
60#define bfd_elf64_bfd_set_private_flags \
61 ((boolean (*) PARAMS ((bfd *, flagword))) bfd_true)
62#endif
5b3577cb
JL
63#ifndef bfd_elf64_bfd_is_local_label
64#define bfd_elf64_bfd_is_local_label bfd_generic_is_local_label
65#endif
66
cb71adf1
PS
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
70#endif
71#ifndef bfd_elf64_canonicalize_dynamic_reloc
72#define bfd_elf64_canonicalize_dynamic_reloc \
73 _bfd_nodynamic_canonicalize_dynamic_reloc
74#endif
75
6ec3bb6a
ILT
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
79#endif
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
85#endif
86#ifndef bfd_elf64_bfd_link_add_symbols
87#define bfd_elf64_bfd_link_add_symbols _bfd_generic_link_add_symbols
88#endif
89#ifndef bfd_elf64_bfd_final_link
90#define bfd_elf64_bfd_final_link _bfd_generic_final_link
91#endif
92#endif /* ! defined (elf_backend_relocate_section) */
6167a840
JL
93#ifndef bfd_elf64_bfd_link_split_section
94#define bfd_elf64_bfd_link_split_section _bfd_generic_link_split_section
95#endif
6ec3bb6a 96
b3024965
KR
97#ifndef elf_info_to_howto_rel
98#define elf_info_to_howto_rel 0
99#endif
100
101#ifndef ELF_MAXPAGESIZE
102#define ELF_MAXPAGESIZE 1
103#endif
104
6ec3bb6a
ILT
105#ifndef elf_backend_collect
106#define elf_backend_collect false
107#endif
108
643e9fc7
ILT
109#ifndef elf_backend_sym_is_global
110#define elf_backend_sym_is_global 0
111#endif
a5ccdad1 112#ifndef elf_backend_object_p
643e9fc7 113#define elf_backend_object_p 0
a5ccdad1 114#endif
95469b02 115#ifndef elf_backend_symbol_processing
643e9fc7 116#define elf_backend_symbol_processing 0
95469b02
ILT
117#endif
118#ifndef elf_backend_symbol_table_processing
643e9fc7 119#define elf_backend_symbol_table_processing 0
95469b02
ILT
120#endif
121#ifndef elf_backend_section_processing
643e9fc7 122#define elf_backend_section_processing 0
95469b02
ILT
123#endif
124#ifndef elf_backend_section_from_shdr
643e9fc7 125#define elf_backend_section_from_shdr 0
95469b02
ILT
126#endif
127#ifndef elf_backend_fake_sections
643e9fc7 128#define elf_backend_fake_sections 0
95469b02
ILT
129#endif
130#ifndef elf_backend_section_from_bfd_section
643e9fc7
ILT
131#define elf_backend_section_from_bfd_section 0
132#endif
6ec3bb6a
ILT
133#ifndef elf_backend_add_symbol_hook
134#define elf_backend_add_symbol_hook 0
135#endif
ff5a090f
JL
136#ifndef elf_backend_link_output_symbol_hook
137#define elf_backend_link_output_symbol_hook 0
138#endif
013dec1a
ILT
139#ifndef elf_backend_create_dynamic_sections
140#define elf_backend_create_dynamic_sections 0
141#endif
374d2ef9
ILT
142#ifndef elf_backend_check_relocs
143#define elf_backend_check_relocs 0
144#endif
013dec1a
ILT
145#ifndef elf_backend_adjust_dynamic_symbol
146#define elf_backend_adjust_dynamic_symbol 0
147#endif
148#ifndef elf_backend_size_dynamic_sections
149#define elf_backend_size_dynamic_sections 0
150#endif
6ec3bb6a
ILT
151#ifndef elf_backend_relocate_section
152#define elf_backend_relocate_section 0
153#endif
013dec1a
ILT
154#ifndef elf_backend_finish_dynamic_symbol
155#define elf_backend_finish_dynamic_symbol 0
156#endif
157#ifndef elf_backend_finish_dynamic_sections
158#define elf_backend_finish_dynamic_sections 0
159#endif
99a6c761
JL
160#ifndef elf_backend_begin_write_processing
161#define elf_backend_begin_write_processing 0
162#endif
643e9fc7
ILT
163#ifndef elf_backend_final_write_processing
164#define elf_backend_final_write_processing 0
95469b02
ILT
165#endif
166#ifndef elf_backend_ecoff_debug_swap
643e9fc7 167#define elf_backend_ecoff_debug_swap 0
95469b02
ILT
168#endif
169
8c9bfee3
MM
170#ifndef ELF_MACHINE_ALT1
171#define ELF_MACHINE_ALT1 0
172#endif
173
174#ifndef ELF_MACHINE_ALT2
175#define ELF_MACHINE_ALT2 0
176#endif
177
3adad029
KR
178static CONST struct elf_backend_data elf64_bed =
179{
180#ifdef USE_REL
181 0, /* use_rela_p */
182#else
183 1, /* use_rela_p */
184#endif
95469b02 185 1, /* elf_64_p */
3adad029 186 ELF_ARCH, /* arch */
a5ccdad1 187 ELF_MACHINE_CODE, /* elf_machine_code */
95469b02 188 ELF_MAXPAGESIZE, /* maxpagesize */
6ec3bb6a 189 elf_backend_collect,
643e9fc7
ILT
190 elf_info_to_howto,
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,
6ec3bb6a 200 elf_backend_add_symbol_hook,
ff5a090f 201 elf_backend_link_output_symbol_hook,
013dec1a 202 elf_backend_create_dynamic_sections,
374d2ef9 203 elf_backend_check_relocs,
013dec1a
ILT
204 elf_backend_adjust_dynamic_symbol,
205 elf_backend_size_dynamic_sections,
6ec3bb6a 206 elf_backend_relocate_section,
013dec1a
ILT
207 elf_backend_finish_dynamic_symbol,
208 elf_backend_finish_dynamic_sections,
99a6c761
JL
209 elf_backend_begin_write_processing,
210 elf_backend_final_write_processing,
8c9bfee3
MM
211 elf_backend_ecoff_debug_swap,
212 ELF_MACHINE_ALT1,
213 ELF_MACHINE_ALT2
3adad029
KR
214};
215
216#ifdef TARGET_BIG_SYM
2f3508ad 217const bfd_target TARGET_BIG_SYM =
3adad029
KR
218{
219 /* name: identify kind of target */
220 TARGET_BIG_NAME,
221
222 /* flavour: general indication about file */
223 bfd_target_elf_flavour,
224
225 /* byteorder_big_p: data is big endian */
226 true,
227
228 /* header_byteorder_big_p: header is also big endian */
229 true,
230
231 /* object_flags: mask of all file flags */
232 (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
fa15568a 233 DYNAMIC | WP_TEXT | D_PAGED),
3adad029
KR
234
235 /* section_flags: mask of all section flags */
236 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
d6e5f950 237 SEC_CODE | SEC_DATA | SEC_DEBUGGING),
3adad029
KR
238
239 /* leading_symbol_char: is the first char of a user symbol
240 predictable, and if so what is it */
241 0,
242
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 */
246 '/',
247
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) */
7a0c782d 252 14,
3adad029
KR
253
254 /* align_power_min: minimum alignment restriction for any section
255 FIXME: this value may be target machine dependent */
256 3,
257
258 /* Routines to byte-swap various sized integers from the data sections */
23f44e6f
ILT
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,
3adad029
KR
262
263 /* Routines to byte-swap various sized integers from the file headers */
23f44e6f
ILT
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,
3adad029
KR
267
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 */
273 },
274
275 /* bfd_set_format: set the format of a file being written */
276 { bfd_false,
277 bfd_elf_mkobject,
278 _bfd_generic_mkarchive,
279 bfd_false
280 },
281
282 /* bfd_write_contents: write cached information into a file being written */
283 { bfd_false,
284 bfd_elf64_write_object_contents,
285 _bfd_write_archive_contents,
286 bfd_false
287 },
288
6812b607
ILT
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),
cb71adf1 297 BFD_JUMP_TABLE_DYNAMIC (bfd_elf64),
3adad029
KR
298
299 /* backend_data: */
300 (PTR) &elf64_bed,
301};
302#endif
303
304#ifdef TARGET_LITTLE_SYM
2f3508ad 305const bfd_target TARGET_LITTLE_SYM =
3adad029
KR
306{
307 /* name: identify kind of target */
308 TARGET_LITTLE_NAME,
309
310 /* flavour: general indication about file */
311 bfd_target_elf_flavour,
312
313 /* byteorder_big_p: data is big endian */
314 false, /* Nope -- this one's little endian */
315
316 /* header_byteorder_big_p: header is also big endian */
317 false, /* Nope -- this one's little endian */
318
319 /* object_flags: mask of all file flags */
320 (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
fa15568a 321 DYNAMIC | WP_TEXT | D_PAGED),
3adad029
KR
322
323 /* section_flags: mask of all section flags */
324 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
d6e5f950 325 SEC_CODE | SEC_DATA | SEC_DEBUGGING),
3adad029
KR
326
327 /* leading_symbol_char: is the first char of a user symbol
328 predictable, and if so what is it */
329 0,
330
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 */
334 '/',
335
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) */
7a0c782d 340 14,
3adad029
KR
341
342 /* align_power_min: minimum alignment restriction for any section
343 FIXME: this value may be target machine dependent */
344 3,
345
346 /* Routines to byte-swap various sized integers from the data sections */
23f44e6f
ILT
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,
3adad029
KR
350
351 /* Routines to byte-swap various sized integers from the file headers */
23f44e6f
ILT
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,
3adad029
KR
355
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 */
361 },
362
363 /* bfd_set_format: set the format of a file being written */
364 { bfd_false,
365 bfd_elf_mkobject,
366 _bfd_generic_mkarchive,
367 bfd_false
368 },
369
370 /* bfd_write_contents: write cached information into a file being written */
371 { bfd_false,
372 bfd_elf64_write_object_contents,
373 _bfd_write_archive_contents,
374 bfd_false
375 },
376
6812b607
ILT
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),
cb71adf1 385 BFD_JUMP_TABLE_DYNAMIC (bfd_elf64),
3adad029
KR
386
387 /* backend_data: */
388 (PTR) &elf64_bed,
389};
390#endif
This page took 0.105012 seconds and 4 git commands to generate.