public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@codesourcery.com>
To: Roland McGrath <roland@hack.frob.com>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
	GNU C Library	<libc-alpha@sourceware.org>,
	<libc-ports@sourceware.org>
Subject: Re: [PATCH 1/5][v2][BZ #15022] Avoid repeated calls to DL_STATIC_INIT
Date: Thu, 27 Jun 2013 10:52:00 -0000	[thread overview]
Message-ID: <alpine.DEB.1.10.1306261935380.16287@tp.orcam.me.uk> (raw)
In-Reply-To: <20130621181119.DACD52C09F@topped-with-meat.com>

On Fri, 21 Jun 2013, Roland McGrath wrote:

> I concur with your analysis.  (I was considering the relationship of the
> two locks when responding to HJ earlier, but failed to be clear about it.)
> I think it's wise to make the removal of the extraneous lock a separate
> follow-up change, just for paranoia's sake (i.e. ease of reversion if
> needed for some unforeseen reason).

 Thanks for confirming.  I have applied this change now, and the change 
below to remove the lock (no regressions in testing).

> The issue of the internal lock held while calling user initializers is
> entirely separate.  It has concerned me before when I've noticed it in
> passing, but I never dawdled long enough to bring it up for discussion.  I
> think you should file a bug about that one and we'll consider it separately
> later.  But that will clearly have to be after the impending freeze.

 BZ #15686 now.

2013-06-27  Maciej W. Rozycki  <macro@codesourcery.com>

	ports/ChangeLog.ia64
	* sysdeps/unix/sysv/linux/ia64/dl-static.c: Do not include
	<bits/libc-lock.h>.
	(_dl_static_lock): Remove variable.
	(_dl_static_init): Remove _dl_static_lock locking.

	ports/ChangeLog.mips
	* sysdeps/unix/sysv/linux/mips/dl-static.c: Do not include
	<bits/libc-lock.h>.
	(_dl_static_lock): Remove variable.
	(_dl_static_init): Remove _dl_static_lock locking.

  Maciej

glibc-static-dl-init-lock.diff
Index: glibc-fsf-trunk-quilt/ports/sysdeps/unix/sysv/linux/ia64/dl-static.c
===================================================================
--- glibc-fsf-trunk-quilt.orig/ports/sysdeps/unix/sysv/linux/ia64/dl-static.c	2013-06-18 01:05:31.000000000 +0100
+++ glibc-fsf-trunk-quilt/ports/sysdeps/unix/sysv/linux/ia64/dl-static.c	2013-06-21 19:54:31.852772816 +0100
@@ -35,9 +35,6 @@ _dl_var_init (void *array[])
 }
 
 #else
-#include <bits/libc-lock.h>
-
-__libc_lock_define_initialized_recursive (static, _dl_static_lock)
 
 static void *variables[] =
 {
@@ -52,8 +49,6 @@ _dl_static_init (struct link_map *map)
   lookup_t loadbase;
   void (*f) (void *[]);
 
-  __libc_lock_lock_recursive (_dl_static_lock);
-
   loadbase = _dl_lookup_symbol_x ("_dl_var_init", map, &ref,
 				  map->l_local_scope, NULL, 0, 1, NULL);
   if (ref != NULL)
@@ -61,8 +56,6 @@ _dl_static_init (struct link_map *map)
       f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
       f (variables);
     }
-
-  __libc_lock_unlock_recursive (_dl_static_lock);
 }
 
 #endif
Index: glibc-fsf-trunk-quilt/ports/sysdeps/unix/sysv/linux/mips/dl-static.c
===================================================================
--- glibc-fsf-trunk-quilt.orig/ports/sysdeps/unix/sysv/linux/mips/dl-static.c	2013-06-18 01:05:31.000000000 +0100
+++ glibc-fsf-trunk-quilt/ports/sysdeps/unix/sysv/linux/mips/dl-static.c	2013-06-21 19:54:51.852817334 +0100
@@ -33,9 +33,6 @@ _dl_var_init (void *array[])
 }
 
 #else
-#include <bits/libc-lock.h>
-
-__libc_lock_define_initialized_recursive (static, _dl_static_lock)
 
 static void *variables[] =
 {
@@ -64,8 +61,6 @@ _dl_static_init (struct link_map *l)
   void (*f) (void *[]);
   size_t i;
 
-  __libc_lock_lock_recursive (_dl_static_lock);
-
   loadbase = _dl_lookup_symbol_x ("_dl_var_init", l, &ref, l->l_local_scope,
 				  NULL, 0, 1, NULL);
 
@@ -84,8 +79,6 @@ _dl_static_init (struct link_map *l)
       f (variables);
       _dl_protect_relro (rtld_map);
     }
-
-  __libc_lock_unlock_recursive (_dl_static_lock);
 }
 
 #endif

      parent reply	other threads:[~2013-06-27 10:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-16 18:13 [PATCH] Correct global-scope dlopen issues in static executables Maciej W. Rozycki
2013-01-16 20:30 ` Joseph S. Myers
2013-01-16 22:50   ` [PATCH][BZ #15022] " Maciej W. Rozycki
     [not found] ` <20130116215545.7A37A2C0B0@topped-with-meat.com>
     [not found]   ` <alpine.DEB.1.10.1301240655220.4834@tp.orcam.me.uk>
     [not found]     ` <20130531200059.C94C02C077@topped-with-meat.com>
     [not found]       ` <alpine.DEB.1.10.1306140202520.16287@tp.orcam.me.uk>
     [not found]         ` <20130619233103.A913F2C0A6@topped-with-meat.com>
     [not found]           ` <CAMe9rOpR6OGW6CfrG5NN2HPM_=tW-1om4Y_dFVXmUk2h5xg6sQ@mail.gmail.com>
     [not found]             ` <20130620204740.69A5E2C135@topped-with-meat.com>
     [not found]               ` <alpine.DEB.1.10.1306211348160.16287@tp.orcam.me.uk>
     [not found]                 ` <20130621181119.DACD52C09F@topped-with-meat.com>
2013-06-27 10:52                   ` Maciej W. Rozycki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.1.10.1306261935380.16287@tp.orcam.me.uk \
    --to=macro@codesourcery.com \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=libc-ports@sourceware.org \
    --cc=roland@hack.frob.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).