X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf-bfd.h;h=90cd4cae50165859844e38705e69426a75f1260b;hb=ccd2ec6a8718548c570e4dead571af5c6ba0e2e3;hp=603395166fffecf4de59f0dd5e3bbb817125401c;hpb=35330cce1aa1c88c8724038fdb8e2ab9b4e45186;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 603395166f..90cd4cae50 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -349,13 +349,15 @@ struct elf_link_hash_table /* The value to use when initialising got.refcount/offset and plt.refcount/offset in an elf_link_hash_entry. Set to zero when - the values are refcounts. Set to init_offset in - size_dynamic_sections when the values may be offsets. */ - union gotplt_union init_refcount; + the values are refcounts. Set to init_got_offset/init_plt_offset + in size_dynamic_sections when the values may be offsets. */ + union gotplt_union init_got_refcount; + union gotplt_union init_plt_refcount; /* The value to use for got.refcount/offset and plt.refcount/offset when the values may be offsets. Normally (bfd_vma) -1. */ - union gotplt_union init_offset; + union gotplt_union init_got_offset; + union gotplt_union init_plt_offset; /* The number of symbols found in the link which must be put into the .dynsym section. */ @@ -544,6 +546,12 @@ struct bfd_elf_special_section int attr; }; +enum action_discarded + { + COMPLAIN = 1, + PRETEND = 2 + }; + struct elf_backend_data { /* The architecture for this backend. */ @@ -631,11 +639,16 @@ struct elf_backend_data bfd_boolean (*elf_backend_section_from_shdr) (bfd *, Elf_Internal_Shdr *, const char *, int); - /* A function to convert machine dependent section header flags to + /* A function to convert machine dependent ELF section header flags to BFD internal section header flags. */ bfd_boolean (*elf_backend_section_flags) (flagword *, const Elf_Internal_Shdr *); + /* A function that returns a struct containing ELF section flags and + type for the given BFD section. */ + const struct bfd_elf_special_section * (*get_sec_type_attr) + (bfd *, asection *); + /* A function to handle unusual program segment types when creating BFD sections from ELF program segments. */ bfd_boolean (*elf_backend_section_from_phdr) @@ -873,7 +886,8 @@ struct elf_backend_data /* Emit relocations. Overrides default routine for emitting relocs, except during a relocatable link, or if all relocs are being emitted. */ bfd_boolean (*elf_backend_emit_relocs) - (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *); + (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *, + struct elf_link_hash_entry **); /* Count relocations. Not called for relocatable links or if all relocs are being preserved in the output. */ @@ -910,6 +924,11 @@ struct elf_backend_data bfd_boolean (*elf_backend_ignore_discarded_relocs) (asection *); + /* What to do when ld finds relocations against symbols defined in + discarded sections. */ + unsigned int (*action_discarded) + (asection *); + /* This function returns the width of FDE pointers in bytes, or 0 if that can't be determined for some reason. The default definition goes by the bfd's EI_CLASS. */ @@ -961,6 +980,30 @@ struct elf_backend_data see elf.c. */ bfd_vma (*plt_sym_val) (bfd_vma, const asection *, const arelent *); + /* Is symbol defined in common section? */ + bfd_boolean (*common_definition) (Elf_Internal_Sym *); + + /* Return a common section index for section. */ + unsigned int (*common_section_index) (asection *); + + /* Return a common section for section. */ + asection *(*common_section) (asection *); + + /* Return TRUE if we can merge 2 definitions. */ + bfd_boolean (*merge_symbol) (struct bfd_link_info *, + struct elf_link_hash_entry **, + struct elf_link_hash_entry *, + Elf_Internal_Sym *, asection **, + bfd_vma *, unsigned int *, + bfd_boolean *, bfd_boolean *, + bfd_boolean *, bfd_boolean *, + bfd_boolean *, bfd_boolean *, + bfd_boolean *, bfd_boolean *, + bfd *, asection **, + bfd_boolean *, bfd_boolean *, + bfd_boolean *, bfd_boolean *, + bfd *, asection **); + /* Used to handle bad SHF_LINK_ORDER input. */ bfd_error_handler_type link_order_error_handler; @@ -973,13 +1016,9 @@ struct elf_backend_data const struct elf_size_info *s; - /* An array of target specific special section map. */ + /* An array of target specific special sections. */ const struct bfd_elf_special_section *special_sections; - /* offset of the _GLOBAL_OFFSET_TABLE_ symbol from the start of the - .got section */ - bfd_vma got_symbol_offset; - /* The size in bytes of the header for the GOT. This includes the so-called reserved entries on some systems. */ bfd_vma got_header_size; @@ -1435,6 +1474,10 @@ extern bfd_boolean _bfd_elf_slurp_version_tables (bfd *, bfd_boolean); extern bfd_boolean _bfd_elf_merge_sections (bfd *, struct bfd_link_info *); +extern bfd_boolean _bfd_elf_match_sections_by_type + (bfd *, const asection *, bfd *, const asection *); +#define _bfd_generic_match_sections_by_type \ + _bfd_elf_match_sections_by_type extern bfd_boolean bfd_elf_is_group_section (bfd *, const struct bfd_section *); extern void _bfd_elf_section_already_linked @@ -1449,6 +1492,10 @@ extern bfd_boolean _bfd_elf_copy_private_header_data (bfd *, bfd *); extern bfd_boolean _bfd_elf_copy_private_symbol_data (bfd *, asymbol *, bfd *, asymbol *); +#define _bfd_generic_init_private_section_data \ + _bfd_elf_init_private_section_data +extern bfd_boolean _bfd_elf_init_private_section_data + (bfd *, asection *, bfd *, asection *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_copy_private_section_data (bfd *, asection *, bfd *, asection *); extern bfd_boolean _bfd_elf_write_object_contents @@ -1488,6 +1535,11 @@ extern bfd_boolean _bfd_elf_set_arch_mach extern bfd_boolean _bfd_elf_find_nearest_line (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *); +extern bfd_boolean _bfd_elf_find_line + (bfd *, asymbol **, asymbol *, const char **, unsigned int *); +#define _bfd_generic_find_line _bfd_elf_find_line +extern bfd_boolean _bfd_elf_find_inliner_info + (bfd *, const char **, const char **, unsigned int *); #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol extern int _bfd_elf_sizeof_headers @@ -1496,8 +1548,10 @@ extern bfd_boolean _bfd_elf_new_section_hook (bfd *, asection *); extern bfd_boolean _bfd_elf_init_reloc_shdr (bfd *, Elf_Internal_Shdr *, asection *, bfd_boolean); +extern const struct bfd_elf_special_section *_bfd_elf_get_special_section + (const char *, const struct bfd_elf_special_section *, unsigned int); extern const struct bfd_elf_special_section *_bfd_elf_get_sec_type_attr - (bfd *, const char *); + (bfd *, asection *); /* If the target doesn't have reloc handling written yet: */ extern void _bfd_elf_no_info_to_howto @@ -1593,6 +1647,8 @@ extern bfd_boolean _bfd_elf_create_dynamic_sections (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_create_got_section (bfd *, struct bfd_link_info *); +extern struct elf_link_hash_entry *_bfd_elf_define_linkage_sym + (bfd *, struct bfd_link_info *, asection *, const char *); extern bfd_boolean _bfd_elfcore_make_pseudosection (bfd *, char *, size_t, ufile_ptr); @@ -1606,7 +1662,8 @@ extern bfd_boolean _bfd_elf_link_size_reloc_section (bfd *, Elf_Internal_Shdr *, asection *); extern bfd_boolean _bfd_elf_link_output_relocs - (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *); + (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *, + struct elf_link_hash_entry **); extern bfd_boolean _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *, struct elf_info_failed *); @@ -1626,7 +1683,7 @@ extern bfd_boolean _bfd_elf_symbol_refs_local_p extern bfd_boolean bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2); -extern bfd_boolean _bfd_elf_setup_group_pointers +extern bfd_boolean _bfd_elf_setup_sections (bfd *); extern const bfd_target *bfd_elf32_object_p @@ -1729,6 +1786,15 @@ extern int bfd_elf_link_record_local_dynamic_symbol extern bfd_boolean _bfd_elf_close_and_cleanup (bfd *); +extern bfd_boolean _bfd_elf_common_definition + (Elf_Internal_Sym *); + +extern unsigned int _bfd_elf_common_section_index + (asection *); + +extern asection *_bfd_elf_common_section + (asection *); + extern void _bfd_dwarf2_cleanup_debug_info (bfd *); @@ -1789,6 +1855,9 @@ extern bfd *_bfd_elf64_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, int (*target_read_memory) (bfd_vma, bfd_byte *, int)); +/* Large common section. */ +extern asection _bfd_elf_large_com_section; + /* SH ELF specific routine. */ extern bfd_boolean _sh_elf_set_mach_from_flags