This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed, PATCH] x86: Don't check has_non_got_reloc
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils at sourceware dot org
- Date: Sat, 9 Sep 2017 07:22:40 -0700
- Subject: [committed, PATCH] x86: Don't check has_non_got_reloc
- Authentication-results: sourceware.org; auth=none
_bfd_x86_elf_link_symbol_references_local should depend only on symbol
references, not relocations, to work in check_relocs.
* elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
check has_non_got_reloc.
---
bfd/ChangeLog | 5 +++++
bfd/elfxx-x86.c | 5 ++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 9549e84e1f..b3eae2e82e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
+ * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
+ check has_non_got_reloc.
+
+2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
+
PR ld/22115
* elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index e056c3c5ff..20b07f0806 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -1701,15 +1701,14 @@ _bfd_x86_elf_link_symbol_references_local (struct bfd_link_info *info,
by linker version script. A weak undefined symbol is forced local
if
1. It has non-default visibility. Or
- 2. When building executable, it has non-GOT/non-PLT relocations
- in text section or there is no dynamic linker. Or
+ 2. When building executable, there is no dynamic linker. Or
3. or "-z nodynamic-undefined-weak" is used.
*/
if (SYMBOL_REFERENCES_LOCAL (info, h)
|| (h->root.type == bfd_link_hash_undefweak
&& (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| (bfd_link_executable (info)
- && (htab->interp == NULL || eh->has_non_got_reloc))
+ && htab->interp == NULL)
|| info->dynamic_undefined_weak == 0))
|| ((h->def_regular || ELF_COMMON_DEF_P (h))
&& h->versioned == unversioned
--
2.13.5