* libelf.h (struct bfd_elf_section_data): Add field dynindx.
[deliverable/binutils-gdb.git] / bfd / libelf.h
1 /* BFD back-end data structures for ELF files.
2 Copyright (C) 1992, 1993 Free Software Foundation, Inc.
3 Written by Cygnus Support.
4
5 This file is part of BFD, the Binary File Descriptor library.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21 #ifndef _LIBELF_H_
22 #define _LIBELF_H_ 1
23
24 #include "elf/common.h"
25 #include "elf/internal.h"
26 #include "elf/external.h"
27 #include "bfdlink.h"
28
29 /* If size isn't specified as 64 or 32, NAME macro should fail. */
30 #ifndef NAME
31 #if ARCH_SIZE==64
32 #define NAME(x,y) CAT4(x,64,_,y)
33 #endif
34 #if ARCH_SIZE==32
35 #define NAME(x,y) CAT4(x,32,_,y)
36 #endif
37 #endif
38
39 #ifndef NAME
40 #define NAME(x,y) CAT4(x,NOSIZE,_,y)
41 #endif
42
43 #define ElfNAME(X) NAME(Elf,X)
44 #define elfNAME(X) NAME(elf,X)
45
46 /* Information held for an ELF symbol. The first field is the
47 corresponding asymbol. Every symbol is an ELF file is actually a
48 pointer to this structure, although it is often handled as a
49 pointer to an asymbol. */
50
51 typedef struct
52 {
53 /* The BFD symbol. */
54 asymbol symbol;
55 /* ELF symbol information. */
56 Elf_Internal_Sym internal_elf_sym;
57 /* Backend specific information. */
58 union
59 {
60 unsigned int hppa_arg_reloc;
61 PTR mips_extr;
62 PTR any;
63 }
64 tc_data;
65 } elf_symbol_type;
66 \f
67 /* ELF linker hash table entries. */
68
69 struct elf_link_hash_entry
70 {
71 struct bfd_link_hash_entry root;
72
73 /* Symbol index in output file. This is initialized to -1. It is
74 set to -2 if the symbol is used by a reloc. */
75 long indx;
76
77 /* Symbol size. */
78 bfd_size_type size;
79
80 /* Symbol index as a dynamic symbol. Initialized to -1, and remains
81 -1 if this is not a dynamic symbol. */
82 long dynindx;
83
84 /* String table index in .dynstr if this is a dynamic symbol. */
85 unsigned long dynstr_index;
86
87 /* If this is a weak defined symbol from a dynamic object, this
88 field points to a defined symbol with the same value, if there is
89 one. Otherwise it is NULL. */
90 struct elf_link_hash_entry *weakdef;
91
92 /* If this symbol requires an entry in the global offset table, the
93 processor specific backend uses this field to hold the offset
94 into the .got section. If this field is -1, then the symbol does
95 not require a global offset table entry. */
96 bfd_vma got_offset;
97
98 /* If this symbol requires an entry in the procedure linkage table,
99 the processor specific backend uses these two fields to hold the
100 offset into the procedure linkage section and the offset into the
101 .got section. If plt_offset is -1, then the symbol does not
102 require an entry in the procedure linkage table. */
103 bfd_vma plt_offset;
104
105 /* Symbol type (STT_NOTYPE, STT_OBJECT, etc.). */
106 char type;
107
108 /* Some flags; legal values follow. */
109 unsigned char elf_link_hash_flags;
110 /* Symbol is referenced by a non-shared object. */
111 #define ELF_LINK_HASH_REF_REGULAR 01
112 /* Symbol is defined by a non-shared object. */
113 #define ELF_LINK_HASH_DEF_REGULAR 02
114 /* Symbol is referenced by a shared object. */
115 #define ELF_LINK_HASH_REF_DYNAMIC 04
116 /* Symbol is defined by a shared object. */
117 #define ELF_LINK_HASH_DEF_DYNAMIC 010
118 /* Dynamic symbol has been adjustd. */
119 #define ELF_LINK_HASH_DYNAMIC_ADJUSTED 020
120 /* Symbol is defined as weak. */
121 #define ELF_LINK_HASH_DEFINED_WEAK 040
122 /* Symbol needs a copy reloc. */
123 #define ELF_LINK_HASH_NEEDS_COPY 0100
124 /* Symbol needs a procedure linkage table entry. */
125 #define ELF_LINK_HASH_NEEDS_PLT 0200
126 };
127
128 /* ELF linker hash table. */
129
130 struct elf_link_hash_table
131 {
132 struct bfd_link_hash_table root;
133 /* Whether we have created the special dynamic sections required
134 when linking against or generating a shared object. */
135 boolean dynamic_sections_created;
136 /* The BFD used to hold special sections created by the linker.
137 This will be the first BFD found which requires these sections to
138 be created. */
139 bfd *dynobj;
140 /* The number of symbols found in the link which must be put into
141 the .dynsym section. */
142 size_t dynsymcount;
143 /* The string table of dynamic symbols, which becomes the .dynstr
144 section. */
145 struct bfd_strtab_hash *dynstr;
146 /* The number of buckets in the hash table in the .hash section.
147 This is based on the number of dynamic symbols. */
148 size_t bucketcount;
149 };
150
151 /* Look up an entry in an ELF linker hash table. */
152
153 #define elf_link_hash_lookup(table, string, create, copy, follow) \
154 ((struct elf_link_hash_entry *) \
155 bfd_link_hash_lookup (&(table)->root, (string), (create), \
156 (copy), (follow)))
157
158 /* Traverse an ELF linker hash table. */
159
160 #define elf_link_hash_traverse(table, func, info) \
161 (bfd_link_hash_traverse \
162 (&(table)->root, \
163 (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \
164 (info)))
165
166 /* Get the ELF linker hash table from a link_info structure. */
167
168 #define elf_hash_table(p) ((struct elf_link_hash_table *) ((p)->hash))
169 \f
170 /* Constant information held for an ELF backend. */
171
172 struct elf_backend_data
173 {
174 /* Whether the backend uses REL or RELA relocations. FIXME: some
175 ELF backends use both. When we need to support one, this whole
176 approach will need to be changed. */
177 int use_rela_p;
178
179 /* Whether this backend is 64 bits or not. FIXME: Who cares? */
180 int elf_64_p;
181
182 /* The architecture for this backend. */
183 enum bfd_architecture arch;
184
185 /* The ELF machine code (EM_xxxx) for this backend. */
186 int elf_machine_code;
187
188 /* The maximum page size for this backend. */
189 bfd_vma maxpagesize;
190
191 /* This is true if the linker should act like collect and gather
192 global constructors and destructors by name. This is true for
193 MIPS ELF because the Irix 5 tools can not handle the .init
194 section. */
195 boolean collect;
196
197 /* A function to translate an ELF RELA relocation to a BFD arelent
198 structure. */
199 void (*elf_info_to_howto) PARAMS ((bfd *, arelent *,
200 Elf_Internal_Rela *));
201
202 /* A function to translate an ELF REL relocation to a BFD arelent
203 structure. */
204 void (*elf_info_to_howto_rel) PARAMS ((bfd *, arelent *,
205 Elf_Internal_Rel *));
206
207 /* A function to determine whether a symbol is global when
208 partitioning the symbol table into local and global symbols.
209 This should be NULL for most targets, in which case the correct
210 thing will be done. MIPS ELF, at least on the Irix 5, has
211 special requirements. */
212 boolean (*elf_backend_sym_is_global) PARAMS ((bfd *, asymbol *));
213
214 /* The remaining functions are hooks which are called only if they
215 are not NULL. */
216
217 /* A function to permit a backend specific check on whether a
218 particular BFD format is relevant for an object file, and to
219 permit the backend to set any global information it wishes. When
220 this is called elf_elfheader is set, but anything else should be
221 used with caution. If this returns false, the check_format
222 routine will return a bfd_error_wrong_format error. */
223 boolean (*elf_backend_object_p) PARAMS ((bfd *));
224
225 /* A function to do additional symbol processing when reading the
226 ELF symbol table. This is where any processor-specific special
227 section indices are handled. */
228 void (*elf_backend_symbol_processing) PARAMS ((bfd *, asymbol *));
229
230 /* A function to do additional symbol processing after reading the
231 entire ELF symbol table. */
232 boolean (*elf_backend_symbol_table_processing) PARAMS ((bfd *,
233 elf_symbol_type *,
234 int));
235
236 /* A function to do additional processing on the ELF section header
237 just before writing it out. This is used to set the flags and
238 type fields for some sections, or to actually write out data for
239 unusual sections. */
240 boolean (*elf_backend_section_processing) PARAMS ((bfd *,
241 Elf32_Internal_Shdr *));
242
243 /* A function to handle unusual section types when creating BFD
244 sections from ELF sections. */
245 boolean (*elf_backend_section_from_shdr) PARAMS ((bfd *,
246 Elf32_Internal_Shdr *,
247 char *));
248
249 /* A function to set up the ELF section header for a BFD section in
250 preparation for writing it out. This is where the flags and type
251 fields are set for unusual sections. */
252 boolean (*elf_backend_fake_sections) PARAMS ((bfd *, Elf32_Internal_Shdr *,
253 asection *));
254
255 /* A function to get the ELF section index for a BFD section. If
256 this returns true, the section was found. If it is a normal ELF
257 section, *RETVAL should be left unchanged. If it is not a normal
258 ELF section *RETVAL should be set to the SHN_xxxx index. */
259 boolean (*elf_backend_section_from_bfd_section)
260 PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *, int *retval));
261
262 /* If this field is not NULL, it is called by the add_symbols phase
263 of a link just before adding a symbol to the global linker hash
264 table. It may modify any of the fields as it wishes. If *NAME
265 is set to NULL, the symbol will be skipped rather than being
266 added to the hash table. This function is responsible for
267 handling all processor dependent symbol bindings and section
268 indices, and must set at least *FLAGS and *SEC for each processor
269 dependent case; failure to do so will cause a link error. */
270 boolean (*elf_add_symbol_hook)
271 PARAMS ((bfd *abfd, struct bfd_link_info *info,
272 const Elf_Internal_Sym *, const char **name,
273 flagword *flags, asection **sec, bfd_vma *value));
274
275 /* If this field is not NULL, it is called by the elf_link_output_sym
276 phase of a link for each symbol which will appear in the object file. */
277 boolean (*elf_backend_link_output_symbol_hook)
278 PARAMS ((bfd *, struct bfd_link_info *info, const char *,
279 Elf_Internal_Sym *, asection *));
280
281 /* The CREATE_DYNAMIC_SECTIONS function is called by the ELF backend
282 linker the first time it encounters a dynamic object in the link.
283 This function must create any sections required for dynamic
284 linking. The ABFD argument is a dynamic object. The .interp,
285 .dynamic, .dynsym, .dynstr, and .hash functions have already been
286 created, and this function may modify the section flags if
287 desired. This function will normally create the .got and .plt
288 sections, but different backends have different requirements. */
289 boolean (*elf_backend_create_dynamic_sections)
290 PARAMS ((bfd *abfd, struct bfd_link_info *info));
291
292 /* The CHECK_RELOCS function is called by the add_symbols phase of
293 the ELF backend linker. It is called once for each section with
294 relocs of an object file, just after the symbols for the object
295 file have been added to the global linker hash table. The
296 function must look through the relocs and do any special handling
297 required. This generally means allocating space in the global
298 offset table, and perhaps allocating space for a reloc. The
299 relocs are always passed as Rela structures; if the section
300 actually uses Rel structures, the r_addend field will always be
301 zero. */
302 boolean (*check_relocs)
303 PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
304 const Elf_Internal_Rela *relocs));
305
306 /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend
307 linker for every symbol which is defined by a dynamic object and
308 referenced by a regular object. This is called after all the
309 input files have been seen, but before the SIZE_DYNAMIC_SECTIONS
310 function has been called. The hash table entry should be
311 bfd_link_hash_defined, and it should be defined in a section from
312 a dynamic object. Dynamic object sections are not included in
313 the final link, and this function is responsible for changing the
314 value to something which the rest of the link can deal with.
315 This will normally involve adding an entry to the .plt or .got or
316 some such section, and setting the symbol to point to that. */
317 boolean (*elf_backend_adjust_dynamic_symbol)
318 PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h));
319
320 /* The SIZE_DYNAMIC_SECTIONS function is called by the ELF backend
321 linker after all the linker input files have been seen but before
322 the sections sizes have been set. This is called after
323 ADJUST_DYNAMIC_SYMBOL has been called on all appropriate symbols.
324 It is only called when linking against a dynamic object. It must
325 set the sizes of the dynamic sections, and may fill in their
326 contents as well. The generic ELF linker can handle the .dynsym,
327 .dynstr and .hash sections. This function must handle the
328 .interp section and any sections created by the
329 CREATE_DYNAMIC_SECTIONS entry point. */
330 boolean (*elf_backend_size_dynamic_sections)
331 PARAMS ((bfd *output_bfd, struct bfd_link_info *info));
332
333 /* The RELOCATE_SECTION function is called by the ELF backend linker
334 to handle the relocations for a section.
335
336 The relocs are always passed as Rela structures; if the section
337 actually uses Rel structures, the r_addend field will always be
338 zero.
339
340 This function is responsible for adjust the section contents as
341 necessary, and (if using Rela relocs and generating a
342 relocateable output file) adjusting the reloc addend as
343 necessary.
344
345 This function does not have to worry about setting the reloc
346 address or the reloc symbol index.
347
348 LOCAL_SYMS is a pointer to the swapped in local symbols.
349
350 LOCAL_SECTIONS is an array giving the section in the input file
351 corresponding to the st_shndx field of each local symbol.
352
353 The global hash table entry for the global symbols can be found
354 via elf_sym_hashes (input_bfd).
355
356 When generating relocateable output, this function must handle
357 STB_LOCAL/STT_SECTION symbols specially. The output symbol is
358 going to be the section symbol corresponding to the output
359 section, which means that the addend must be adjusted
360 accordingly. */
361 boolean (*elf_backend_relocate_section)
362 PARAMS ((bfd *output_bfd, struct bfd_link_info *info,
363 bfd *input_bfd, asection *input_section, bfd_byte *contents,
364 Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms,
365 asection **local_sections));
366
367 /* The FINISH_DYNAMIC_SYMBOL function is called by the ELF backend
368 linker just before it writes a symbol out to the .dynsym section.
369 The processor backend may make any required adjustment to the
370 symbol. It may also take the opportunity to set contents of the
371 dynamic sections. Note that FINISH_DYNAMIC_SYMBOL is called on
372 all .dynsym symbols, while ADJUST_DYNAMIC_SYMBOL is only called
373 on those symbols which are defined by a dynamic object. */
374 boolean (*elf_backend_finish_dynamic_symbol)
375 PARAMS ((bfd *output_bfd, struct bfd_link_info *info,
376 struct elf_link_hash_entry *h, Elf_Internal_Sym *sym));
377
378 /* The FINISH_DYNAMIC_SECTIONS function is called by the ELF backend
379 linker just before it writes all the dynamic sections out to the
380 output file. The FINISH_DYNAMIC_SYMBOL will have been called on
381 all dynamic symbols. */
382 boolean (*elf_backend_finish_dynamic_sections)
383 PARAMS ((bfd *output_bfd, struct bfd_link_info *info));
384
385 /* A function to do any beginning processing needed for the ELF file
386 before building the ELF headers and computing file positions. */
387 void (*elf_backend_begin_write_processing)
388 PARAMS ((bfd *, struct bfd_link_info *));
389
390 /* A function to do any final processing needed for the ELF file
391 before writing it out. The LINKER argument is true if this BFD
392 was created by the ELF backend linker. */
393 void (*elf_backend_final_write_processing)
394 PARAMS ((bfd *, boolean linker));
395
396 /* The swapping table to use when dealing with ECOFF information.
397 Used for the MIPS ELF .mdebug section. */
398 const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap;
399 };
400
401 /* Information stored for each BFD section in an ELF file. This
402 structure is allocated by elf_new_section_hook. */
403
404 struct bfd_elf_section_data {
405 /* The ELF header for this section. */
406 Elf_Internal_Shdr this_hdr;
407 /* The ELF header for the reloc section associated with this
408 section, if any. */
409 Elf_Internal_Shdr rel_hdr;
410 /* The ELF section number of this section. Only used for an output
411 file. */
412 int this_idx;
413 /* The ELF section number of the reloc section associated with this
414 section, if any. Only used for an output file. */
415 int rel_idx;
416 /* Used by the backend linker to store the symbol hash table entries
417 associated with relocs against global symbols. */
418 struct elf_link_hash_entry **rel_hashes;
419 /* A pointer to the swapped relocs. If the section uses REL relocs,
420 rather than RELA, all the r_addend fields will be zero. This
421 pointer may be NULL. It is used by the backend linker. */
422 Elf_Internal_Rela *relocs;
423 /* Used by the backend linker when generating a shared library to
424 record the dynamic symbol index for a section symbol
425 corresponding to this section. */
426 long dynindx;
427 };
428
429 #define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd)
430
431 #define get_elf_backend_data(abfd) \
432 ((struct elf_backend_data *) (abfd)->xvec->backend_data)
433
434 /* Some private data is stashed away for future use using the tdata pointer
435 in the bfd structure. */
436
437 struct elf_obj_tdata
438 {
439 Elf_Internal_Ehdr elf_header[1]; /* Actual data, but ref like ptr */
440 Elf_Internal_Shdr **elf_sect_ptr;
441 Elf_Internal_Phdr *phdr;
442 struct bfd_strtab_hash *strtab_ptr;
443 int num_locals;
444 int num_globals;
445 asymbol **section_syms; /* STT_SECTION symbols for each section */
446 Elf_Internal_Shdr symtab_hdr;
447 Elf_Internal_Shdr shstrtab_hdr;
448 Elf_Internal_Shdr strtab_hdr;
449 Elf_Internal_Shdr dynsymtab_hdr;
450 Elf_Internal_Shdr dynstrtab_hdr;
451 int symtab_section, shstrtab_section, strtab_section, dynsymtab_section;
452 file_ptr next_file_pos;
453 void *prstatus; /* The raw /proc prstatus structure */
454 void *prpsinfo; /* The raw /proc prpsinfo structure */
455 bfd_vma gp; /* The gp value (MIPS only, for now) */
456 int gp_size; /* The gp size (MIPS only, for now) */
457
458 /* This is set to true if the object was created by the backend
459 linker. */
460 boolean linker;
461
462 /* A mapping from external symbols to entries in the linker hash
463 table, used when linking. This is indexed by the symbol index
464 minus the sh_info field of the symbol table header. */
465 struct elf_link_hash_entry **sym_hashes;
466
467 /* A mapping from local symbols to offsets into the global offset
468 table, used when linking. This is indexed by the symbol index. */
469 bfd_vma *local_got_offsets;
470
471 /* The linker ELF emulation code needs to let the backend ELF linker
472 know what filename should be used for a dynamic object if the
473 dynamic object is found using a search. This field is used to
474 hold that information. */
475 const char *dt_needed_name;
476
477 /* Irix 5 often screws up the symbol table, sorting local symbols
478 after global symbols. This flag is set if the symbol table in
479 this BFD appears to be screwed up. If it is, we ignore the
480 sh_info field in the symbol table header, and always read all the
481 symbols. */
482 boolean bad_symtab;
483 };
484
485 #define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data)
486 #define elf_elfheader(bfd) (elf_tdata(bfd) -> elf_header)
487 #define elf_elfsections(bfd) (elf_tdata(bfd) -> elf_sect_ptr)
488 #define elf_shstrtab(bfd) (elf_tdata(bfd) -> strtab_ptr)
489 #define elf_onesymtab(bfd) (elf_tdata(bfd) -> symtab_section)
490 #define elf_dynsymtab(bfd) (elf_tdata(bfd) -> dynsymtab_section)
491 #define elf_num_locals(bfd) (elf_tdata(bfd) -> num_locals)
492 #define elf_num_globals(bfd) (elf_tdata(bfd) -> num_globals)
493 #define elf_section_syms(bfd) (elf_tdata(bfd) -> section_syms)
494 #define core_prpsinfo(bfd) (elf_tdata(bfd) -> prpsinfo)
495 #define core_prstatus(bfd) (elf_tdata(bfd) -> prstatus)
496 #define elf_gp(bfd) (elf_tdata(bfd) -> gp)
497 #define elf_gp_size(bfd) (elf_tdata(bfd) -> gp_size)
498 #define elf_sym_hashes(bfd) (elf_tdata(bfd) -> sym_hashes)
499 #define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got_offsets)
500 #define elf_dt_needed_name(bfd) (elf_tdata(bfd) -> dt_needed_name)
501 #define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab)
502 \f
503 extern char * elf_string_from_elf_section PARAMS ((bfd *, unsigned, unsigned));
504 extern char * elf_get_str_section PARAMS ((bfd *, unsigned));
505
506 extern void bfd_elf_print_symbol PARAMS ((bfd *, PTR, asymbol *,
507 bfd_print_symbol_type));
508
509 #define bfd_elf32_print_symbol bfd_elf_print_symbol
510 #define bfd_elf64_print_symbol bfd_elf_print_symbol
511 #define bfd_elf32_mkobject bfd_elf_mkobject
512 #define bfd_elf64_mkobject bfd_elf_mkobject
513 #define elf_mkobject bfd_elf_mkobject
514
515 extern unsigned long bfd_elf_hash PARAMS ((CONST unsigned char *));
516
517 extern bfd_reloc_status_type bfd_elf_generic_reloc PARAMS ((bfd *,
518 arelent *,
519 asymbol *,
520 PTR,
521 asection *,
522 bfd *,
523 char **));
524 extern boolean bfd_elf_mkobject PARAMS ((bfd *));
525 extern Elf_Internal_Shdr *bfd_elf_find_section PARAMS ((bfd *, char *));
526 extern boolean _bfd_elf_make_section_from_shdr
527 PARAMS ((bfd *abfd, Elf_Internal_Shdr *hdr, const char *name));
528 extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc
529 PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
530 extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create
531 PARAMS ((bfd *));
532 extern boolean _bfd_elf_link_hash_table_init
533 PARAMS ((struct elf_link_hash_table *, bfd *,
534 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
535 struct bfd_hash_table *,
536 const char *)));
537
538 extern boolean bfd_elf32_write_object_contents PARAMS ((bfd *));
539 extern boolean bfd_elf64_write_object_contents PARAMS ((bfd *));
540
541 extern const bfd_target *bfd_elf32_object_p PARAMS ((bfd *));
542 extern const bfd_target *bfd_elf32_core_file_p PARAMS ((bfd *));
543 extern char *bfd_elf32_core_file_failing_command PARAMS ((bfd *));
544 extern int bfd_elf32_core_file_failing_signal PARAMS ((bfd *));
545 extern boolean bfd_elf32_core_file_matches_executable_p PARAMS ((bfd *,
546 bfd *));
547 extern boolean bfd_elf32_set_section_contents PARAMS ((bfd *, sec_ptr, PTR,
548 file_ptr,
549 bfd_size_type));
550
551 extern long bfd_elf32_get_symtab_upper_bound PARAMS ((bfd *));
552 extern long bfd_elf32_get_symtab PARAMS ((bfd *, asymbol **));
553 extern long bfd_elf32_get_dynamic_symtab_upper_bound PARAMS ((bfd *));
554 extern long bfd_elf32_canonicalize_dynamic_symtab PARAMS ((bfd *, asymbol **));
555 extern long bfd_elf32_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr));
556 extern long bfd_elf32_canonicalize_reloc PARAMS ((bfd *, sec_ptr,
557 arelent **, asymbol **));
558 extern asymbol *bfd_elf32_make_empty_symbol PARAMS ((bfd *));
559 extern void bfd_elf32_get_symbol_info PARAMS ((bfd *, asymbol *,
560 symbol_info *));
561 extern alent *bfd_elf32_get_lineno PARAMS ((bfd *, asymbol *));
562 extern boolean bfd_elf32_set_arch_mach PARAMS ((bfd *, enum bfd_architecture,
563 unsigned long));
564 extern boolean bfd_elf32_find_nearest_line PARAMS ((bfd *, asection *,
565 asymbol **,
566 bfd_vma, CONST char **,
567 CONST char **,
568 unsigned int *));
569 extern int bfd_elf32_sizeof_headers PARAMS ((bfd *, boolean));
570 extern void bfd_elf32__write_relocs PARAMS ((bfd *, asection *, PTR));
571 extern boolean bfd_elf32_new_section_hook PARAMS ((bfd *, asection *));
572 extern boolean bfd_elf32_bfd_link_add_symbols
573 PARAMS ((bfd *, struct bfd_link_info *));
574 extern boolean bfd_elf32_bfd_final_link
575 PARAMS ((bfd *, struct bfd_link_info *));
576
577 extern void bfd_elf32_swap_symbol_in
578 PARAMS ((bfd *, Elf32_External_Sym *, Elf_Internal_Sym *));
579 extern void bfd_elf32_swap_symbol_out
580 PARAMS ((bfd *, Elf_Internal_Sym *, Elf32_External_Sym *));
581 extern void bfd_elf32_swap_reloc_in
582 PARAMS ((bfd *, Elf32_External_Rel *, Elf_Internal_Rel *));
583 extern void bfd_elf32_swap_reloc_out
584 PARAMS ((bfd *, Elf_Internal_Rel *, Elf32_External_Rel *));
585 extern void bfd_elf32_swap_reloca_in
586 PARAMS ((bfd *, Elf32_External_Rela *, Elf_Internal_Rela *));
587 extern void bfd_elf32_swap_reloca_out
588 PARAMS ((bfd *, Elf_Internal_Rela *, Elf32_External_Rela *));
589 extern void bfd_elf32_swap_dyn_in
590 PARAMS ((bfd *, const Elf32_External_Dyn *, Elf_Internal_Dyn *));
591 extern void bfd_elf32_swap_dyn_out
592 PARAMS ((bfd *, const Elf_Internal_Dyn *, Elf32_External_Dyn *));
593 extern boolean bfd_elf32_add_dynamic_entry
594 PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
595 extern boolean bfd_elf32_link_create_dynamic_sections
596 PARAMS ((bfd *, struct bfd_link_info *));
597 extern boolean bfd_elf32_link_record_dynamic_symbol
598 PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
599
600 /* If the target doesn't have reloc handling written yet: */
601 extern void bfd_elf32_no_info_to_howto PARAMS ((bfd *, arelent *,
602 Elf32_Internal_Rela *));
603
604 extern const bfd_target *bfd_elf64_object_p PARAMS ((bfd *));
605 extern const bfd_target *bfd_elf64_core_file_p PARAMS ((bfd *));
606 extern char *bfd_elf64_core_file_failing_command PARAMS ((bfd *));
607 extern int bfd_elf64_core_file_failing_signal PARAMS ((bfd *));
608 extern boolean bfd_elf64_core_file_matches_executable_p PARAMS ((bfd *,
609 bfd *));
610 extern boolean bfd_elf64_set_section_contents PARAMS ((bfd *, sec_ptr, PTR,
611 file_ptr,
612 bfd_size_type));
613
614 extern long bfd_elf64_get_symtab_upper_bound PARAMS ((bfd *));
615 extern long bfd_elf64_get_symtab PARAMS ((bfd *, asymbol **));
616 extern long bfd_elf64_get_dynamic_symtab_upper_bound PARAMS ((bfd *));
617 extern long bfd_elf64_canonicalize_dynamic_symtab PARAMS ((bfd *, asymbol **));
618 extern long bfd_elf64_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr));
619 extern long bfd_elf64_canonicalize_reloc PARAMS ((bfd *, sec_ptr,
620 arelent **, asymbol **));
621 extern asymbol *bfd_elf64_make_empty_symbol PARAMS ((bfd *));
622 extern void bfd_elf64_get_symbol_info PARAMS ((bfd *, asymbol *,
623 symbol_info *));
624 extern alent *bfd_elf64_get_lineno PARAMS ((bfd *, asymbol *));
625 extern boolean bfd_elf64_set_arch_mach PARAMS ((bfd *, enum bfd_architecture,
626 unsigned long));
627 extern boolean bfd_elf64_find_nearest_line PARAMS ((bfd *, asection *,
628 asymbol **,
629 bfd_vma, CONST char **,
630 CONST char **,
631 unsigned int *));
632 extern int bfd_elf64_sizeof_headers PARAMS ((bfd *, boolean));
633 extern void bfd_elf64__write_relocs PARAMS ((bfd *, asection *, PTR));
634 extern boolean bfd_elf64_new_section_hook PARAMS ((bfd *, asection *));
635 extern boolean bfd_elf64_bfd_link_add_symbols
636 PARAMS ((bfd *, struct bfd_link_info *));
637 extern boolean bfd_elf64_bfd_final_link
638 PARAMS ((bfd *, struct bfd_link_info *));
639
640 extern void bfd_elf64_swap_symbol_in
641 PARAMS ((bfd *, Elf64_External_Sym *, Elf_Internal_Sym *));
642 extern void bfd_elf64_swap_symbol_out
643 PARAMS ((bfd *, Elf_Internal_Sym *, Elf64_External_Sym *));
644 extern void bfd_elf64_swap_reloc_in
645 PARAMS ((bfd *, Elf64_External_Rel *, Elf_Internal_Rel *));
646 extern void bfd_elf64_swap_reloc_out
647 PARAMS ((bfd *, Elf_Internal_Rel *, Elf64_External_Rel *));
648 extern void bfd_elf64_swap_reloca_in
649 PARAMS ((bfd *, Elf64_External_Rela *, Elf_Internal_Rela *));
650 extern void bfd_elf64_swap_reloca_out
651 PARAMS ((bfd *, Elf_Internal_Rela *, Elf64_External_Rela *));
652 extern void bfd_elf64_swap_dyn_in
653 PARAMS ((bfd *, const Elf64_External_Dyn *, Elf_Internal_Dyn *));
654 extern void bfd_elf64_swap_dyn_out
655 PARAMS ((bfd *, const Elf_Internal_Dyn *, Elf64_External_Dyn *));
656 extern boolean bfd_elf64_add_dynamic_entry
657 PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
658 extern boolean bfd_elf64_link_create_dynamic_sections
659 PARAMS ((bfd *, struct bfd_link_info *));
660 extern boolean bfd_elf64_link_record_dynamic_symbol
661 PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
662
663 /* If the target doesn't have reloc handling written yet: */
664 extern void bfd_elf64_no_info_to_howto PARAMS ((bfd *, arelent *,
665 Elf64_Internal_Rela *));
666
667 #endif /* _LIBELF_H_ */
This page took 0.044819 seconds and 5 git commands to generate.