diff options
author | Richard Henderson <rth@redhat.com> | 1999-07-13 18:21:29 +0000 |
---|---|---|
committer | Richard Henderson <rth@redhat.com> | 1999-07-13 18:21:29 +0000 |
commit | 30b30c21815a6f23b0db7b135926f988ddff22a3 (patch) | |
tree | 3a29e627f94610eba3a177b83acd0ed54f8913d7 /bfd/elf-bfd.h | |
parent | e1ee1229a2384e923b73ef5943141fa39d51fdff (diff) | |
download | gdb-30b30c21815a6f23b0db7b135926f988ddff22a3.zip gdb-30b30c21815a6f23b0db7b135926f988ddff22a3.tar.gz gdb-30b30c21815a6f23b0db7b135926f988ddff22a3.tar.bz2 |
* elf-bfd.h (struct elf_link_local_dynamic_entry): New.
(struct elf_link_hash_table): Add dynlocal.
(_bfd_elf_link_lookup_local_dynindx): Prototype.
(_bfd_elf_link_adjust_dynindx): Delete.
(_bfd_elf_link_renumber_dynsyms): Prototype.
(_bfd_elf,link_record_local_dynamic_symbol): Prototype.
* elfcode.h (elf_link_record_local_dynamic_symbol): New alias.
* elflink.c (_bfd_elf_link_adjust_dynindx): Delete.
(_bfd_elf_link_lookup_local_dynindx): New function.
(elf_link_renumber_hash_table_dynsyms): New function.
(_bfd_elf_link_renumber_dynsyms): New function.
* elflink.h (elf_link_record_local_dynamic_symbol): New function.
(struct elf_assign_sym_version_info): Delete removed_dynamic.
(bfd_elf,size_dynamic_sections): Use _bfd_strip_section_from_output
instead of elf_link_remove_section_and_adjust_dynindices.
Remove removed_dynamic code. Use _bfd_elf_link_renumber_dynsyms.
(elf_link_assign_sym_version): Remove removed_dynamic code.
(elf_link_renumber_dynsyms): Delete.
(elf_bfd_final_link): Install section and local symbols into .dynsym.
* elf32-m68k.c (elf_m68k_adjust_dynindx): Delete.
(elf_m68k_size_dynamic_sections): Don't set section dynindicies.
(elf_m68k_finish_dynamic_sections): Don't write section dynsyms.
* elf32-mips.c: Similarly.
* elf32-ppc.c: Similarly.
* elf32-sparc.c: Similarly.
* elf64-alpha.c: Similarly.
* elf64-sparc.c: Similarly.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index be6185b..6c20b06 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -86,6 +86,16 @@ struct elf_link_hash_entry /* Symbol index as a dynamic symbol. Initialized to -1, and remains -1 if this is not a dynamic symbol. */ + /* ??? Note that this is consistently used as a synonym for tests + against whether we can perform various simplifying transformations + to the code. (E.g. changing a pc-relative jump to a PLT entry + into a pc-relative jump to the target function.) That test, which + is often relatively complex, and someplaces wrong or incomplete, + should really be replaced by a predicate in elflink.c. + + End result: this field -1 does not indicate that the symbol is + not in the dynamic symbol table, but rather that the symbol is + not visible outside this DSO. */ long dynindx; /* String table index in .dynstr if this is a dynamic symbol. */ @@ -181,6 +191,25 @@ struct elf_link_hash_entry #define ELF_LINK_HASH_MARK 04000 }; +/* Records local symbols to be emitted in the dynamic symbol table. */ + +struct elf_link_local_dynamic_entry +{ + struct elf_link_local_dynamic_entry *next; + + /* The input bfd this symbol came from. */ + bfd *input_bfd; + + /* The index of the local symbol being copied. */ + long input_indx; + + /* The index in the outgoing dynamic symbol table. */ + long dynindx; + + /* A copy of the input symbol. */ + Elf_Internal_Sym isym; +}; + /* ELF linker hash table. */ struct elf_link_hash_table @@ -209,6 +238,8 @@ struct elf_link_hash_table struct elf_link_hash_entry *hgot; /* A pointer to information used to link stabs in sections. */ PTR stab_info; + /* A linked list of local symbols to be added to .dynsym. */ + struct elf_link_local_dynamic_entry *dynlocal; }; /* Look up an entry in an ELF linker hash table. */ @@ -956,6 +987,9 @@ struct bfd_strtab_hash *_bfd_elf_stringtab_init PARAMS ((void)); boolean _bfd_elf_link_record_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +long +_bfd_elf_link_lookup_local_dynindx PARAMS ((struct bfd_link_info *, + bfd *, long)); boolean _bfd_elf_compute_section_file_positions PARAMS ((bfd *, struct bfd_link_info *)); @@ -970,8 +1004,8 @@ boolean _bfd_elf_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); boolean _bfd_elf_create_got_section PARAMS ((bfd *, struct bfd_link_info *)); -boolean _bfd_elf_link_adjust_dynindx PARAMS ((struct elf_link_hash_entry *, - PTR)); +unsigned long _bfd_elf_link_renumber_dynsyms PARAMS ((bfd *, + struct bfd_link_info *)); elf_linker_section_t *_bfd_elf_create_linker_section PARAMS ((bfd *abfd, @@ -1113,8 +1147,15 @@ extern boolean bfd_elf64_link_create_dynamic_sections extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, boolean)); -#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 +#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 + +boolean _bfd_elf32_link_record_local_dynamic_symbol + PARAMS ((struct bfd_link_info *, bfd *, long)); +boolean _bfd_elf64_link_record_local_dynamic_symbol + PARAMS ((struct bfd_link_info *, bfd *, long)); extern boolean _bfd_elf_close_and_cleanup PARAMS ((bfd *)); extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn |