public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PowerPC64 DT_RELR local GOT
@ 2022-01-19  6:29 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-01-19  6:29 UTC (permalink / raw)
  To: binutils

Fixes another case where we end up with superfluous R_PPC64_NONE.

	* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
	space for GOT relocs against non-TLS local syms when enable_dt_relr.
	(ppc64_elf_layout_multitoc): Likewise.

diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index aeae3b7e640..0ac96afe5a3 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -10318,8 +10318,9 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd,
 			htab->got_reli_size += rel_size;
 		      }
 		    else if (bfd_link_pic (info)
-			     && !(ent->tls_type != 0
-				  && bfd_link_executable (info)))
+			     && (ent->tls_type == 0
+				 ? !info->enable_dt_relr
+				 : !bfd_link_executable (info)))
 		      {
 			asection *srel = ppc64_elf_tdata (ibfd)->relgot;
 			srel->size += rel_size;
@@ -12815,8 +12816,9 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info)
 		  htab->got_reli_size += rel_size;
 		}
 	      else if (bfd_link_pic (info)
-		       && !(ent->tls_type != 0
-			    && bfd_link_executable (info)))
+		       && (ent->tls_type == 0
+			   ? !info->enable_dt_relr
+			   : !bfd_link_executable (info)))
 		{
 		  asection *srel = ppc64_elf_tdata (ibfd)->relgot;
 		  srel->size += rel_size;

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-19  6:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19  6:29 PowerPC64 DT_RELR local GOT Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).