]> Git Repo - binutils.git/blob - bfd/elf64-target.h
* elfcode.h: Include bfdlink.h. Added several new functions to do
[binutils.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_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
51 #ifndef bfd_elf64_bfd_is_local_label
52 #define bfd_elf64_bfd_is_local_label bfd_generic_is_local_label
53 #endif
54
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
58 #endif
59 #ifndef bfd_elf64_canonicalize_dynamic_reloc
60 #define bfd_elf64_canonicalize_dynamic_reloc \
61   _bfd_nodynamic_canonicalize_dynamic_reloc
62 #endif
63
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
67 #endif
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
73 #endif
74 #ifndef bfd_elf64_bfd_link_add_symbols
75 #define bfd_elf64_bfd_link_add_symbols  _bfd_generic_link_add_symbols
76 #endif
77 #ifndef bfd_elf64_bfd_final_link
78 #define bfd_elf64_bfd_final_link        _bfd_generic_final_link
79 #endif
80 #endif /* ! defined (elf_backend_relocate_section) */
81
82 #ifndef elf_info_to_howto_rel
83 #define elf_info_to_howto_rel 0
84 #endif
85
86 #ifndef ELF_MAXPAGESIZE
87 #define ELF_MAXPAGESIZE 1
88 #endif
89
90 #ifndef elf_backend_collect
91 #define elf_backend_collect false
92 #endif
93
94 #ifndef elf_backend_sym_is_global
95 #define elf_backend_sym_is_global       0
96 #endif
97 #ifndef elf_backend_object_p
98 #define elf_backend_object_p            0
99 #endif
100 #ifndef elf_backend_symbol_processing
101 #define elf_backend_symbol_processing   0
102 #endif
103 #ifndef elf_backend_symbol_table_processing
104 #define elf_backend_symbol_table_processing     0
105 #endif
106 #ifndef elf_backend_section_processing
107 #define elf_backend_section_processing  0
108 #endif
109 #ifndef elf_backend_section_from_shdr
110 #define elf_backend_section_from_shdr   0
111 #endif
112 #ifndef elf_backend_fake_sections
113 #define elf_backend_fake_sections       0
114 #endif
115 #ifndef elf_backend_section_from_bfd_section
116 #define elf_backend_section_from_bfd_section    0
117 #endif
118 #ifndef elf_backend_add_symbol_hook
119 #define elf_backend_add_symbol_hook     0
120 #endif
121 #ifndef elf_backend_relocate_section
122 #define elf_backend_relocate_section    0
123 #endif
124 #ifndef elf_backend_begin_write_processing
125 #define elf_backend_begin_write_processing      0
126 #endif
127 #ifndef elf_backend_final_write_processing
128 #define elf_backend_final_write_processing      0
129 #endif
130 #ifndef elf_backend_ecoff_debug_swap
131 #define elf_backend_ecoff_debug_swap    0
132 #endif
133
134 static CONST struct elf_backend_data elf64_bed =
135 {
136 #ifdef USE_REL
137   0,                            /* use_rela_p */
138 #else
139   1,                            /* use_rela_p */
140 #endif
141   1,                            /* elf_64_p */
142   ELF_ARCH,                     /* arch */
143   ELF_MACHINE_CODE,             /* elf_machine_code */
144   ELF_MAXPAGESIZE,              /* maxpagesize */
145   elf_backend_collect,
146   elf_info_to_howto,
147   elf_info_to_howto_rel,
148   elf_backend_sym_is_global,
149   elf_backend_object_p,
150   elf_backend_symbol_processing,
151   elf_backend_symbol_table_processing,
152   elf_backend_section_processing,
153   elf_backend_section_from_shdr,
154   elf_backend_fake_sections,
155   elf_backend_section_from_bfd_section,
156   elf_backend_add_symbol_hook,
157   elf_backend_relocate_section,
158   elf_backend_begin_write_processing,
159   elf_backend_final_write_processing,
160   elf_backend_ecoff_debug_swap
161 };
162
163 #ifdef TARGET_BIG_SYM
164 bfd_target TARGET_BIG_SYM =
165 {
166   /* name: identify kind of target */
167   TARGET_BIG_NAME,
168
169   /* flavour: general indication about file */
170   bfd_target_elf_flavour,
171
172   /* byteorder_big_p: data is big endian */
173   true,
174
175   /* header_byteorder_big_p: header is also big endian */
176   true,
177
178   /* object_flags: mask of all file flags */
179   (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
180    DYNAMIC | WP_TEXT),
181   
182   /* section_flags: mask of all section flags */
183   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
184    SEC_CODE | SEC_DATA | SEC_DEBUGGING),
185
186    /* leading_symbol_char: is the first char of a user symbol
187       predictable, and if so what is it */
188    0,
189
190   /* ar_pad_char: pad character for filenames within an archive header
191      FIXME:  this really has nothing to do with ELF, this is a characteristic
192      of the archiver and/or os and should be independently tunable */
193   '/',
194
195   /* ar_max_namelen: maximum number of characters in an archive header
196      FIXME:  this really has nothing to do with ELF, this is a characteristic
197      of the archiver and should be independently tunable.  This value is
198      a WAG (wild a** guess) */
199   15,
200
201   /* align_power_min: minimum alignment restriction for any section
202      FIXME:  this value may be target machine dependent */
203   3,
204
205   /* Routines to byte-swap various sized integers from the data sections */
206   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
207     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
208     bfd_getb16, bfd_getb_signed_16, bfd_putb16,
209
210   /* Routines to byte-swap various sized integers from the file headers */
211   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
212     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
213     bfd_getb16, bfd_getb_signed_16, bfd_putb16,
214
215   /* bfd_check_format: check the format of a file being read */
216   { _bfd_dummy_target,          /* unknown format */
217     bfd_elf64_object_p,         /* assembler/linker output (object file) */
218     bfd_generic_archive_p,      /* an archive */
219     bfd_elf64_core_file_p       /* a core file */
220   },
221
222   /* bfd_set_format: set the format of a file being written */
223   { bfd_false,
224     bfd_elf_mkobject,
225     _bfd_generic_mkarchive,
226     bfd_false
227   },
228
229   /* bfd_write_contents: write cached information into a file being written */
230   { bfd_false,
231     bfd_elf64_write_object_contents,
232     _bfd_write_archive_contents,
233     bfd_false
234   },
235
236       BFD_JUMP_TABLE_GENERIC (bfd_elf64),
237       BFD_JUMP_TABLE_COPY (bfd_elf64),
238       BFD_JUMP_TABLE_CORE (bfd_elf64),
239       BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
240       BFD_JUMP_TABLE_SYMBOLS (bfd_elf64),
241       BFD_JUMP_TABLE_RELOCS (bfd_elf64),
242       BFD_JUMP_TABLE_WRITE (bfd_elf64),
243       BFD_JUMP_TABLE_LINK (bfd_elf64),
244       BFD_JUMP_TABLE_DYNAMIC (bfd_elf64),
245
246   /* backend_data: */
247   (PTR) &elf64_bed,
248 };
249 #endif
250
251 #ifdef TARGET_LITTLE_SYM
252 bfd_target TARGET_LITTLE_SYM =
253 {
254   /* name: identify kind of target */
255   TARGET_LITTLE_NAME,
256
257   /* flavour: general indication about file */
258   bfd_target_elf_flavour,
259
260   /* byteorder_big_p: data is big endian */
261   false,                /* Nope -- this one's little endian */
262
263   /* header_byteorder_big_p: header is also big endian */
264   false,                /* Nope -- this one's little endian */
265
266   /* object_flags: mask of all file flags */
267   (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
268    DYNAMIC | WP_TEXT),
269   
270   /* section_flags: mask of all section flags */
271   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
272    SEC_CODE | SEC_DATA | SEC_DEBUGGING),
273
274    /* leading_symbol_char: is the first char of a user symbol
275       predictable, and if so what is it */
276    0,
277
278   /* ar_pad_char: pad character for filenames within an archive header
279      FIXME:  this really has nothing to do with ELF, this is a characteristic
280      of the archiver and/or os and should be independently tunable */
281   '/',
282
283   /* ar_max_namelen: maximum number of characters in an archive header
284      FIXME:  this really has nothing to do with ELF, this is a characteristic
285      of the archiver and should be independently tunable.  This value is
286      a WAG (wild a** guess) */
287   15,
288
289   /* align_power_min: minimum alignment restriction for any section
290      FIXME:  this value may be target machine dependent */
291   3,
292
293   /* Routines to byte-swap various sized integers from the data sections */
294   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
295     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
296     bfd_getl16, bfd_getl_signed_16, bfd_putl16,
297
298   /* Routines to byte-swap various sized integers from the file headers */
299   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
300     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
301     bfd_getl16, bfd_getl_signed_16, bfd_putl16,
302
303   /* bfd_check_format: check the format of a file being read */
304   { _bfd_dummy_target,          /* unknown format */
305     bfd_elf64_object_p,         /* assembler/linker output (object file) */
306     bfd_generic_archive_p,      /* an archive */
307     bfd_elf64_core_file_p       /* a core file */
308   },
309
310   /* bfd_set_format: set the format of a file being written */
311   { bfd_false,
312     bfd_elf_mkobject,
313     _bfd_generic_mkarchive,
314     bfd_false
315   },
316
317   /* bfd_write_contents: write cached information into a file being written */
318   { bfd_false,
319     bfd_elf64_write_object_contents,
320     _bfd_write_archive_contents,
321     bfd_false
322   },
323
324       BFD_JUMP_TABLE_GENERIC (bfd_elf64),
325       BFD_JUMP_TABLE_COPY (bfd_elf64),
326       BFD_JUMP_TABLE_CORE (bfd_elf64),
327       BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
328       BFD_JUMP_TABLE_SYMBOLS (bfd_elf64),
329       BFD_JUMP_TABLE_RELOCS (bfd_elf64),
330       BFD_JUMP_TABLE_WRITE (bfd_elf64),
331       BFD_JUMP_TABLE_LINK (bfd_elf64),
332       BFD_JUMP_TABLE_DYNAMIC (bfd_elf64),
333
334   /* backend_data: */
335   (PTR) &elf64_bed,
336 };
337 #endif
This page took 0.042507 seconds and 4 git commands to generate.