X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf-bfd.h;h=82da5bb2babb0b82e925a76d440bedc4eace7132;hb=80fccad2d4ce82a2ed9a5d8d081eb2daefa09f9d;hp=6b7730ae4a6531059bb873718513446e0428aafb;hpb=4ad4eba5b2edf00828f0eeb8db8fabc33da4f9d1;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 6b7730ae4a..82da5bb2ba 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -492,6 +492,7 @@ struct elf_reloc_cookie size_t locsymcount; size_t extsymoff; struct elf_link_hash_entry **sym_hashes; + int r_sym_shift; bfd_boolean bad_symtab; }; @@ -596,7 +597,7 @@ struct elf_backend_data /* A function to convert machine dependent section header flags to BFD internal section header flags. */ bfd_boolean (*elf_backend_section_flags) - (flagword *, Elf_Internal_Shdr *); + (flagword *, const Elf_Internal_Shdr *); /* A function to handle unusual program segment types when creating BFD sections from ELF program segments. */ @@ -625,7 +626,7 @@ struct elf_backend_data indices, and must set at least *FLAGS and *SEC for each processor dependent case; failure to do so will cause a link error. */ bfd_boolean (*elf_add_symbol_hook) - (bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *, + (bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *, const char **name, flagword *flags, asection **sec, bfd_vma *value); /* If this field is not NULL, it is called by the elf_link_output_sym @@ -901,6 +902,13 @@ struct elf_backend_data (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, int (*target_read_memory) (bfd_vma vma, char *myaddr, int len)); + /* This function is used by `_bfd_elf_get_synthetic_symtab'; + see elf.c. */ + bfd_vma (*plt_sym_val) (bfd_vma, const asection *, const arelent *); + + /* Name of the PLT relocation section. */ + const char *relplt_name; + /* Alternate EM_xxxx machine codes for this backend. */ int elf_machine_alt1; int elf_machine_alt2; @@ -1203,6 +1211,9 @@ struct elf_obj_tdata /* Segment flags for the PT_GNU_STACK segment. */ unsigned int stack_flags; + /* Should the PT_GNU_RELRO segment be emitted? */ + bfd_boolean relro; + /* Symbol version definitions in external objects. */ Elf_Internal_Verdef *verdef; @@ -1308,9 +1319,6 @@ extern void bfd_elf_print_symbol bfd_elf_string_from_elf_section (abfd, elf_elfheader(abfd)->e_shstrndx, \ strindex) -#define bfd_elf32_print_symbol bfd_elf_print_symbol -#define bfd_elf64_print_symbol bfd_elf_print_symbol - extern void _bfd_elf_sprintf_vma (bfd *, char *, bfd_vma); extern void _bfd_elf_fprintf_vma @@ -1363,12 +1371,16 @@ extern bfd_boolean _bfd_elf_slurp_version_tables (bfd *); extern bfd_boolean _bfd_elf_merge_sections (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_elf_is_group_section + (bfd *, const struct bfd_section *); extern bfd_boolean bfd_elf_discard_group (bfd *, struct bfd_section *); extern void bfd_elf_set_group_contents (bfd *, asection *, void *); extern void _bfd_elf_link_just_syms (asection *, struct bfd_link_info *); +extern bfd_boolean _bfd_elf_copy_private_header_data + (bfd *, bfd *); extern bfd_boolean _bfd_elf_copy_private_symbol_data (bfd *, asymbol *, bfd *, asymbol *); extern bfd_boolean _bfd_elf_copy_private_section_data @@ -1387,6 +1399,8 @@ extern long _bfd_elf_get_dynamic_symtab_upper_bound (bfd *); extern long _bfd_elf_canonicalize_dynamic_symtab (bfd *, asymbol **); +extern long _bfd_elf_get_synthetic_symtab + (bfd *, asymbol **, asymbol **); extern long _bfd_elf_get_reloc_upper_bound (bfd *, sec_ptr); extern long _bfd_elf_canonicalize_reloc @@ -1492,8 +1506,6 @@ extern bfd_boolean _bfd_elf_link_find_version_dependencies extern bfd_boolean _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *, void *); -extern bfd_boolean _bfd_elf_link_record_dynamic_symbol - (struct bfd_link_info *, struct elf_link_hash_entry *); extern long _bfd_elf_link_lookup_local_dynindx (struct bfd_link_info *, bfd *, long); extern bfd_boolean _bfd_elf_compute_section_file_positions @@ -1555,9 +1567,6 @@ extern int bfd_elf32_core_file_failing_signal extern bfd_boolean bfd_elf32_core_file_matches_executable_p (bfd *, bfd *); -extern bfd_boolean bfd_elf32_bfd_final_link - (bfd *, struct bfd_link_info *); - extern void bfd_elf32_swap_symbol_in (bfd *, const void *, const void *, Elf_Internal_Sym *); extern void bfd_elf32_swap_symbol_out @@ -1599,8 +1608,6 @@ extern int bfd_elf64_core_file_failing_signal (bfd *); extern bfd_boolean bfd_elf64_core_file_matches_executable_p (bfd *, bfd *); -extern bfd_boolean bfd_elf64_bfd_final_link - (bfd *, struct bfd_link_info *); extern void bfd_elf64_swap_symbol_in (bfd *, const void *, const void *, Elf_Internal_Sym *); @@ -1638,17 +1645,11 @@ extern bfd_boolean bfd_elf_link_add_symbols extern bfd_boolean _bfd_elf_add_dynamic_entry (struct bfd_link_info *, bfd_vma, bfd_vma); -#define bfd_elf32_link_record_dynamic_symbol \ - _bfd_elf_link_record_dynamic_symbol -#define bfd_elf64_link_record_dynamic_symbol \ - _bfd_elf_link_record_dynamic_symbol +extern bfd_boolean bfd_elf_link_record_dynamic_symbol + (struct bfd_link_info *, struct elf_link_hash_entry *); -extern int elf_link_record_local_dynamic_symbol +extern int bfd_elf_link_record_local_dynamic_symbol (struct bfd_link_info *, bfd *, long); -#define _bfd_elf32_link_record_local_dynamic_symbol \ - elf_link_record_local_dynamic_symbol -#define _bfd_elf64_link_record_local_dynamic_symbol \ - elf_link_record_local_dynamic_symbol extern bfd_boolean _bfd_elf_close_and_cleanup (bfd *); @@ -1656,31 +1657,25 @@ extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn (bfd *, arelent *, struct bfd_symbol *, void *, asection *, bfd *, char **); -extern bfd_boolean _bfd_elf32_gc_sections +extern bfd_boolean bfd_elf_final_link (bfd *, struct bfd_link_info *); -extern bfd_boolean _bfd_elf32_gc_common_finalize_got_offsets - (bfd *, struct bfd_link_info *); -extern bfd_boolean _bfd_elf32_gc_common_final_link + +extern bfd_boolean bfd_elf_gc_sections (bfd *, struct bfd_link_info *); -extern bfd_boolean _bfd_elf32_gc_record_vtinherit + +extern bfd_boolean bfd_elf_gc_record_vtinherit (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); -extern bfd_boolean _bfd_elf32_gc_record_vtentry + +extern bfd_boolean bfd_elf_gc_record_vtentry (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); -extern bfd_boolean _bfd_elf64_gc_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean _bfd_elf64_gc_common_finalize_got_offsets +extern bfd_boolean bfd_elf_gc_common_finalize_got_offsets (bfd *, struct bfd_link_info *); -extern bfd_boolean _bfd_elf64_gc_common_final_link + +extern bfd_boolean bfd_elf_gc_common_final_link (bfd *, struct bfd_link_info *); -extern bfd_boolean _bfd_elf64_gc_record_vtinherit - (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); -extern bfd_boolean _bfd_elf64_gc_record_vtentry - (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); -extern bfd_boolean _bfd_elf32_reloc_symbol_deleted_p - (bfd_vma, void *); -extern bfd_boolean _bfd_elf64_reloc_symbol_deleted_p +extern bfd_boolean bfd_elf_reloc_symbol_deleted_p (bfd_vma, void *); /* Exported interface for writing elf corefile notes. */ @@ -1711,6 +1706,16 @@ extern bfd *_bfd_elf64_bfd_from_remote_memory extern bfd_boolean _sh_elf_set_mach_from_flags (bfd *); +/* This is the condition under which finish_dynamic_symbol will be called. + If our finish_dynamic_symbol isn't called, we'll need to do something + about initializing any .plt and .got entries in relocate_section. */ +#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \ + ((DYN) \ + && ((SHARED) \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ + && ((H)->dynindx != -1 \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) + /* This macro is to avoid lots of duplicated code in the body of xxx_relocate_section() in the various elfxx-xxxx.c files. */ #define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel, \