1 /* BFD back-end data structures for ELF files.
2 Copyright (C) 1992, 1993 Free Software Foundation, Inc.
3 Written by Cygnus Support.
5 This file is part of BFD, the Binary File Descriptor library.
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.
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.
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. */
24 #include "elf/common.h"
25 #include "elf/internal.h"
26 #include "elf/external.h"
29 /* If size isn't specified as 64 or 32, NAME macro should fail. */
32 #define NAME(x,y) CAT4(x,64,_,y)
35 #define NAME(x,y) CAT4(x,32,_,y)
40 #define NAME(x,y) CAT4(x,NOSIZE,_,y)
43 #define ElfNAME(X) NAME(Elf,X)
44 #define elfNAME(X) NAME(elf,X)
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. */
55 /* ELF symbol information. */
56 Elf_Internal_Sym internal_elf_sym
;
57 /* Backend specific information. */
60 unsigned int hppa_arg_reloc
;
67 /* ELF linker hash table entries. */
69 struct elf_link_hash_entry
71 struct bfd_link_hash_entry root
;
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. */
80 /* Symbol index as a dynamic symbol. Initialized to -1, and remains
81 -1 if this is not a dynamic symbol. */
84 /* String table index in .dynstr if this is a dynamic symbol. */
85 unsigned long dynstr_index
;
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
;
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. */
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. */
105 /* Symbol type (STT_NOTYPE, STT_OBJECT, etc.). */
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 needs a copy reloc. */
121 #define ELF_LINK_HASH_NEEDS_COPY 040
122 /* Symbol needs a procedure linkage table entry. */
123 #define ELF_LINK_HASH_NEEDS_PLT 0100
126 /* ELF linker hash table. */
128 struct elf_link_hash_table
130 struct bfd_link_hash_table root
;
131 /* Whether we have created the special dynamic sections required
132 when linking against or generating a shared object. */
133 boolean dynamic_sections_created
;
134 /* The BFD used to hold special sections created by the linker.
135 This will be the first BFD found which requires these sections to
138 /* The number of symbols found in the link which must be put into
139 the .dynsym section. */
141 /* The string table of dynamic symbols, which becomes the .dynstr
143 struct bfd_strtab_hash
*dynstr
;
144 /* The number of buckets in the hash table in the .hash section.
145 This is based on the number of dynamic symbols. */
147 /* Whether we are linking against a dynamic object which has a
148 DT_NEEDED entry in the .dynamic section. This may need to become
149 a list of DT_NEEDED entries. */
153 /* Look up an entry in an ELF linker hash table. */
155 #define elf_link_hash_lookup(table, string, create, copy, follow) \
156 ((struct elf_link_hash_entry *) \
157 bfd_link_hash_lookup (&(table)->root, (string), (create), \
160 /* Traverse an ELF linker hash table. */
162 #define elf_link_hash_traverse(table, func, info) \
163 (bfd_link_hash_traverse \
165 (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \
168 /* Get the ELF linker hash table from a link_info structure. */
170 #define elf_hash_table(p) ((struct elf_link_hash_table *) ((p)->hash))
172 /* Constant information held for an ELF backend. */
174 struct elf_backend_data
176 /* Whether the backend uses REL or RELA relocations. FIXME: some
177 ELF backends use both. When we need to support one, this whole
178 approach will need to be changed. */
181 /* Whether this backend is 64 bits or not. FIXME: Who cares? */
184 /* The architecture for this backend. */
185 enum bfd_architecture arch
;
187 /* The ELF machine code (EM_xxxx) for this backend. */
188 int elf_machine_code
;
190 /* The maximum page size for this backend. */
193 /* This is true if the linker should act like collect and gather
194 global constructors and destructors by name. This is true for
195 MIPS ELF because the Irix 5 tools can not handle the .init
199 /* A function to translate an ELF RELA relocation to a BFD arelent
201 void (*elf_info_to_howto
) PARAMS ((bfd
*, arelent
*,
202 Elf_Internal_Rela
*));
204 /* A function to translate an ELF REL relocation to a BFD arelent
206 void (*elf_info_to_howto_rel
) PARAMS ((bfd
*, arelent
*,
207 Elf_Internal_Rel
*));
209 /* A function to determine whether a symbol is global when
210 partitioning the symbol table into local and global symbols.
211 This should be NULL for most targets, in which case the correct
212 thing will be done. MIPS ELF, at least on the Irix 5, has
213 special requirements. */
214 boolean (*elf_backend_sym_is_global
) PARAMS ((bfd
*, asymbol
*));
216 /* The remaining functions are hooks which are called only if they
219 /* A function to permit a backend specific check on whether a
220 particular BFD format is relevant for an object file, and to
221 permit the backend to set any global information it wishes. When
222 this is called elf_elfheader is set, but anything else should be
223 used with caution. If this returns false, the check_format
224 routine will return a bfd_error_wrong_format error. */
225 boolean (*elf_backend_object_p
) PARAMS ((bfd
*));
227 /* A function to do additional symbol processing when reading the
228 ELF symbol table. This is where any processor-specific special
229 section indices are handled. */
230 void (*elf_backend_symbol_processing
) PARAMS ((bfd
*, asymbol
*));
232 /* A function to do additional symbol processing after reading the
233 entire ELF symbol table. */
234 boolean (*elf_backend_symbol_table_processing
) PARAMS ((bfd
*,
238 /* A function to do additional processing on the ELF section header
239 just before writing it out. This is used to set the flags and
240 type fields for some sections, or to actually write out data for
242 boolean (*elf_backend_section_processing
) PARAMS ((bfd
*,
243 Elf32_Internal_Shdr
*));
245 /* A function to handle unusual section types when creating BFD
246 sections from ELF sections. */
247 boolean (*elf_backend_section_from_shdr
) PARAMS ((bfd
*,
248 Elf32_Internal_Shdr
*,
251 /* A function to set up the ELF section header for a BFD section in
252 preparation for writing it out. This is where the flags and type
253 fields are set for unusual sections. */
254 boolean (*elf_backend_fake_sections
) PARAMS ((bfd
*, Elf32_Internal_Shdr
*,
257 /* A function to get the ELF section index for a BFD section. If
258 this returns true, the section was found. If it is a normal ELF
259 section, *RETVAL should be left unchanged. If it is not a normal
260 ELF section *RETVAL should be set to the SHN_xxxx index. */
261 boolean (*elf_backend_section_from_bfd_section
)
262 PARAMS ((bfd
*, Elf32_Internal_Shdr
*, asection
*, int *retval
));
264 /* If this field is not NULL, it is called by the add_symbols phase
265 of a link just before adding a symbol to the global linker hash
266 table. It may modify any of the fields as it wishes. If *NAME
267 is set to NULL, the symbol will be skipped rather than being
268 added to the hash table. This function is responsible for
269 handling all processor dependent symbol bindings and section
270 indices, and must set at least *FLAGS and *SEC for each processor
271 dependent case; failure to do so will cause a link error. */
272 boolean (*elf_add_symbol_hook
)
273 PARAMS ((bfd
*abfd
, struct bfd_link_info
*info
,
274 const Elf_Internal_Sym
*, const char **name
,
275 flagword
*flags
, asection
**sec
, bfd_vma
*value
));
277 /* If this field is not NULL, it is called by the elf_link_output_sym
278 phase of a link for each symbol which will appear in the object file. */
279 boolean (*elf_backend_link_output_symbol_hook
)
280 PARAMS ((bfd
*, struct bfd_link_info
*info
, const char *,
281 Elf_Internal_Sym
*, asection
*));
283 /* The CREATE_DYNAMIC_SECTIONS function is called by the ELF backend
284 linker the first time it encounters a dynamic object in the link.
285 This function must create any sections required for dynamic
286 linking. The ABFD argument is a dynamic object. The .interp,
287 .dynamic, .dynsym, .dynstr, and .hash functions have already been
288 created, and this function may modify the section flags if
289 desired. This function will normally create the .got and .plt
290 sections, but different backends have different requirements. */
291 boolean (*elf_backend_create_dynamic_sections
)
292 PARAMS ((bfd
*abfd
, struct bfd_link_info
*info
));
294 /* The CHECK_RELOCS function is called by the add_symbols phase of
295 the ELF backend linker. It is called once for each section with
296 relocs of an object file, just after the symbols for the object
297 file have been added to the global linker hash table. The
298 function must look through the relocs and do any special handling
299 required. This generally means allocating space in the global
300 offset table, and perhaps allocating space for a reloc. The
301 relocs are always passed as Rela structures; if the section
302 actually uses Rel structures, the r_addend field will always be
304 boolean (*check_relocs
)
305 PARAMS ((bfd
*abfd
, struct bfd_link_info
*info
, asection
*o
,
306 const Elf_Internal_Rela
*relocs
));
308 /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend
309 linker for every symbol which is defined by a dynamic object and
310 referenced by a regular object. This is called after all the
311 input files have been seen, but before the SIZE_DYNAMIC_SECTIONS
312 function has been called. The hash table entry should be
313 bfd_link_hash_defined ore bfd_link_hash_defweak, and it should be
314 defined in a section from a dynamic object. Dynamic object
315 sections are not included in the final link, and this function is
316 responsible for changing the value to something which the rest of
317 the link can deal with. This will normally involve adding an
318 entry to the .plt or .got or some such section, and setting the
319 symbol to point to that. */
320 boolean (*elf_backend_adjust_dynamic_symbol
)
321 PARAMS ((struct bfd_link_info
*info
, struct elf_link_hash_entry
*h
));
323 /* The SIZE_DYNAMIC_SECTIONS function is called by the ELF backend
324 linker after all the linker input files have been seen but before
325 the sections sizes have been set. This is called after
326 ADJUST_DYNAMIC_SYMBOL has been called on all appropriate symbols.
327 It is only called when linking against a dynamic object. It must
328 set the sizes of the dynamic sections, and may fill in their
329 contents as well. The generic ELF linker can handle the .dynsym,
330 .dynstr and .hash sections. This function must handle the
331 .interp section and any sections created by the
332 CREATE_DYNAMIC_SECTIONS entry point. */
333 boolean (*elf_backend_size_dynamic_sections
)
334 PARAMS ((bfd
*output_bfd
, struct bfd_link_info
*info
));
336 /* The RELOCATE_SECTION function is called by the ELF backend linker
337 to handle the relocations for a section.
339 The relocs are always passed as Rela structures; if the section
340 actually uses Rel structures, the r_addend field will always be
343 This function is responsible for adjust the section contents as
344 necessary, and (if using Rela relocs and generating a
345 relocateable output file) adjusting the reloc addend as
348 This function does not have to worry about setting the reloc
349 address or the reloc symbol index.
351 LOCAL_SYMS is a pointer to the swapped in local symbols.
353 LOCAL_SECTIONS is an array giving the section in the input file
354 corresponding to the st_shndx field of each local symbol.
356 The global hash table entry for the global symbols can be found
357 via elf_sym_hashes (input_bfd).
359 When generating relocateable output, this function must handle
360 STB_LOCAL/STT_SECTION symbols specially. The output symbol is
361 going to be the section symbol corresponding to the output
362 section, which means that the addend must be adjusted
364 boolean (*elf_backend_relocate_section
)
365 PARAMS ((bfd
*output_bfd
, struct bfd_link_info
*info
,
366 bfd
*input_bfd
, asection
*input_section
, bfd_byte
*contents
,
367 Elf_Internal_Rela
*relocs
, Elf_Internal_Sym
*local_syms
,
368 asection
**local_sections
));
370 /* The FINISH_DYNAMIC_SYMBOL function is called by the ELF backend
371 linker just before it writes a symbol out to the .dynsym section.
372 The processor backend may make any required adjustment to the
373 symbol. It may also take the opportunity to set contents of the
374 dynamic sections. Note that FINISH_DYNAMIC_SYMBOL is called on
375 all .dynsym symbols, while ADJUST_DYNAMIC_SYMBOL is only called
376 on those symbols which are defined by a dynamic object. */
377 boolean (*elf_backend_finish_dynamic_symbol
)
378 PARAMS ((bfd
*output_bfd
, struct bfd_link_info
*info
,
379 struct elf_link_hash_entry
*h
, Elf_Internal_Sym
*sym
));
381 /* The FINISH_DYNAMIC_SECTIONS function is called by the ELF backend
382 linker just before it writes all the dynamic sections out to the
383 output file. The FINISH_DYNAMIC_SYMBOL will have been called on
384 all dynamic symbols. */
385 boolean (*elf_backend_finish_dynamic_sections
)
386 PARAMS ((bfd
*output_bfd
, struct bfd_link_info
*info
));
388 /* A function to do any beginning processing needed for the ELF file
389 before building the ELF headers and computing file positions. */
390 void (*elf_backend_begin_write_processing
)
391 PARAMS ((bfd
*, struct bfd_link_info
*));
393 /* A function to do any final processing needed for the ELF file
394 before writing it out. The LINKER argument is true if this BFD
395 was created by the ELF backend linker. */
396 void (*elf_backend_final_write_processing
)
397 PARAMS ((bfd
*, boolean linker
));
399 /* The swapping table to use when dealing with ECOFF information.
400 Used for the MIPS ELF .mdebug section. */
401 const struct ecoff_debug_swap
*elf_backend_ecoff_debug_swap
;
403 /* Alternate EM_xxxx machine codes for this backend. */
404 int elf_machine_alt1
;
405 int elf_machine_alt2
;
408 /* Information stored for each BFD section in an ELF file. This
409 structure is allocated by elf_new_section_hook. */
411 struct bfd_elf_section_data
{
412 /* The ELF header for this section. */
413 Elf_Internal_Shdr this_hdr
;
414 /* The ELF header for the reloc section associated with this
416 Elf_Internal_Shdr rel_hdr
;
417 /* The ELF section number of this section. Only used for an output
420 /* The ELF section number of the reloc section associated with this
421 section, if any. Only used for an output file. */
423 /* Used by the backend linker to store the symbol hash table entries
424 associated with relocs against global symbols. */
425 struct elf_link_hash_entry
**rel_hashes
;
426 /* A pointer to the swapped relocs. If the section uses REL relocs,
427 rather than RELA, all the r_addend fields will be zero. This
428 pointer may be NULL. It is used by the backend linker. */
429 Elf_Internal_Rela
*relocs
;
430 /* Used by the backend linker when generating a shared library to
431 record the dynamic symbol index for a section symbol
432 corresponding to this section. */
436 #define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd)
438 #define get_elf_backend_data(abfd) \
439 ((struct elf_backend_data *) (abfd)->xvec->backend_data)
441 /* Some private data is stashed away for future use using the tdata pointer
442 in the bfd structure. */
446 Elf_Internal_Ehdr elf_header
[1]; /* Actual data, but ref like ptr */
447 Elf_Internal_Shdr
**elf_sect_ptr
;
448 Elf_Internal_Phdr
*phdr
;
449 struct bfd_strtab_hash
*strtab_ptr
;
452 asymbol
**section_syms
; /* STT_SECTION symbols for each section */
453 Elf_Internal_Shdr symtab_hdr
;
454 Elf_Internal_Shdr shstrtab_hdr
;
455 Elf_Internal_Shdr strtab_hdr
;
456 Elf_Internal_Shdr dynsymtab_hdr
;
457 Elf_Internal_Shdr dynstrtab_hdr
;
458 int symtab_section
, shstrtab_section
, strtab_section
, dynsymtab_section
;
459 file_ptr next_file_pos
;
460 void *prstatus
; /* The raw /proc prstatus structure */
461 void *prpsinfo
; /* The raw /proc prpsinfo structure */
462 bfd_vma gp
; /* The gp value (MIPS only, for now) */
463 int gp_size
; /* The gp size (MIPS only, for now) */
465 /* This is set to true if the object was created by the backend
469 /* A mapping from external symbols to entries in the linker hash
470 table, used when linking. This is indexed by the symbol index
471 minus the sh_info field of the symbol table header. */
472 struct elf_link_hash_entry
**sym_hashes
;
474 /* A mapping from local symbols to offsets into the global offset
475 table, used when linking. This is indexed by the symbol index. */
476 bfd_vma
*local_got_offsets
;
478 /* The linker ELF emulation code needs to let the backend ELF linker
479 know what filename should be used for a dynamic object if the
480 dynamic object is found using a search. This field is used to
481 hold that information. */
482 const char *dt_needed_name
;
484 /* Irix 5 often screws up the symbol table, sorting local symbols
485 after global symbols. This flag is set if the symbol table in
486 this BFD appears to be screwed up. If it is, we ignore the
487 sh_info field in the symbol table header, and always read all the
491 /* Records the result of `get_program_header_size'. */
492 bfd_size_type program_header_size
;
494 /* Used by MIPS ELF find_nearest_line entry point. The structure
495 could be included directly in this one, but there's no point to
496 wasting the memory just for the infrequently called
497 find_nearest_line. */
498 struct mips_elf_find_line
*find_line_info
;
500 /* Used by PowerPC to determine if the e_flags field has been intiialized */
501 boolean ppc_flags_init
;
504 #define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data)
505 #define elf_elfheader(bfd) (elf_tdata(bfd) -> elf_header)
506 #define elf_elfsections(bfd) (elf_tdata(bfd) -> elf_sect_ptr)
507 #define elf_shstrtab(bfd) (elf_tdata(bfd) -> strtab_ptr)
508 #define elf_onesymtab(bfd) (elf_tdata(bfd) -> symtab_section)
509 #define elf_dynsymtab(bfd) (elf_tdata(bfd) -> dynsymtab_section)
510 #define elf_num_locals(bfd) (elf_tdata(bfd) -> num_locals)
511 #define elf_num_globals(bfd) (elf_tdata(bfd) -> num_globals)
512 #define elf_section_syms(bfd) (elf_tdata(bfd) -> section_syms)
513 #define core_prpsinfo(bfd) (elf_tdata(bfd) -> prpsinfo)
514 #define core_prstatus(bfd) (elf_tdata(bfd) -> prstatus)
515 #define elf_gp(bfd) (elf_tdata(bfd) -> gp)
516 #define elf_gp_size(bfd) (elf_tdata(bfd) -> gp_size)
517 #define elf_sym_hashes(bfd) (elf_tdata(bfd) -> sym_hashes)
518 #define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got_offsets)
519 #define elf_dt_needed_name(bfd) (elf_tdata(bfd) -> dt_needed_name)
520 #define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab)
521 #define elf_ppc_flags_init(bfd) (elf_tdata(bfd) -> ppc_flags_init)
523 extern char * elf_string_from_elf_section
PARAMS ((bfd
*, unsigned, unsigned));
524 extern char * elf_get_str_section
PARAMS ((bfd
*, unsigned));
526 extern void bfd_elf_print_symbol
PARAMS ((bfd
*, PTR
, asymbol
*,
527 bfd_print_symbol_type
));
529 #define bfd_elf32_print_symbol bfd_elf_print_symbol
530 #define bfd_elf64_print_symbol bfd_elf_print_symbol
531 #define bfd_elf32_mkobject bfd_elf_mkobject
532 #define bfd_elf64_mkobject bfd_elf_mkobject
533 #define elf_mkobject bfd_elf_mkobject
535 extern unsigned long bfd_elf_hash
PARAMS ((CONST
unsigned char *));
537 extern bfd_reloc_status_type bfd_elf_generic_reloc
PARAMS ((bfd
*,
544 extern boolean bfd_elf_mkobject
PARAMS ((bfd
*));
545 extern Elf_Internal_Shdr
*bfd_elf_find_section
PARAMS ((bfd
*, char *));
546 extern boolean _bfd_elf_make_section_from_shdr
547 PARAMS ((bfd
*abfd
, Elf_Internal_Shdr
*hdr
, const char *name
));
548 extern struct bfd_hash_entry
*_bfd_elf_link_hash_newfunc
549 PARAMS ((struct bfd_hash_entry
*, struct bfd_hash_table
*, const char *));
550 extern struct bfd_link_hash_table
*_bfd_elf_link_hash_table_create
552 extern boolean _bfd_elf_link_hash_table_init
553 PARAMS ((struct elf_link_hash_table
*, bfd
*,
554 struct bfd_hash_entry
*(*) (struct bfd_hash_entry
*,
555 struct bfd_hash_table
*,
558 extern boolean bfd_elf32_write_object_contents
PARAMS ((bfd
*));
559 extern boolean bfd_elf64_write_object_contents
PARAMS ((bfd
*));
561 extern const bfd_target
*bfd_elf32_object_p
PARAMS ((bfd
*));
562 extern const bfd_target
*bfd_elf32_core_file_p
PARAMS ((bfd
*));
563 extern char *bfd_elf32_core_file_failing_command
PARAMS ((bfd
*));
564 extern int bfd_elf32_core_file_failing_signal
PARAMS ((bfd
*));
565 extern boolean bfd_elf32_core_file_matches_executable_p
PARAMS ((bfd
*,
567 extern boolean bfd_elf32_set_section_contents
PARAMS ((bfd
*, sec_ptr
, PTR
,
571 extern long bfd_elf32_get_symtab_upper_bound
PARAMS ((bfd
*));
572 extern long bfd_elf32_get_symtab
PARAMS ((bfd
*, asymbol
**));
573 extern long bfd_elf32_get_dynamic_symtab_upper_bound
PARAMS ((bfd
*));
574 extern long bfd_elf32_canonicalize_dynamic_symtab
PARAMS ((bfd
*, asymbol
**));
575 extern long bfd_elf32_get_reloc_upper_bound
PARAMS ((bfd
*, sec_ptr
));
576 extern long bfd_elf32_canonicalize_reloc
PARAMS ((bfd
*, sec_ptr
,
577 arelent
**, asymbol
**));
578 extern asymbol
*bfd_elf32_make_empty_symbol
PARAMS ((bfd
*));
579 extern void bfd_elf32_get_symbol_info
PARAMS ((bfd
*, asymbol
*,
581 extern alent
*bfd_elf32_get_lineno
PARAMS ((bfd
*, asymbol
*));
582 extern boolean bfd_elf32_set_arch_mach
PARAMS ((bfd
*, enum bfd_architecture
,
584 extern boolean bfd_elf32_find_nearest_line
PARAMS ((bfd
*, asection
*,
586 bfd_vma
, CONST
char **,
589 extern int bfd_elf32_sizeof_headers
PARAMS ((bfd
*, boolean
));
590 extern boolean bfd_elf32_new_section_hook
PARAMS ((bfd
*, asection
*));
591 extern boolean bfd_elf32_bfd_link_add_symbols
592 PARAMS ((bfd
*, struct bfd_link_info
*));
593 extern boolean bfd_elf32_bfd_final_link
594 PARAMS ((bfd
*, struct bfd_link_info
*));
596 extern void bfd_elf32_swap_symbol_in
597 PARAMS ((bfd
*, Elf32_External_Sym
*, Elf_Internal_Sym
*));
598 extern void bfd_elf32_swap_symbol_out
599 PARAMS ((bfd
*, Elf_Internal_Sym
*, Elf32_External_Sym
*));
600 extern void bfd_elf32_swap_reloc_in
601 PARAMS ((bfd
*, Elf32_External_Rel
*, Elf_Internal_Rel
*));
602 extern void bfd_elf32_swap_reloc_out
603 PARAMS ((bfd
*, Elf_Internal_Rel
*, Elf32_External_Rel
*));
604 extern void bfd_elf32_swap_reloca_in
605 PARAMS ((bfd
*, Elf32_External_Rela
*, Elf_Internal_Rela
*));
606 extern void bfd_elf32_swap_reloca_out
607 PARAMS ((bfd
*, Elf_Internal_Rela
*, Elf32_External_Rela
*));
608 extern void bfd_elf32_swap_dyn_in
609 PARAMS ((bfd
*, const Elf32_External_Dyn
*, Elf_Internal_Dyn
*));
610 extern void bfd_elf32_swap_dyn_out
611 PARAMS ((bfd
*, const Elf_Internal_Dyn
*, Elf32_External_Dyn
*));
612 extern boolean bfd_elf32_add_dynamic_entry
613 PARAMS ((struct bfd_link_info
*, bfd_vma
, bfd_vma
));
614 extern boolean bfd_elf32_link_create_dynamic_sections
615 PARAMS ((bfd
*, struct bfd_link_info
*));
616 extern boolean bfd_elf32_link_record_dynamic_symbol
617 PARAMS ((struct bfd_link_info
*, struct elf_link_hash_entry
*));
619 /* If the target doesn't have reloc handling written yet: */
620 extern void bfd_elf32_no_info_to_howto
PARAMS ((bfd
*, arelent
*,
621 Elf32_Internal_Rela
*));
623 extern const bfd_target
*bfd_elf64_object_p
PARAMS ((bfd
*));
624 extern const bfd_target
*bfd_elf64_core_file_p
PARAMS ((bfd
*));
625 extern char *bfd_elf64_core_file_failing_command
PARAMS ((bfd
*));
626 extern int bfd_elf64_core_file_failing_signal
PARAMS ((bfd
*));
627 extern boolean bfd_elf64_core_file_matches_executable_p
PARAMS ((bfd
*,
629 extern boolean bfd_elf64_set_section_contents
PARAMS ((bfd
*, sec_ptr
, PTR
,
633 extern long bfd_elf64_get_symtab_upper_bound
PARAMS ((bfd
*));
634 extern long bfd_elf64_get_symtab
PARAMS ((bfd
*, asymbol
**));
635 extern long bfd_elf64_get_dynamic_symtab_upper_bound
PARAMS ((bfd
*));
636 extern long bfd_elf64_canonicalize_dynamic_symtab
PARAMS ((bfd
*, asymbol
**));
637 extern long bfd_elf64_get_reloc_upper_bound
PARAMS ((bfd
*, sec_ptr
));
638 extern long bfd_elf64_canonicalize_reloc
PARAMS ((bfd
*, sec_ptr
,
639 arelent
**, asymbol
**));
640 extern asymbol
*bfd_elf64_make_empty_symbol
PARAMS ((bfd
*));
641 extern void bfd_elf64_get_symbol_info
PARAMS ((bfd
*, asymbol
*,
643 extern alent
*bfd_elf64_get_lineno
PARAMS ((bfd
*, asymbol
*));
644 extern boolean bfd_elf64_set_arch_mach
PARAMS ((bfd
*, enum bfd_architecture
,
646 extern boolean bfd_elf64_find_nearest_line
PARAMS ((bfd
*, asection
*,
648 bfd_vma
, CONST
char **,
651 extern int bfd_elf64_sizeof_headers
PARAMS ((bfd
*, boolean
));
652 extern boolean bfd_elf64_new_section_hook
PARAMS ((bfd
*, asection
*));
653 extern boolean bfd_elf64_bfd_link_add_symbols
654 PARAMS ((bfd
*, struct bfd_link_info
*));
655 extern boolean bfd_elf64_bfd_final_link
656 PARAMS ((bfd
*, struct bfd_link_info
*));
658 extern void bfd_elf64_swap_symbol_in
659 PARAMS ((bfd
*, Elf64_External_Sym
*, Elf_Internal_Sym
*));
660 extern void bfd_elf64_swap_symbol_out
661 PARAMS ((bfd
*, Elf_Internal_Sym
*, Elf64_External_Sym
*));
662 extern void bfd_elf64_swap_reloc_in
663 PARAMS ((bfd
*, Elf64_External_Rel
*, Elf_Internal_Rel
*));
664 extern void bfd_elf64_swap_reloc_out
665 PARAMS ((bfd
*, Elf_Internal_Rel
*, Elf64_External_Rel
*));
666 extern void bfd_elf64_swap_reloca_in
667 PARAMS ((bfd
*, Elf64_External_Rela
*, Elf_Internal_Rela
*));
668 extern void bfd_elf64_swap_reloca_out
669 PARAMS ((bfd
*, Elf_Internal_Rela
*, Elf64_External_Rela
*));
670 extern void bfd_elf64_swap_dyn_in
671 PARAMS ((bfd
*, const Elf64_External_Dyn
*, Elf_Internal_Dyn
*));
672 extern void bfd_elf64_swap_dyn_out
673 PARAMS ((bfd
*, const Elf_Internal_Dyn
*, Elf64_External_Dyn
*));
674 extern boolean bfd_elf64_add_dynamic_entry
675 PARAMS ((struct bfd_link_info
*, bfd_vma
, bfd_vma
));
676 extern boolean bfd_elf64_link_create_dynamic_sections
677 PARAMS ((bfd
*, struct bfd_link_info
*));
678 extern boolean bfd_elf64_link_record_dynamic_symbol
679 PARAMS ((struct bfd_link_info
*, struct elf_link_hash_entry
*));
681 /* If the target doesn't have reloc handling written yet: */
682 extern void bfd_elf64_no_info_to_howto
PARAMS ((bfd
*, arelent
*,
683 Elf64_Internal_Rela
*));
685 #endif /* _LIBELF_H_ */