* targets.c: Add copy_private_symbol_data and link_split_section
[deliverable/binutils-gdb.git] / bfd / elf64-target.h
1 /* Target definitions for 64-bit ELF
2 Copyright 1993, 1994 Free Software Foundation, Inc.
3
4 This file is part of BFD, the Binary File Descriptor library.
5
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.
10
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.
15
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. */
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
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
32 #endif
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
40 #define bfd_elf64_bfd_make_debug_symbol \
41 ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
42
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
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
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
63 #ifndef bfd_elf64_bfd_is_local_label
64 #define bfd_elf64_bfd_is_local_label bfd_generic_is_local_label
65 #endif
66
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
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) */
93 #ifndef bfd_elf64_bfd_link_split_section
94 #define bfd_elf64_bfd_link_split_section _bfd_generic_link_split_section
95 #endif
96
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
105 #ifndef elf_backend_collect
106 #define elf_backend_collect false
107 #endif
108
109 #ifndef elf_backend_sym_is_global
110 #define elf_backend_sym_is_global 0
111 #endif
112 #ifndef elf_backend_object_p
113 #define elf_backend_object_p 0
114 #endif
115 #ifndef elf_backend_symbol_processing
116 #define elf_backend_symbol_processing 0
117 #endif
118 #ifndef elf_backend_symbol_table_processing
119 #define elf_backend_symbol_table_processing 0
120 #endif
121 #ifndef elf_backend_section_processing
122 #define elf_backend_section_processing 0
123 #endif
124 #ifndef elf_backend_section_from_shdr
125 #define elf_backend_section_from_shdr 0
126 #endif
127 #ifndef elf_backend_fake_sections
128 #define elf_backend_fake_sections 0
129 #endif
130 #ifndef elf_backend_section_from_bfd_section
131 #define elf_backend_section_from_bfd_section 0
132 #endif
133 #ifndef elf_backend_add_symbol_hook
134 #define elf_backend_add_symbol_hook 0
135 #endif
136 #ifndef elf_backend_link_output_symbol_hook
137 #define elf_backend_link_output_symbol_hook 0
138 #endif
139 #ifndef elf_backend_create_dynamic_sections
140 #define elf_backend_create_dynamic_sections 0
141 #endif
142 #ifndef elf_backend_check_relocs
143 #define elf_backend_check_relocs 0
144 #endif
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
151 #ifndef elf_backend_relocate_section
152 #define elf_backend_relocate_section 0
153 #endif
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
160 #ifndef elf_backend_begin_write_processing
161 #define elf_backend_begin_write_processing 0
162 #endif
163 #ifndef elf_backend_final_write_processing
164 #define elf_backend_final_write_processing 0
165 #endif
166 #ifndef elf_backend_ecoff_debug_swap
167 #define elf_backend_ecoff_debug_swap 0
168 #endif
169
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
178 static 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
185 1, /* elf_64_p */
186 ELF_ARCH, /* arch */
187 ELF_MACHINE_CODE, /* elf_machine_code */
188 ELF_MAXPAGESIZE, /* maxpagesize */
189 elf_backend_collect,
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,
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,
212 ELF_MACHINE_ALT1,
213 ELF_MACHINE_ALT2
214 };
215
216 #ifdef TARGET_BIG_SYM
217 const bfd_target TARGET_BIG_SYM =
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 |
233 DYNAMIC | WP_TEXT | D_PAGED),
234
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),
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) */
252 14,
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 */
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,
262
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,
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
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),
298
299 /* backend_data: */
300 (PTR) &elf64_bed,
301 };
302 #endif
303
304 #ifdef TARGET_LITTLE_SYM
305 const bfd_target TARGET_LITTLE_SYM =
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 |
321 DYNAMIC | WP_TEXT | D_PAGED),
322
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),
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) */
340 14,
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 */
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,
350
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,
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
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),
386
387 /* backend_data: */
388 (PTR) &elf64_bed,
389 };
390 #endif
This page took 0.036477 seconds and 4 git commands to generate.