X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf-bfd.h;h=3184e573224060a45b04d39bca6b16275dce6dd5;hb=1fe0971e41a4097610862acabf54a896695fe834;hp=f5a1f4535549fddc61843e443ef674d09bf1a247;hpb=0e1862bb401f47716446aef143b2bf7a4563f541;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index f5a1f45355..3184e57322 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1,5 +1,5 @@ /* BFD back-end data structures for ELF files. - Copyright (C) 1992-2015 Free Software Foundation, Inc. + Copyright (C) 1992-2016 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -124,7 +124,8 @@ struct elf_link_hash_entry struct bfd_link_hash_entry root; /* Symbol index in output file. This is initialized to -1. It is - set to -2 if the symbol is used by a reloc. */ + set to -2 if the symbol is used by a reloc. It is set to -3 if + this symbol is defined in a discarded section. */ long indx; /* Symbol index as a dynamic symbol. Initialized to -1, and remains @@ -520,8 +521,8 @@ struct elf_link_hash_table 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. */ + /* The number of symbols found in the link which is intended for the + mandatory DT_SYMTAB tag (.dynsym section) in .dynamic section. */ bfd_size_type dynsymcount; /* The string table of dynamic symbols, which becomes the .dynstr @@ -595,6 +596,7 @@ struct elf_link_hash_table asection *iplt; asection *irelplt; asection *irelifunc; + asection *dynsym; }; /* Look up an entry in an ELF linker hash table. */ @@ -701,9 +703,9 @@ struct elf_size_info { enum elf_reloc_type_class { reloc_class_normal, reloc_class_relative, - reloc_class_plt, reloc_class_copy, - reloc_class_ifunc + reloc_class_ifunc, + reloc_class_plt }; struct elf_reloc_cookie @@ -730,15 +732,15 @@ typedef enum { struct bfd_elf_special_section { const char *prefix; - int prefix_length; + unsigned int prefix_length; /* 0 means name must match PREFIX exactly. -1 means name must start with PREFIX followed by an arbitrary string. -2 means name must match PREFIX exactly or consist of PREFIX followed by a dot then anything. > 0 means name must start with the first PREFIX_LENGTH chars of PREFIX and finish with the last SUFFIX_LENGTH chars of PREFIX. */ - int suffix_length; - int type; + signed int suffix_length; + unsigned int type; bfd_vma attr; }; @@ -1169,6 +1171,11 @@ struct elf_backend_data unsigned int (*elf_backend_count_relocs) (struct bfd_link_info *, asection *); + /* Count additionals relocations. Called for relocatable links if + additional relocations needs to be created. */ + unsigned int (*elf_backend_count_additional_relocs) + (asection *); + /* Say whether to sort relocs output by ld -r and ld --emit-relocs, by r_offset. If NULL, default to true. */ bfd_boolean (*sort_relocs_p) @@ -1294,6 +1301,16 @@ struct elf_backend_data /* Return the section which RELOC_SEC applies to. */ asection *(*get_reloc_section) (asection *reloc_sec); + /* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which + has a type >= SHT_LOOS. Returns TRUE if the fields were initialised, + FALSE otherwise. Can be called multiple times for a given section, + until it returns TRUE. Most of the times it is called ISECTION will be + set to an input section that might be associated with the output section. + The last time that it is called, ISECTION will be set to NULL. */ + bfd_boolean (*elf_backend_copy_special_section_fields) + (const bfd *ibfd, bfd *obfd, const Elf_Internal_Shdr *isection, + Elf_Internal_Shdr *osection); + /* Used to handle bad SHF_LINK_ORDER input. */ bfd_error_handler_type link_order_error_handler; @@ -1355,6 +1372,9 @@ struct elf_backend_data /* Alignment for the PT_GNU_STACK segment. */ unsigned stack_align; + /* Flag bits to assign to a section of type SHT_STRTAB. */ + unsigned long elf_strtab_flags; + /* This is TRUE if the linker should act like collect and gather global constructors and destructors by name. This is TRUE for MIPS ELF because the Irix 5 tools can not handle the .init @@ -1653,6 +1673,14 @@ enum elf_gnu_symbols elf_gnu_symbol_all = (elf_gnu_symbol_ifunc | elf_gnu_symbol_unique) }; +typedef struct elf_section_list +{ + Elf_Internal_Shdr hdr; + unsigned int ndx; + struct elf_section_list * next; +} elf_section_list; + + /* Some private data is stashed away for future use using the tdata pointer in the bfd structure. */ @@ -1669,7 +1697,7 @@ struct elf_obj_tdata Elf_Internal_Shdr dynversym_hdr; Elf_Internal_Shdr dynverref_hdr; Elf_Internal_Shdr dynverdef_hdr; - Elf_Internal_Shdr symtab_shndx_hdr; + elf_section_list * symtab_shndx_list; bfd_vma gp; /* The gp value */ unsigned int gp_size; /* The gp size */ unsigned int num_elf_sections; /* elf_sect_ptr size */ @@ -1744,7 +1772,7 @@ struct elf_obj_tdata Elf_Internal_Shdr **group_sect_ptr; int num_group; - unsigned int symtab_section, symtab_shndx_section, dynsymtab_section; + unsigned int symtab_section, dynsymtab_section; unsigned int dynversym_section, dynverdef_section, dynverref_section; /* An identifier used to distinguish different target @@ -1786,7 +1814,7 @@ struct elf_obj_tdata #define elf_stack_flags(bfd) (elf_tdata(bfd) -> o->stack_flags) #define elf_shstrtab(bfd) (elf_tdata(bfd) -> o->strtab_ptr) #define elf_onesymtab(bfd) (elf_tdata(bfd) -> symtab_section) -#define elf_symtab_shndx(bfd) (elf_tdata(bfd) -> symtab_shndx_section) +#define elf_symtab_shndx_list(bfd) (elf_tdata(bfd) -> symtab_shndx_list) #define elf_strtab_sec(bfd) (elf_tdata(bfd) -> o->strtab_section) #define elf_shstrtab_sec(bfd) (elf_tdata(bfd) -> o->shstrtab_section) #define elf_symtab_hdr(bfd) (elf_tdata(bfd) -> symtab_hdr) @@ -1987,7 +2015,7 @@ extern bfd_boolean _bfd_elf_find_line (bfd *, asymbol **, asymbol *, const char **, unsigned int *); extern bfd_boolean _bfd_elf_find_inliner_info (bfd *, const char **, const char **, unsigned int *); -extern bfd_boolean _bfd_elf_find_function +extern asymbol *_bfd_elf_find_function (bfd *, asymbol **, asection *, bfd_vma, const char **, const char **); #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol @@ -2236,6 +2264,8 @@ extern bfd_boolean bfd_elf_link_add_symbols (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_add_dynamic_entry (struct bfd_link_info *, bfd_vma, bfd_vma); +extern bfd_boolean _bfd_elf_link_check_relocs + (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *, struct elf_link_hash_entry *); @@ -2287,7 +2317,7 @@ extern asection *_bfd_elf_gc_mark_hook extern asection *_bfd_elf_gc_mark_rsec (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn, - struct elf_reloc_cookie *); + struct elf_reloc_cookie *, bfd_boolean *); extern bfd_boolean _bfd_elf_gc_mark_reloc (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn, @@ -2309,6 +2339,9 @@ extern bfd_boolean bfd_elf_gc_common_finalize_got_offsets extern bfd_boolean bfd_elf_gc_common_final_link (bfd *, struct bfd_link_info *); +extern asection *_bfd_elf_is_start_stop + (const struct bfd_link_info *, struct elf_link_hash_entry *); + extern bfd_boolean bfd_elf_reloc_symbol_deleted_p (bfd_vma, void *); @@ -2476,7 +2509,8 @@ extern bfd_boolean _bfd_elf_create_ifunc_sections (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *, struct elf_link_hash_entry *, - struct elf_dyn_relocs **, unsigned int, unsigned int, unsigned int); + struct elf_dyn_relocs **, bfd_boolean *, unsigned int, + unsigned int, unsigned int); extern long _bfd_elf_ifunc_get_synthetic_symtab (bfd *, long, asymbol **, long, asymbol **, asymbol **, asection *, bfd_vma *(*) (bfd *, asymbol **, asection *, asection *)); @@ -2560,12 +2594,11 @@ extern asection _bfd_elf_large_com_section; bfd_boolean err; \ err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR \ || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT); \ - if (!info->callbacks->undefined_symbol (info, \ - h->root.root.string, \ - input_bfd, \ - input_section, \ - rel->r_offset, err)) \ - return FALSE; \ + (*info->callbacks->undefined_symbol) (info, \ + h->root.root.string, \ + input_bfd, \ + input_section, \ + rel->r_offset, err); \ warned = TRUE; \ } \ (void) unresolved_reloc; \