public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/grte] Remove an unneeded local refactor in _dl_update_slotinfo
@ 2021-08-28  0:32 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28  0:32 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=396a77d48eb3652686bc29c28ec9cc632ad579e2

commit 396a77d48eb3652686bc29c28ec9cc632ad579e2
Author: Stan Shebs <stanshebs@google.com>
Date:   Wed Oct 30 13:32:13 2019 -0700

    Remove an unneeded local refactor in _dl_update_slotinfo

Diff:
---
 elf/dl-tls.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 47242097fc..67198f706b 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -720,26 +720,25 @@ _dl_update_slotinfo (unsigned long int req_modid)
 	      if (gen <= dtv[0].counter)
 		continue;
 
-	      size_t modid = total + cnt;
-
 	      /* If there is no map this means the entry is empty.  */
 	      struct link_map *map = listp->slotinfo[cnt].map;
 	      if (map == NULL)
 		{
-		  if (dtv[-1].counter >= modid)
+		  if (dtv[-1].counter >= total + cnt)
 		    {
 		      /* If this modid was used at some point the memory
 			 might still be allocated.  */
-		      __signal_safe_free (dtv[modid].pointer.to_free);
-		      dtv[modid].pointer.val = TLS_DTV_UNALLOCATED;
-		      dtv[modid].pointer.to_free = NULL;
+		      __signal_safe_free (dtv[total + cnt].pointer.to_free);
+		      dtv[total + cnt].pointer.val = TLS_DTV_UNALLOCATED;
+		      dtv[total + cnt].pointer.to_free = NULL;
 		    }
 
 		  continue;
 		}
 
-	      assert (modid == map->l_tls_modid);
 	      /* Check whether the current dtv array is large enough.  */
+	      size_t modid = map->l_tls_modid;
+	      assert (total + cnt == modid);
 	      if (dtv[-1].counter < modid)
 		{
 		  /* Resize the dtv.  */


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/maskray/grte] Remove an unneeded local refactor in _dl_update_slotinfo
@ 2021-08-28  0:28 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28  0:28 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7bc51bbf599f1101ee0f0202a3770abef0f80568

commit 7bc51bbf599f1101ee0f0202a3770abef0f80568
Author: Stan Shebs <stanshebs@google.com>
Date:   Wed Oct 30 13:32:13 2019 -0700

    Remove an unneeded local refactor in _dl_update_slotinfo

Diff:
---
 elf/dl-tls.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 47242097fc..67198f706b 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -720,26 +720,25 @@ _dl_update_slotinfo (unsigned long int req_modid)
 	      if (gen <= dtv[0].counter)
 		continue;
 
-	      size_t modid = total + cnt;
-
 	      /* If there is no map this means the entry is empty.  */
 	      struct link_map *map = listp->slotinfo[cnt].map;
 	      if (map == NULL)
 		{
-		  if (dtv[-1].counter >= modid)
+		  if (dtv[-1].counter >= total + cnt)
 		    {
 		      /* If this modid was used at some point the memory
 			 might still be allocated.  */
-		      __signal_safe_free (dtv[modid].pointer.to_free);
-		      dtv[modid].pointer.val = TLS_DTV_UNALLOCATED;
-		      dtv[modid].pointer.to_free = NULL;
+		      __signal_safe_free (dtv[total + cnt].pointer.to_free);
+		      dtv[total + cnt].pointer.val = TLS_DTV_UNALLOCATED;
+		      dtv[total + cnt].pointer.to_free = NULL;
 		    }
 
 		  continue;
 		}
 
-	      assert (modid == map->l_tls_modid);
 	      /* Check whether the current dtv array is large enough.  */
+	      size_t modid = map->l_tls_modid;
+	      assert (total + cnt == modid);
 	      if (dtv[-1].counter < modid)
 		{
 		  /* Resize the dtv.  */


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/maskray/grte] Remove an unneeded local refactor in _dl_update_slotinfo
@ 2021-08-27 23:45 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-27 23:45 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2aaf05314df96722ebde44e0c2cdb42e709a7122

commit 2aaf05314df96722ebde44e0c2cdb42e709a7122
Author: Stan Shebs <stanshebs@google.com>
Date:   Wed Oct 30 13:32:13 2019 -0700

    Remove an unneeded local refactor in _dl_update_slotinfo

Diff:
---
 elf/dl-tls.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 47242097fc..67198f706b 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -720,26 +720,25 @@ _dl_update_slotinfo (unsigned long int req_modid)
 	      if (gen <= dtv[0].counter)
 		continue;
 
-	      size_t modid = total + cnt;
-
 	      /* If there is no map this means the entry is empty.  */
 	      struct link_map *map = listp->slotinfo[cnt].map;
 	      if (map == NULL)
 		{
-		  if (dtv[-1].counter >= modid)
+		  if (dtv[-1].counter >= total + cnt)
 		    {
 		      /* If this modid was used at some point the memory
 			 might still be allocated.  */
-		      __signal_safe_free (dtv[modid].pointer.to_free);
-		      dtv[modid].pointer.val = TLS_DTV_UNALLOCATED;
-		      dtv[modid].pointer.to_free = NULL;
+		      __signal_safe_free (dtv[total + cnt].pointer.to_free);
+		      dtv[total + cnt].pointer.val = TLS_DTV_UNALLOCATED;
+		      dtv[total + cnt].pointer.to_free = NULL;
 		    }
 
 		  continue;
 		}
 
-	      assert (modid == map->l_tls_modid);
 	      /* Check whether the current dtv array is large enough.  */
+	      size_t modid = map->l_tls_modid;
+	      assert (total + cnt == modid);
 	      if (dtv[-1].counter < modid)
 		{
 		  /* Resize the dtv.  */


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-28  0:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  0:32 [glibc/maskray/grte] Remove an unneeded local refactor in _dl_update_slotinfo Fangrui Song
  -- strict thread matches above, loose matches on Subject: below --
2021-08-28  0:28 Fangrui Song
2021-08-27 23:45 Fangrui Song

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).