]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/elf64-target.h
* remote-nrom.c: Remove everything but download code. More
[thirdparty/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
5b3577cb
JL
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)
46#endif
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)
50#endif
d5fb1e2a
MM
51#ifndef bfd_elf64_bfd_merge_private_bfd_data
52#define bfd_elf64_bfd_merge_private_bfd_data \
53 ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
54#endif
55#ifndef bfd_elf64_bfd_set_private_flags
56#define bfd_elf64_bfd_set_private_flags \
57 ((boolean (*) PARAMS ((bfd *, flagword))) bfd_true)
58#endif
5b3577cb
JL
59#ifndef bfd_elf64_bfd_is_local_label
60#define bfd_elf64_bfd_is_local_label bfd_generic_is_local_label
61#endif
62
cb71adf1
PS
63#ifndef bfd_elf64_get_dynamic_reloc_upper_bound
64#define bfd_elf64_get_dynamic_reloc_upper_bound \
65 _bfd_nodynamic_get_dynamic_reloc_upper_bound
66#endif
67#ifndef bfd_elf64_canonicalize_dynamic_reloc
68#define bfd_elf64_canonicalize_dynamic_reloc \
69 _bfd_nodynamic_canonicalize_dynamic_reloc
70#endif
71
6ec3bb6a
ILT
72#ifdef elf_backend_relocate_section
73#ifndef bfd_elf64_bfd_link_hash_table_create
74#define bfd_elf64_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
75#endif
76#else /* ! defined (elf_backend_relocate_section) */
77/* If no backend relocate_section routine, use the generic linker. */
78#ifndef bfd_elf64_bfd_link_hash_table_create
79#define bfd_elf64_bfd_link_hash_table_create \
80 _bfd_generic_link_hash_table_create
81#endif
82#ifndef bfd_elf64_bfd_link_add_symbols
83#define bfd_elf64_bfd_link_add_symbols _bfd_generic_link_add_symbols
84#endif
85#ifndef bfd_elf64_bfd_final_link
86#define bfd_elf64_bfd_final_link _bfd_generic_final_link
87#endif
88#endif /* ! defined (elf_backend_relocate_section) */
89
b3024965
KR
90#ifndef elf_info_to_howto_rel
91#define elf_info_to_howto_rel 0
92#endif
93
94#ifndef ELF_MAXPAGESIZE
95#define ELF_MAXPAGESIZE 1
96#endif
97
6ec3bb6a
ILT
98#ifndef elf_backend_collect
99#define elf_backend_collect false
100#endif
101
643e9fc7
ILT
102#ifndef elf_backend_sym_is_global
103#define elf_backend_sym_is_global 0
104#endif
a5ccdad1 105#ifndef elf_backend_object_p
643e9fc7 106#define elf_backend_object_p 0
a5ccdad1 107#endif
95469b02 108#ifndef elf_backend_symbol_processing
643e9fc7 109#define elf_backend_symbol_processing 0
95469b02
ILT
110#endif
111#ifndef elf_backend_symbol_table_processing
643e9fc7 112#define elf_backend_symbol_table_processing 0
95469b02
ILT
113#endif
114#ifndef elf_backend_section_processing
643e9fc7 115#define elf_backend_section_processing 0
95469b02
ILT
116#endif
117#ifndef elf_backend_section_from_shdr
643e9fc7 118#define elf_backend_section_from_shdr 0
95469b02
ILT
119#endif
120#ifndef elf_backend_fake_sections
643e9fc7 121#define elf_backend_fake_sections 0
95469b02
ILT
122#endif
123#ifndef elf_backend_section_from_bfd_section
643e9fc7
ILT
124#define elf_backend_section_from_bfd_section 0
125#endif
6ec3bb6a
ILT
126#ifndef elf_backend_add_symbol_hook
127#define elf_backend_add_symbol_hook 0
128#endif
ff5a090f
JL
129#ifndef elf_backend_link_output_symbol_hook
130#define elf_backend_link_output_symbol_hook 0
131#endif
013dec1a
ILT
132#ifndef elf_backend_create_dynamic_sections
133#define elf_backend_create_dynamic_sections 0
134#endif
374d2ef9
ILT
135#ifndef elf_backend_check_relocs
136#define elf_backend_check_relocs 0
137#endif
013dec1a
ILT
138#ifndef elf_backend_adjust_dynamic_symbol
139#define elf_backend_adjust_dynamic_symbol 0
140#endif
141#ifndef elf_backend_size_dynamic_sections
142#define elf_backend_size_dynamic_sections 0
143#endif
6ec3bb6a
ILT
144#ifndef elf_backend_relocate_section
145#define elf_backend_relocate_section 0
146#endif
013dec1a
ILT
147#ifndef elf_backend_finish_dynamic_symbol
148#define elf_backend_finish_dynamic_symbol 0
149#endif
150#ifndef elf_backend_finish_dynamic_sections
151#define elf_backend_finish_dynamic_sections 0
152#endif
99a6c761
JL
153#ifndef elf_backend_begin_write_processing
154#define elf_backend_begin_write_processing 0
155#endif
643e9fc7
ILT
156#ifndef elf_backend_final_write_processing
157#define elf_backend_final_write_processing 0
95469b02
ILT
158#endif
159#ifndef elf_backend_ecoff_debug_swap
643e9fc7 160#define elf_backend_ecoff_debug_swap 0
95469b02
ILT
161#endif
162
8c9bfee3
MM
163#ifndef ELF_MACHINE_ALT1
164#define ELF_MACHINE_ALT1 0
165#endif
166
167#ifndef ELF_MACHINE_ALT2
168#define ELF_MACHINE_ALT2 0
169#endif
170
3adad029
KR
171static CONST struct elf_backend_data elf64_bed =
172{
173#ifdef USE_REL
174 0, /* use_rela_p */
175#else
176 1, /* use_rela_p */
177#endif
95469b02 178 1, /* elf_64_p */
3adad029 179 ELF_ARCH, /* arch */
a5ccdad1 180 ELF_MACHINE_CODE, /* elf_machine_code */
95469b02 181 ELF_MAXPAGESIZE, /* maxpagesize */
6ec3bb6a 182 elf_backend_collect,
643e9fc7
ILT
183 elf_info_to_howto,
184 elf_info_to_howto_rel,
185 elf_backend_sym_is_global,
186 elf_backend_object_p,
187 elf_backend_symbol_processing,
188 elf_backend_symbol_table_processing,
189 elf_backend_section_processing,
190 elf_backend_section_from_shdr,
191 elf_backend_fake_sections,
192 elf_backend_section_from_bfd_section,
6ec3bb6a 193 elf_backend_add_symbol_hook,
ff5a090f 194 elf_backend_link_output_symbol_hook,
013dec1a 195 elf_backend_create_dynamic_sections,
374d2ef9 196 elf_backend_check_relocs,
013dec1a
ILT
197 elf_backend_adjust_dynamic_symbol,
198 elf_backend_size_dynamic_sections,
6ec3bb6a 199 elf_backend_relocate_section,
013dec1a
ILT
200 elf_backend_finish_dynamic_symbol,
201 elf_backend_finish_dynamic_sections,
99a6c761
JL
202 elf_backend_begin_write_processing,
203 elf_backend_final_write_processing,
8c9bfee3
MM
204 elf_backend_ecoff_debug_swap,
205 ELF_MACHINE_ALT1,
206 ELF_MACHINE_ALT2
3adad029
KR
207};
208
209#ifdef TARGET_BIG_SYM
2f3508ad 210const bfd_target TARGET_BIG_SYM =
3adad029
KR
211{
212 /* name: identify kind of target */
213 TARGET_BIG_NAME,
214
215 /* flavour: general indication about file */
216 bfd_target_elf_flavour,
217
218 /* byteorder_big_p: data is big endian */
219 true,
220
221 /* header_byteorder_big_p: header is also big endian */
222 true,
223
224 /* object_flags: mask of all file flags */
225 (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
fa15568a 226 DYNAMIC | WP_TEXT | D_PAGED),
3adad029
KR
227
228 /* section_flags: mask of all section flags */
229 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
d6e5f950 230 SEC_CODE | SEC_DATA | SEC_DEBUGGING),
3adad029
KR
231
232 /* leading_symbol_char: is the first char of a user symbol
233 predictable, and if so what is it */
234 0,
235
236 /* ar_pad_char: pad character for filenames within an archive header
237 FIXME: this really has nothing to do with ELF, this is a characteristic
238 of the archiver and/or os and should be independently tunable */
239 '/',
240
241 /* ar_max_namelen: maximum number of characters in an archive header
242 FIXME: this really has nothing to do with ELF, this is a characteristic
243 of the archiver and should be independently tunable. This value is
244 a WAG (wild a** guess) */
7a0c782d 245 14,
3adad029
KR
246
247 /* align_power_min: minimum alignment restriction for any section
248 FIXME: this value may be target machine dependent */
249 3,
250
251 /* Routines to byte-swap various sized integers from the data sections */
23f44e6f
ILT
252 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
253 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
254 bfd_getb16, bfd_getb_signed_16, bfd_putb16,
3adad029
KR
255
256 /* Routines to byte-swap various sized integers from the file headers */
23f44e6f
ILT
257 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
258 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
259 bfd_getb16, bfd_getb_signed_16, bfd_putb16,
3adad029
KR
260
261 /* bfd_check_format: check the format of a file being read */
262 { _bfd_dummy_target, /* unknown format */
263 bfd_elf64_object_p, /* assembler/linker output (object file) */
264 bfd_generic_archive_p, /* an archive */
265 bfd_elf64_core_file_p /* a core file */
266 },
267
268 /* bfd_set_format: set the format of a file being written */
269 { bfd_false,
270 bfd_elf_mkobject,
271 _bfd_generic_mkarchive,
272 bfd_false
273 },
274
275 /* bfd_write_contents: write cached information into a file being written */
276 { bfd_false,
277 bfd_elf64_write_object_contents,
278 _bfd_write_archive_contents,
279 bfd_false
280 },
281
6812b607
ILT
282 BFD_JUMP_TABLE_GENERIC (bfd_elf64),
283 BFD_JUMP_TABLE_COPY (bfd_elf64),
284 BFD_JUMP_TABLE_CORE (bfd_elf64),
285 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
286 BFD_JUMP_TABLE_SYMBOLS (bfd_elf64),
287 BFD_JUMP_TABLE_RELOCS (bfd_elf64),
288 BFD_JUMP_TABLE_WRITE (bfd_elf64),
289 BFD_JUMP_TABLE_LINK (bfd_elf64),
cb71adf1 290 BFD_JUMP_TABLE_DYNAMIC (bfd_elf64),
3adad029
KR
291
292 /* backend_data: */
293 (PTR) &elf64_bed,
294};
295#endif
296
297#ifdef TARGET_LITTLE_SYM
2f3508ad 298const bfd_target TARGET_LITTLE_SYM =
3adad029
KR
299{
300 /* name: identify kind of target */
301 TARGET_LITTLE_NAME,
302
303 /* flavour: general indication about file */
304 bfd_target_elf_flavour,
305
306 /* byteorder_big_p: data is big endian */
307 false, /* Nope -- this one's little endian */
308
309 /* header_byteorder_big_p: header is also big endian */
310 false, /* Nope -- this one's little endian */
311
312 /* object_flags: mask of all file flags */
313 (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
fa15568a 314 DYNAMIC | WP_TEXT | D_PAGED),
3adad029
KR
315
316 /* section_flags: mask of all section flags */
317 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
d6e5f950 318 SEC_CODE | SEC_DATA | SEC_DEBUGGING),
3adad029
KR
319
320 /* leading_symbol_char: is the first char of a user symbol
321 predictable, and if so what is it */
322 0,
323
324 /* ar_pad_char: pad character for filenames within an archive header
325 FIXME: this really has nothing to do with ELF, this is a characteristic
326 of the archiver and/or os and should be independently tunable */
327 '/',
328
329 /* ar_max_namelen: maximum number of characters in an archive header
330 FIXME: this really has nothing to do with ELF, this is a characteristic
331 of the archiver and should be independently tunable. This value is
332 a WAG (wild a** guess) */
7a0c782d 333 14,
3adad029
KR
334
335 /* align_power_min: minimum alignment restriction for any section
336 FIXME: this value may be target machine dependent */
337 3,
338
339 /* Routines to byte-swap various sized integers from the data sections */
23f44e6f
ILT
340 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
341 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
342 bfd_getl16, bfd_getl_signed_16, bfd_putl16,
3adad029
KR
343
344 /* Routines to byte-swap various sized integers from the file headers */
23f44e6f
ILT
345 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
346 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
347 bfd_getl16, bfd_getl_signed_16, bfd_putl16,
3adad029
KR
348
349 /* bfd_check_format: check the format of a file being read */
350 { _bfd_dummy_target, /* unknown format */
351 bfd_elf64_object_p, /* assembler/linker output (object file) */
352 bfd_generic_archive_p, /* an archive */
353 bfd_elf64_core_file_p /* a core file */
354 },
355
356 /* bfd_set_format: set the format of a file being written */
357 { bfd_false,
358 bfd_elf_mkobject,
359 _bfd_generic_mkarchive,
360 bfd_false
361 },
362
363 /* bfd_write_contents: write cached information into a file being written */
364 { bfd_false,
365 bfd_elf64_write_object_contents,
366 _bfd_write_archive_contents,
367 bfd_false
368 },
369
6812b607
ILT
370 BFD_JUMP_TABLE_GENERIC (bfd_elf64),
371 BFD_JUMP_TABLE_COPY (bfd_elf64),
372 BFD_JUMP_TABLE_CORE (bfd_elf64),
373 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
374 BFD_JUMP_TABLE_SYMBOLS (bfd_elf64),
375 BFD_JUMP_TABLE_RELOCS (bfd_elf64),
376 BFD_JUMP_TABLE_WRITE (bfd_elf64),
377 BFD_JUMP_TABLE_LINK (bfd_elf64),
cb71adf1 378 BFD_JUMP_TABLE_DYNAMIC (bfd_elf64),
3adad029
KR
379
380 /* backend_data: */
381 (PTR) &elf64_bed,
382};
383#endif