[binutils-gdb] Revert "ia64: Check UNDEFWEAK_NO_DYNAMIC_RELOC"

Alan Modra amodra@sourceware.org
Thu Feb 11 12:04:25 GMT 2021


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=769c253f4519145a1d7eaa85038d3e339f507987

commit 769c253f4519145a1d7eaa85038d3e339f507987
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Feb 11 22:23:45 2021 +1030

    Revert "ia64: Check UNDEFWEAK_NO_DYNAMIC_RELOC"
    
    This reverts commit db41f6eb5234ea3c74c1ce4798cf9923d4a45a98.

Diff:
---
 bfd/ChangeLog    |  5 +++++
 bfd/elfnn-ia64.c | 20 +++++---------------
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8fb42f9fd14..b0f1ce3ae48 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2021-02-11  Alan Modra  <amodra@gmail.com>
+
+	PR ld/22269
+	* elfnn-ia64.c: Revert 2017-10-14 git commit db41f6eb5234.
+
 2021-02-11  Alan Modra  <amodra@gmail.com>
 
 	PR 27294
diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
index 87a86e938f6..aaa69c4b2cd 100644
--- a/bfd/elfnn-ia64.c
+++ b/bfd/elfnn-ia64.c
@@ -2200,9 +2200,6 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
       else
 	h = NULL;
 
-      if (h && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
-	continue;
-
       /* We can only get preliminary data on whether a symbol is
 	 locally or externally defined, as not all of the input files
 	 have yet been processed.  Do something with what we know, as
@@ -2377,9 +2374,6 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
       else
 	h = NULL;
 
-      if (h && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
-	continue;
-
       /* We can only get preliminary data on whether a symbol is
 	 locally or externally defined, as not all of the input files
 	 have yet been processed.  Do something with what we know, as
@@ -2732,8 +2726,7 @@ allocate_fptr (struct elfNN_ia64_dyn_sym_info *dyn_i, void * data)
 
       if (!bfd_link_executable (x->info)
 	  && (!h
-	      || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
-		  && !UNDEFWEAK_NO_DYNAMIC_RELOC (x->info, h))
+	      || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
 	      || (h->root.type != bfd_link_hash_undefweak
 		  && h->root.type != bfd_link_hash_undefined)))
 	{
@@ -2862,8 +2855,8 @@ allocate_dynrel_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
 
   shared = bfd_link_pic (x->info);
   resolved_zero = (dyn_i->h
-		   && UNDEFWEAK_NO_DYNAMIC_RELOC (x->info,
-						       dyn_i->h));
+		   && ELF_ST_VISIBILITY (dyn_i->h->other)
+		   && dyn_i->h->root.type == bfd_link_hash_undefweak);
 
   /* Take care of the GOT and PLT relocations.  */
 
@@ -3307,8 +3300,7 @@ set_got_entry (bfd *abfd, struct bfd_link_info *info,
       /* Install a dynamic relocation if needed.  */
       if (((bfd_link_pic (info)
 	    && (!dyn_i->h
-		|| (ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
-		    && !UNDEFWEAK_NO_DYNAMIC_RELOC (info, dyn_i->h))
+		|| ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
 		|| dyn_i->h->root.type != bfd_link_hash_undefweak)
 	    && dyn_r_type != R_IA64_DTPREL32LSB
 	    && dyn_r_type != R_IA64_DTPREL64LSB)
@@ -3472,8 +3464,7 @@ set_pltoff_entry (bfd *abfd, struct bfd_link_info *info,
       if (!is_plt
 	  && bfd_link_pic (info)
 	  && (!dyn_i->h
-	      || (ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
-		  && !UNDEFWEAK_NO_DYNAMIC_RELOC (info, dyn_i->h))
+	      || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
 	      || dyn_i->h->root.type != bfd_link_hash_undefweak))
 	{
 	  unsigned int dyn_r_type;
@@ -3940,7 +3931,6 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
 	case R_IA64_DIR64LSB:
 	  /* Install a dynamic relocation for this reloc.  */
 	  if ((dynamic_symbol_p || bfd_link_pic (info))
-	      && !(h && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
 	      && r_symndx != STN_UNDEF
 	      && (input_section->flags & SEC_ALLOC) != 0)
 	    {


More information about the Binutils-cvs mailing list