1 |
104 |
markom |
/* Target definitions for NN-bit ELF
|
2 |
|
|
Copyright 1993, 1994, 1995, 1996, 1997 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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_elfNN_close_and_cleanup _bfd_elf_close_and_cleanup
|
29 |
|
|
#define bfd_elfNN_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
|
30 |
|
|
#ifndef bfd_elfNN_get_section_contents
|
31 |
|
|
#define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents
|
32 |
|
|
#endif
|
33 |
|
|
|
34 |
|
|
#define bfd_elfNN_canonicalize_dynamic_symtab _bfd_elf_canonicalize_dynamic_symtab
|
35 |
|
|
#define bfd_elfNN_canonicalize_reloc _bfd_elf_canonicalize_reloc
|
36 |
|
|
#ifndef bfd_elfNN_find_nearest_line
|
37 |
|
|
#define bfd_elfNN_find_nearest_line _bfd_elf_find_nearest_line
|
38 |
|
|
#endif
|
39 |
|
|
#define bfd_elfNN_read_minisymbols _bfd_elf_read_minisymbols
|
40 |
|
|
#define bfd_elfNN_minisymbol_to_symbol _bfd_elf_minisymbol_to_symbol
|
41 |
|
|
#define bfd_elfNN_get_dynamic_symtab_upper_bound _bfd_elf_get_dynamic_symtab_upper_bound
|
42 |
|
|
#define bfd_elfNN_get_lineno _bfd_elf_get_lineno
|
43 |
|
|
#ifndef bfd_elfNN_get_reloc_upper_bound
|
44 |
|
|
#define bfd_elfNN_get_reloc_upper_bound _bfd_elf_get_reloc_upper_bound
|
45 |
|
|
#endif
|
46 |
|
|
#define bfd_elfNN_get_symbol_info _bfd_elf_get_symbol_info
|
47 |
|
|
#define bfd_elfNN_get_symtab _bfd_elf_get_symtab
|
48 |
|
|
#define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound
|
49 |
|
|
#if 0 /* done in elf-bfd.h */
|
50 |
|
|
#define bfd_elfNN_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
|
51 |
|
|
#endif
|
52 |
|
|
#define bfd_elfNN_make_empty_symbol _bfd_elf_make_empty_symbol
|
53 |
|
|
#define bfd_elfNN_new_section_hook _bfd_elf_new_section_hook
|
54 |
|
|
#define bfd_elfNN_set_arch_mach _bfd_elf_set_arch_mach
|
55 |
|
|
#ifndef bfd_elfNN_set_section_contents
|
56 |
|
|
#define bfd_elfNN_set_section_contents _bfd_elf_set_section_contents
|
57 |
|
|
#endif
|
58 |
|
|
#define bfd_elfNN_sizeof_headers _bfd_elf_sizeof_headers
|
59 |
|
|
#define bfd_elfNN_write_object_contents _bfd_elf_write_object_contents
|
60 |
|
|
#define bfd_elfNN_write_corefile_contents _bfd_elf_write_corefile_contents
|
61 |
|
|
|
62 |
|
|
#define bfd_elfNN_get_section_contents_in_window \
|
63 |
|
|
_bfd_generic_get_section_contents_in_window
|
64 |
|
|
|
65 |
|
|
#ifndef elf_backend_got_symbol_offset
|
66 |
|
|
#define elf_backend_got_symbol_offset (bfd_vma) 0
|
67 |
|
|
#endif
|
68 |
|
|
#ifndef elf_backend_want_got_plt
|
69 |
|
|
#define elf_backend_want_got_plt 0
|
70 |
|
|
#endif
|
71 |
|
|
#ifndef elf_backend_plt_readonly
|
72 |
|
|
#define elf_backend_plt_readonly 0
|
73 |
|
|
#endif
|
74 |
|
|
#ifndef elf_backend_want_plt_sym
|
75 |
|
|
#define elf_backend_want_plt_sym 0
|
76 |
|
|
#endif
|
77 |
|
|
#ifndef elf_backend_plt_not_loaded
|
78 |
|
|
#define elf_backend_plt_not_loaded 0
|
79 |
|
|
#endif
|
80 |
|
|
#ifndef elf_backend_plt_alignment
|
81 |
|
|
#define elf_backend_plt_alignment 2
|
82 |
|
|
#endif
|
83 |
|
|
#ifndef elf_backend_want_dynbss
|
84 |
|
|
#define elf_backend_want_dynbss 1
|
85 |
|
|
#endif
|
86 |
|
|
|
87 |
|
|
#define bfd_elfNN_bfd_debug_info_start bfd_void
|
88 |
|
|
#define bfd_elfNN_bfd_debug_info_end bfd_void
|
89 |
|
|
#define bfd_elfNN_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void
|
90 |
|
|
|
91 |
|
|
#ifndef bfd_elfNN_bfd_get_relocated_section_contents
|
92 |
|
|
#define bfd_elfNN_bfd_get_relocated_section_contents \
|
93 |
|
|
bfd_generic_get_relocated_section_contents
|
94 |
|
|
#endif
|
95 |
|
|
|
96 |
|
|
#ifndef bfd_elfNN_bfd_relax_section
|
97 |
|
|
#define bfd_elfNN_bfd_relax_section bfd_generic_relax_section
|
98 |
|
|
#endif
|
99 |
|
|
|
100 |
|
|
#ifndef elf_backend_can_gc_sections
|
101 |
|
|
#define elf_backend_can_gc_sections 0
|
102 |
|
|
#endif
|
103 |
|
|
#ifndef elf_backend_gc_mark_hook
|
104 |
|
|
#define elf_backend_gc_mark_hook NULL
|
105 |
|
|
#endif
|
106 |
|
|
#ifndef elf_backend_gc_sweep_hook
|
107 |
|
|
#define elf_backend_gc_sweep_hook NULL
|
108 |
|
|
#endif
|
109 |
|
|
#ifndef bfd_elfNN_bfd_gc_sections
|
110 |
|
|
#define bfd_elfNN_bfd_gc_sections _bfd_elfNN_gc_sections
|
111 |
|
|
#endif
|
112 |
|
|
|
113 |
|
|
#define bfd_elfNN_bfd_make_debug_symbol \
|
114 |
|
|
((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
|
115 |
|
|
|
116 |
|
|
#ifndef bfd_elfNN_bfd_copy_private_symbol_data
|
117 |
|
|
#define bfd_elfNN_bfd_copy_private_symbol_data \
|
118 |
|
|
_bfd_elf_copy_private_symbol_data
|
119 |
|
|
#endif
|
120 |
|
|
|
121 |
|
|
#ifndef bfd_elfNN_bfd_copy_private_section_data
|
122 |
|
|
#define bfd_elfNN_bfd_copy_private_section_data \
|
123 |
|
|
_bfd_elf_copy_private_section_data
|
124 |
|
|
#endif
|
125 |
|
|
#ifndef bfd_elfNN_bfd_copy_private_bfd_data
|
126 |
|
|
#define bfd_elfNN_bfd_copy_private_bfd_data \
|
127 |
|
|
((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
|
128 |
|
|
#endif
|
129 |
|
|
#ifndef bfd_elfNN_bfd_print_private_bfd_data
|
130 |
|
|
#define bfd_elfNN_bfd_print_private_bfd_data \
|
131 |
|
|
_bfd_elf_print_private_bfd_data
|
132 |
|
|
#endif
|
133 |
|
|
#ifndef bfd_elfNN_bfd_merge_private_bfd_data
|
134 |
|
|
#define bfd_elfNN_bfd_merge_private_bfd_data \
|
135 |
|
|
((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
|
136 |
|
|
#endif
|
137 |
|
|
#ifndef bfd_elfNN_bfd_set_private_flags
|
138 |
|
|
#define bfd_elfNN_bfd_set_private_flags \
|
139 |
|
|
((boolean (*) PARAMS ((bfd *, flagword))) bfd_true)
|
140 |
|
|
#endif
|
141 |
|
|
#ifndef bfd_elfNN_bfd_is_local_label_name
|
142 |
|
|
#define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name
|
143 |
|
|
#endif
|
144 |
|
|
|
145 |
|
|
#ifndef bfd_elfNN_get_dynamic_reloc_upper_bound
|
146 |
|
|
#define bfd_elfNN_get_dynamic_reloc_upper_bound \
|
147 |
|
|
_bfd_elf_get_dynamic_reloc_upper_bound
|
148 |
|
|
#endif
|
149 |
|
|
#ifndef bfd_elfNN_canonicalize_dynamic_reloc
|
150 |
|
|
#define bfd_elfNN_canonicalize_dynamic_reloc \
|
151 |
|
|
_bfd_elf_canonicalize_dynamic_reloc
|
152 |
|
|
#endif
|
153 |
|
|
|
154 |
|
|
#ifdef elf_backend_relocate_section
|
155 |
|
|
#ifndef bfd_elfNN_bfd_link_hash_table_create
|
156 |
|
|
#define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
|
157 |
|
|
#endif
|
158 |
|
|
#else /* ! defined (elf_backend_relocate_section) */
|
159 |
|
|
/* If no backend relocate_section routine, use the generic linker. */
|
160 |
|
|
#ifndef bfd_elfNN_bfd_link_hash_table_create
|
161 |
|
|
#define bfd_elfNN_bfd_link_hash_table_create \
|
162 |
|
|
_bfd_generic_link_hash_table_create
|
163 |
|
|
#endif
|
164 |
|
|
#ifndef bfd_elfNN_bfd_link_add_symbols
|
165 |
|
|
#define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols
|
166 |
|
|
#endif
|
167 |
|
|
#ifndef bfd_elfNN_bfd_final_link
|
168 |
|
|
#define bfd_elfNN_bfd_final_link _bfd_generic_final_link
|
169 |
|
|
#endif
|
170 |
|
|
#endif /* ! defined (elf_backend_relocate_section) */
|
171 |
|
|
#ifndef bfd_elfNN_bfd_link_split_section
|
172 |
|
|
#define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section
|
173 |
|
|
#endif
|
174 |
|
|
|
175 |
|
|
#ifndef bfd_elfNN_archive_p
|
176 |
|
|
#define bfd_elfNN_archive_p bfd_generic_archive_p
|
177 |
|
|
#endif
|
178 |
|
|
|
179 |
|
|
#ifndef bfd_elfNN_write_archive_contents
|
180 |
|
|
#define bfd_elfNN_write_archive_contents _bfd_write_archive_contents
|
181 |
|
|
#endif
|
182 |
|
|
|
183 |
|
|
#ifndef bfd_elfNN_mkobject
|
184 |
|
|
#define bfd_elfNN_mkobject bfd_elf_mkobject
|
185 |
|
|
#endif
|
186 |
|
|
|
187 |
|
|
#ifndef bfd_elfNN_mkcorefile
|
188 |
|
|
#define bfd_elfNN_mkcorefile bfd_elf_mkcorefile
|
189 |
|
|
#endif
|
190 |
|
|
|
191 |
|
|
#ifndef bfd_elfNN_mkarchive
|
192 |
|
|
#define bfd_elfNN_mkarchive _bfd_generic_mkarchive
|
193 |
|
|
#endif
|
194 |
|
|
|
195 |
|
|
#ifndef elf_symbol_leading_char
|
196 |
|
|
#define elf_symbol_leading_char 0
|
197 |
|
|
#endif
|
198 |
|
|
|
199 |
|
|
#ifndef elf_info_to_howto
|
200 |
|
|
#define elf_info_to_howto 0
|
201 |
|
|
#endif
|
202 |
|
|
|
203 |
|
|
#ifndef elf_info_to_howto_rel
|
204 |
|
|
#define elf_info_to_howto_rel 0
|
205 |
|
|
#endif
|
206 |
|
|
|
207 |
|
|
#ifndef ELF_MAXPAGESIZE
|
208 |
|
|
#error ELF_MAXPAGESIZE is not defined
|
209 |
|
|
#define ELF_MAXPAGESIZE 1
|
210 |
|
|
#endif
|
211 |
|
|
|
212 |
|
|
#ifndef elf_backend_collect
|
213 |
|
|
#define elf_backend_collect false
|
214 |
|
|
#endif
|
215 |
|
|
#ifndef elf_backend_type_change_ok
|
216 |
|
|
#define elf_backend_type_change_ok false
|
217 |
|
|
#endif
|
218 |
|
|
|
219 |
|
|
#ifndef elf_backend_sym_is_global
|
220 |
|
|
#define elf_backend_sym_is_global 0
|
221 |
|
|
#endif
|
222 |
|
|
#ifndef elf_backend_object_p
|
223 |
|
|
#define elf_backend_object_p 0
|
224 |
|
|
#endif
|
225 |
|
|
#ifndef elf_backend_symbol_processing
|
226 |
|
|
#define elf_backend_symbol_processing 0
|
227 |
|
|
#endif
|
228 |
|
|
#ifndef elf_backend_symbol_table_processing
|
229 |
|
|
#define elf_backend_symbol_table_processing 0
|
230 |
|
|
#endif
|
231 |
|
|
#ifndef elf_backend_get_symbol_type
|
232 |
|
|
#define elf_backend_get_symbol_type 0
|
233 |
|
|
#endif
|
234 |
|
|
#ifndef elf_backend_section_processing
|
235 |
|
|
#define elf_backend_section_processing 0
|
236 |
|
|
#endif
|
237 |
|
|
#ifndef elf_backend_section_from_shdr
|
238 |
|
|
#define elf_backend_section_from_shdr 0
|
239 |
|
|
#endif
|
240 |
|
|
#ifndef elf_backend_section_from_phdr
|
241 |
|
|
#define elf_backend_section_from_phdr 0
|
242 |
|
|
#endif
|
243 |
|
|
#ifndef elf_backend_fake_sections
|
244 |
|
|
#define elf_backend_fake_sections 0
|
245 |
|
|
#endif
|
246 |
|
|
#ifndef elf_backend_section_from_bfd_section
|
247 |
|
|
#define elf_backend_section_from_bfd_section 0
|
248 |
|
|
#endif
|
249 |
|
|
#ifndef elf_backend_add_symbol_hook
|
250 |
|
|
#define elf_backend_add_symbol_hook 0
|
251 |
|
|
#endif
|
252 |
|
|
#ifndef elf_backend_link_output_symbol_hook
|
253 |
|
|
#define elf_backend_link_output_symbol_hook 0
|
254 |
|
|
#endif
|
255 |
|
|
#ifndef elf_backend_create_dynamic_sections
|
256 |
|
|
#define elf_backend_create_dynamic_sections 0
|
257 |
|
|
#endif
|
258 |
|
|
#ifndef elf_backend_check_relocs
|
259 |
|
|
#define elf_backend_check_relocs 0
|
260 |
|
|
#endif
|
261 |
|
|
#ifndef elf_backend_adjust_dynamic_symbol
|
262 |
|
|
#define elf_backend_adjust_dynamic_symbol 0
|
263 |
|
|
#endif
|
264 |
|
|
#ifndef elf_backend_always_size_sections
|
265 |
|
|
#define elf_backend_always_size_sections 0
|
266 |
|
|
#endif
|
267 |
|
|
#ifndef elf_backend_size_dynamic_sections
|
268 |
|
|
#define elf_backend_size_dynamic_sections 0
|
269 |
|
|
#endif
|
270 |
|
|
#ifndef elf_backend_relocate_section
|
271 |
|
|
#define elf_backend_relocate_section 0
|
272 |
|
|
#endif
|
273 |
|
|
#ifndef elf_backend_finish_dynamic_symbol
|
274 |
|
|
#define elf_backend_finish_dynamic_symbol 0
|
275 |
|
|
#endif
|
276 |
|
|
#ifndef elf_backend_finish_dynamic_sections
|
277 |
|
|
#define elf_backend_finish_dynamic_sections 0
|
278 |
|
|
#endif
|
279 |
|
|
#ifndef elf_backend_begin_write_processing
|
280 |
|
|
#define elf_backend_begin_write_processing 0
|
281 |
|
|
#endif
|
282 |
|
|
#ifndef elf_backend_final_write_processing
|
283 |
|
|
#define elf_backend_final_write_processing 0
|
284 |
|
|
#endif
|
285 |
|
|
#ifndef elf_backend_additional_program_headers
|
286 |
|
|
#define elf_backend_additional_program_headers 0
|
287 |
|
|
#endif
|
288 |
|
|
#ifndef elf_backend_modify_segment_map
|
289 |
|
|
#define elf_backend_modify_segment_map 0
|
290 |
|
|
#endif
|
291 |
|
|
#ifndef elf_backend_ecoff_debug_swap
|
292 |
|
|
#define elf_backend_ecoff_debug_swap 0
|
293 |
|
|
#endif
|
294 |
|
|
#ifndef elf_backend_got_header_size
|
295 |
|
|
#define elf_backend_got_header_size 0
|
296 |
|
|
#endif
|
297 |
|
|
#ifndef elf_backend_plt_header_size
|
298 |
|
|
#define elf_backend_plt_header_size 0
|
299 |
|
|
#endif
|
300 |
|
|
#ifndef elf_backend_post_process_headers
|
301 |
|
|
#define elf_backend_post_process_headers NULL
|
302 |
|
|
#endif
|
303 |
|
|
#ifndef elf_backend_print_symbol_all
|
304 |
|
|
#define elf_backend_print_symbol_all NULL
|
305 |
|
|
#endif
|
306 |
|
|
#ifndef elf_backend_output_arch_syms
|
307 |
|
|
#define elf_backend_output_arch_syms NULL
|
308 |
|
|
#endif
|
309 |
|
|
#ifndef elf_backend_copy_indirect_symbol
|
310 |
|
|
#define elf_backend_copy_indirect_symbol _bfd_elf_link_hash_copy_indirect
|
311 |
|
|
#endif
|
312 |
|
|
#ifndef elf_backend_hide_symbol
|
313 |
|
|
#define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol
|
314 |
|
|
#endif
|
315 |
|
|
|
316 |
|
|
|
317 |
|
|
/* Previously, backends could only use SHT_REL or SHT_RELA relocation
|
318 |
|
|
sections, but not both. They defined USE_REL to indicate SHT_REL
|
319 |
|
|
sections, and left it undefined to indicated SHT_RELA sections.
|
320 |
|
|
For backwards compatibility, we still support this usage. */
|
321 |
|
|
#ifndef USE_REL
|
322 |
|
|
#define USE_REL 0
|
323 |
|
|
#else
|
324 |
|
|
#undef USE_REL
|
325 |
|
|
#define USE_REL 1
|
326 |
|
|
#endif
|
327 |
|
|
|
328 |
|
|
/* Use these in new code. */
|
329 |
|
|
#ifndef elf_backend_may_use_rel_p
|
330 |
|
|
#define elf_backend_may_use_rel_p USE_REL
|
331 |
|
|
#endif
|
332 |
|
|
#ifndef elf_backend_may_use_rela_p
|
333 |
|
|
#define elf_backend_may_use_rela_p !USE_REL
|
334 |
|
|
#endif
|
335 |
|
|
#ifndef elf_backend_default_use_rela_p
|
336 |
|
|
#define elf_backend_default_use_rela_p !USE_REL
|
337 |
|
|
#endif
|
338 |
|
|
|
339 |
|
|
#ifndef ELF_MACHINE_ALT1
|
340 |
|
|
#define ELF_MACHINE_ALT1 0
|
341 |
|
|
#endif
|
342 |
|
|
|
343 |
|
|
#ifndef ELF_MACHINE_ALT2
|
344 |
|
|
#define ELF_MACHINE_ALT2 0
|
345 |
|
|
#endif
|
346 |
|
|
|
347 |
|
|
#ifndef elf_backend_size_info
|
348 |
|
|
#define elf_backend_size_info _bfd_elfNN_size_info
|
349 |
|
|
#endif
|
350 |
|
|
|
351 |
|
|
#ifndef elf_backend_sign_extend_vma
|
352 |
|
|
#define elf_backend_sign_extend_vma 0
|
353 |
|
|
#endif
|
354 |
|
|
|
355 |
|
|
extern const struct elf_size_info _bfd_elfNN_size_info;
|
356 |
|
|
|
357 |
|
|
static CONST struct elf_backend_data elfNN_bed =
|
358 |
|
|
{
|
359 |
|
|
ELF_ARCH, /* arch */
|
360 |
|
|
ELF_MACHINE_CODE, /* elf_machine_code */
|
361 |
|
|
ELF_MAXPAGESIZE, /* maxpagesize */
|
362 |
|
|
elf_info_to_howto,
|
363 |
|
|
elf_info_to_howto_rel,
|
364 |
|
|
elf_backend_sym_is_global,
|
365 |
|
|
elf_backend_object_p,
|
366 |
|
|
elf_backend_symbol_processing,
|
367 |
|
|
elf_backend_symbol_table_processing,
|
368 |
|
|
elf_backend_get_symbol_type,
|
369 |
|
|
elf_backend_section_processing,
|
370 |
|
|
elf_backend_section_from_shdr,
|
371 |
|
|
elf_backend_section_from_phdr,
|
372 |
|
|
elf_backend_fake_sections,
|
373 |
|
|
elf_backend_section_from_bfd_section,
|
374 |
|
|
elf_backend_add_symbol_hook,
|
375 |
|
|
elf_backend_link_output_symbol_hook,
|
376 |
|
|
elf_backend_create_dynamic_sections,
|
377 |
|
|
elf_backend_check_relocs,
|
378 |
|
|
elf_backend_adjust_dynamic_symbol,
|
379 |
|
|
elf_backend_always_size_sections,
|
380 |
|
|
elf_backend_size_dynamic_sections,
|
381 |
|
|
elf_backend_relocate_section,
|
382 |
|
|
elf_backend_finish_dynamic_symbol,
|
383 |
|
|
elf_backend_finish_dynamic_sections,
|
384 |
|
|
elf_backend_begin_write_processing,
|
385 |
|
|
elf_backend_final_write_processing,
|
386 |
|
|
elf_backend_additional_program_headers,
|
387 |
|
|
elf_backend_modify_segment_map,
|
388 |
|
|
elf_backend_gc_mark_hook,
|
389 |
|
|
elf_backend_gc_sweep_hook,
|
390 |
|
|
elf_backend_post_process_headers,
|
391 |
|
|
elf_backend_print_symbol_all,
|
392 |
|
|
elf_backend_output_arch_syms,
|
393 |
|
|
elf_backend_copy_indirect_symbol,
|
394 |
|
|
elf_backend_hide_symbol,
|
395 |
|
|
elf_backend_ecoff_debug_swap,
|
396 |
|
|
ELF_MACHINE_ALT1,
|
397 |
|
|
ELF_MACHINE_ALT2,
|
398 |
|
|
&elf_backend_size_info,
|
399 |
|
|
elf_backend_got_symbol_offset,
|
400 |
|
|
elf_backend_got_header_size,
|
401 |
|
|
elf_backend_plt_header_size,
|
402 |
|
|
elf_backend_collect,
|
403 |
|
|
elf_backend_type_change_ok,
|
404 |
|
|
elf_backend_may_use_rel_p,
|
405 |
|
|
elf_backend_may_use_rela_p,
|
406 |
|
|
elf_backend_default_use_rela_p,
|
407 |
|
|
elf_backend_sign_extend_vma,
|
408 |
|
|
elf_backend_want_got_plt,
|
409 |
|
|
elf_backend_plt_readonly,
|
410 |
|
|
elf_backend_want_plt_sym,
|
411 |
|
|
elf_backend_plt_not_loaded,
|
412 |
|
|
elf_backend_plt_alignment,
|
413 |
|
|
elf_backend_can_gc_sections,
|
414 |
|
|
elf_backend_want_dynbss
|
415 |
|
|
};
|
416 |
|
|
|
417 |
|
|
/* Forward declaration for use when initialising alternative_target field. */
|
418 |
|
|
#ifdef TARGET_LITTLE_SYM
|
419 |
|
|
extern const bfd_target TARGET_LITTLE_SYM;
|
420 |
|
|
#endif
|
421 |
|
|
|
422 |
|
|
#ifdef TARGET_BIG_SYM
|
423 |
|
|
const bfd_target TARGET_BIG_SYM =
|
424 |
|
|
{
|
425 |
|
|
/* name: identify kind of target */
|
426 |
|
|
TARGET_BIG_NAME,
|
427 |
|
|
|
428 |
|
|
/* flavour: general indication about file */
|
429 |
|
|
bfd_target_elf_flavour,
|
430 |
|
|
|
431 |
|
|
/* byteorder: data is big endian */
|
432 |
|
|
BFD_ENDIAN_BIG,
|
433 |
|
|
|
434 |
|
|
/* header_byteorder: header is also big endian */
|
435 |
|
|
BFD_ENDIAN_BIG,
|
436 |
|
|
|
437 |
|
|
/* object_flags: mask of all file flags */
|
438 |
|
|
(HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
|
439 |
|
|
DYNAMIC | WP_TEXT | D_PAGED),
|
440 |
|
|
|
441 |
|
|
/* section_flags: mask of all section flags */
|
442 |
|
|
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
|
443 |
|
|
SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES),
|
444 |
|
|
|
445 |
|
|
/* leading_symbol_char: is the first char of a user symbol
|
446 |
|
|
predictable, and if so what is it */
|
447 |
|
|
elf_symbol_leading_char,
|
448 |
|
|
|
449 |
|
|
/* ar_pad_char: pad character for filenames within an archive header
|
450 |
|
|
FIXME: this really has nothing to do with ELF, this is a characteristic
|
451 |
|
|
of the archiver and/or os and should be independently tunable */
|
452 |
|
|
'/',
|
453 |
|
|
|
454 |
|
|
/* ar_max_namelen: maximum number of characters in an archive header
|
455 |
|
|
FIXME: this really has nothing to do with ELF, this is a characteristic
|
456 |
|
|
of the archiver and should be independently tunable. This value is
|
457 |
|
|
a WAG (wild a** guess) */
|
458 |
|
|
14,
|
459 |
|
|
|
460 |
|
|
/* Routines to byte-swap various sized integers from the data sections */
|
461 |
|
|
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
|
462 |
|
|
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
|
463 |
|
|
bfd_getb16, bfd_getb_signed_16, bfd_putb16,
|
464 |
|
|
|
465 |
|
|
/* Routines to byte-swap various sized integers from the file headers */
|
466 |
|
|
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
|
467 |
|
|
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
|
468 |
|
|
bfd_getb16, bfd_getb_signed_16, bfd_putb16,
|
469 |
|
|
|
470 |
|
|
/* bfd_check_format: check the format of a file being read */
|
471 |
|
|
{ _bfd_dummy_target, /* unknown format */
|
472 |
|
|
bfd_elfNN_object_p, /* assembler/linker output (object file) */
|
473 |
|
|
bfd_elfNN_archive_p, /* an archive */
|
474 |
|
|
bfd_elfNN_core_file_p /* a core file */
|
475 |
|
|
},
|
476 |
|
|
|
477 |
|
|
/* bfd_set_format: set the format of a file being written */
|
478 |
|
|
{ bfd_false,
|
479 |
|
|
bfd_elfNN_mkobject,
|
480 |
|
|
bfd_elfNN_mkarchive,
|
481 |
|
|
bfd_elfNN_mkcorefile
|
482 |
|
|
},
|
483 |
|
|
|
484 |
|
|
/* bfd_write_contents: write cached information into a file being written */
|
485 |
|
|
{ bfd_false,
|
486 |
|
|
bfd_elfNN_write_object_contents,
|
487 |
|
|
bfd_elfNN_write_archive_contents,
|
488 |
|
|
bfd_elfNN_write_corefile_contents,
|
489 |
|
|
},
|
490 |
|
|
|
491 |
|
|
BFD_JUMP_TABLE_GENERIC (bfd_elfNN),
|
492 |
|
|
BFD_JUMP_TABLE_COPY (bfd_elfNN),
|
493 |
|
|
BFD_JUMP_TABLE_CORE (bfd_elfNN),
|
494 |
|
|
#ifdef bfd_elfNN_archive_functions
|
495 |
|
|
BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive),
|
496 |
|
|
#else
|
497 |
|
|
BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
|
498 |
|
|
#endif
|
499 |
|
|
BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN),
|
500 |
|
|
BFD_JUMP_TABLE_RELOCS (bfd_elfNN),
|
501 |
|
|
BFD_JUMP_TABLE_WRITE (bfd_elfNN),
|
502 |
|
|
BFD_JUMP_TABLE_LINK (bfd_elfNN),
|
503 |
|
|
BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN),
|
504 |
|
|
|
505 |
|
|
/* Alternative endian target. */
|
506 |
|
|
#ifdef TARGET_LITTLE_SYM
|
507 |
|
|
& TARGET_LITTLE_SYM,
|
508 |
|
|
#else
|
509 |
|
|
NULL,
|
510 |
|
|
#endif
|
511 |
|
|
|
512 |
|
|
/* backend_data: */
|
513 |
|
|
(PTR) &elfNN_bed
|
514 |
|
|
};
|
515 |
|
|
#endif
|
516 |
|
|
|
517 |
|
|
#ifdef TARGET_LITTLE_SYM
|
518 |
|
|
const bfd_target TARGET_LITTLE_SYM =
|
519 |
|
|
{
|
520 |
|
|
/* name: identify kind of target */
|
521 |
|
|
TARGET_LITTLE_NAME,
|
522 |
|
|
|
523 |
|
|
/* flavour: general indication about file */
|
524 |
|
|
bfd_target_elf_flavour,
|
525 |
|
|
|
526 |
|
|
/* byteorder: data is little endian */
|
527 |
|
|
BFD_ENDIAN_LITTLE,
|
528 |
|
|
|
529 |
|
|
/* header_byteorder: header is also little endian */
|
530 |
|
|
BFD_ENDIAN_LITTLE,
|
531 |
|
|
|
532 |
|
|
/* object_flags: mask of all file flags */
|
533 |
|
|
(HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
|
534 |
|
|
DYNAMIC | WP_TEXT | D_PAGED),
|
535 |
|
|
|
536 |
|
|
/* section_flags: mask of all section flags */
|
537 |
|
|
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
|
538 |
|
|
SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES),
|
539 |
|
|
|
540 |
|
|
/* leading_symbol_char: is the first char of a user symbol
|
541 |
|
|
predictable, and if so what is it */
|
542 |
|
|
elf_symbol_leading_char,
|
543 |
|
|
|
544 |
|
|
/* ar_pad_char: pad character for filenames within an archive header
|
545 |
|
|
FIXME: this really has nothing to do with ELF, this is a characteristic
|
546 |
|
|
of the archiver and/or os and should be independently tunable */
|
547 |
|
|
'/',
|
548 |
|
|
|
549 |
|
|
/* ar_max_namelen: maximum number of characters in an archive header
|
550 |
|
|
FIXME: this really has nothing to do with ELF, this is a characteristic
|
551 |
|
|
of the archiver and should be independently tunable. This value is
|
552 |
|
|
a WAG (wild a** guess) */
|
553 |
|
|
14,
|
554 |
|
|
|
555 |
|
|
/* Routines to byte-swap various sized integers from the data sections */
|
556 |
|
|
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
|
557 |
|
|
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
|
558 |
|
|
bfd_getl16, bfd_getl_signed_16, bfd_putl16,
|
559 |
|
|
|
560 |
|
|
/* Routines to byte-swap various sized integers from the file headers */
|
561 |
|
|
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
|
562 |
|
|
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
|
563 |
|
|
bfd_getl16, bfd_getl_signed_16, bfd_putl16,
|
564 |
|
|
|
565 |
|
|
/* bfd_check_format: check the format of a file being read */
|
566 |
|
|
{ _bfd_dummy_target, /* unknown format */
|
567 |
|
|
bfd_elfNN_object_p, /* assembler/linker output (object file) */
|
568 |
|
|
bfd_elfNN_archive_p, /* an archive */
|
569 |
|
|
bfd_elfNN_core_file_p /* a core file */
|
570 |
|
|
},
|
571 |
|
|
|
572 |
|
|
/* bfd_set_format: set the format of a file being written */
|
573 |
|
|
{ bfd_false,
|
574 |
|
|
bfd_elfNN_mkobject,
|
575 |
|
|
bfd_elfNN_mkarchive,
|
576 |
|
|
bfd_elfNN_mkcorefile
|
577 |
|
|
},
|
578 |
|
|
|
579 |
|
|
/* bfd_write_contents: write cached information into a file being written */
|
580 |
|
|
{ bfd_false,
|
581 |
|
|
bfd_elfNN_write_object_contents,
|
582 |
|
|
bfd_elfNN_write_archive_contents,
|
583 |
|
|
bfd_elfNN_write_corefile_contents,
|
584 |
|
|
},
|
585 |
|
|
|
586 |
|
|
BFD_JUMP_TABLE_GENERIC (bfd_elfNN),
|
587 |
|
|
BFD_JUMP_TABLE_COPY (bfd_elfNN),
|
588 |
|
|
BFD_JUMP_TABLE_CORE (bfd_elfNN),
|
589 |
|
|
#ifdef bfd_elfNN_archive_functions
|
590 |
|
|
BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive),
|
591 |
|
|
#else
|
592 |
|
|
BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
|
593 |
|
|
#endif
|
594 |
|
|
BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN),
|
595 |
|
|
BFD_JUMP_TABLE_RELOCS (bfd_elfNN),
|
596 |
|
|
BFD_JUMP_TABLE_WRITE (bfd_elfNN),
|
597 |
|
|
BFD_JUMP_TABLE_LINK (bfd_elfNN),
|
598 |
|
|
BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN),
|
599 |
|
|
|
600 |
|
|
/* Alternative endian target. */
|
601 |
|
|
#ifdef TARGET_BIG_SYM
|
602 |
|
|
& TARGET_BIG_SYM,
|
603 |
|
|
#else
|
604 |
|
|
NULL,
|
605 |
|
|
#endif
|
606 |
|
|
|
607 |
|
|
/* backend_data: */
|
608 |
|
|
(PTR) &elfNN_bed
|
609 |
|
|
};
|
610 |
|
|
#endif
|