diff options
author | Qing Zhao <qing.zhao@oracle.com> | 2017-04-10 12:46:30 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2017-04-10 12:46:30 +0100 |
commit | bb1dd176fb6f38ae3cc30dc61ce55a7fbf9d0d7b (patch) | |
tree | 5d40f7782e03bff6ab313eeeb07110fe7f8af01a /bfd/elfxx-sparc.h | |
parent | d236cfd444630bd9ddb63edca54c056d5825e673 (diff) | |
download | gdb-bb1dd176fb6f38ae3cc30dc61ce55a7fbf9d0d7b.zip gdb-bb1dd176fb6f38ae3cc30dc61ce55a7fbf9d0d7b.tar.gz gdb-bb1dd176fb6f38ae3cc30dc61ce55a7fbf9d0d7b.tar.bz2 |
Port the bug fix for PR 19704 (Missing dynamic relocation against undefined weak symbol) to the SPARC architecture.
* elf32-sparc.c (elf_backend_fixup_symbol): New.
* elf64-sparc.c (elf_backend_fixup_symbol): New.
* elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
(_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
has_non_got_reloc.
(link_hash_newfunc): Initialize has_got_reloc and
has_non_got_reloc.
(_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
section.
(_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
has_non_got_reloc.
(_bfd_sparc_elf_check_relocs): Set has_got_reloc and
has_non_got_reloc.
(_bfd_sparc_elf_fixup_symbol): New function.
(allocate_dynrelocs): Don't allocate space for dynamic
relocations and discard relocations against resolved undefined
weak symbols in executable. Don't make resolved undefined weak
symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
relocation against undefined weak symbols in PIE.
(_bfd_sparc_elf_relocate_section): Don't generate dynamic
relocations against resolved undefined weak symbols in PIE
(_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
without ynamic PLT/GOT relocations for resolved undefined weak
symbols.
Don't generate dynamic relocation against resolved undefined
weak symbol in executable.
(pie_finish_undefweak_symbol): New function.
(_bfd_sparc_elf_finish_dynamic_sections): Call
pie_finish_undefweak_symbol on all symbols in PIE.
* elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
(_bfd_sparc_elf_fixup_symbol): New function.
Diffstat (limited to 'bfd/elfxx-sparc.h')
-rw-r--r-- | bfd/elfxx-sparc.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elfxx-sparc.h b/bfd/elfxx-sparc.h index 15322df..bf8709b 100644 --- a/bfd/elfxx-sparc.h +++ b/bfd/elfxx-sparc.h @@ -46,6 +46,9 @@ struct _bfd_sparc_elf_link_hash_table { struct elf_link_hash_table elf; + /* Short-cut to get to dynamic linker sections. */ + asection *interp; + union { bfd_signed_vma refcount; @@ -136,6 +139,8 @@ extern bfd_boolean _bfd_sparc_elf_finish_dynamic_symbol Elf_Internal_Sym *sym); extern bfd_boolean _bfd_sparc_elf_finish_dynamic_sections (bfd *, struct bfd_link_info *); +extern bfd_boolean _bfd_sparc_elf_fixup_symbol + (struct bfd_link_info *, struct elf_link_hash_entry *); extern bfd_boolean _bfd_sparc_elf_object_p (bfd *); extern bfd_vma _bfd_sparc_elf_plt_sym_val |