]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
_dl_static_init: Remove nested locking.
authorMaciej W. Rozycki <macro@codesourcery.com>
Thu, 27 Jun 2013 10:15:51 +0000 (11:15 +0100)
committerMaciej W. Rozycki <macro@codesourcery.com>
Thu, 27 Jun 2013 10:49:44 +0000 (11:49 +0100)
This function is now called from dl_open_worker with the GL(dl_load_lock)
lock held and no longer needs local protection.  GL(dl_load_lock) also
correctly protects _dl_lookup_symbol_x called here that relies on the
caller to have serialized access to the data structures it uses.

ports/ChangeLog.ia64
ports/ChangeLog.mips
ports/sysdeps/unix/sysv/linux/ia64/dl-static.c
ports/sysdeps/unix/sysv/linux/mips/dl-static.c

index 78d6b586a3954d8ffb7261d9b0abae3b0616052f..0189858fff55453c1e9be35c0c7821dd2fbd75e6 100644 (file)
@@ -1,3 +1,10 @@
+2013-06-27  Maciej W. Rozycki  <macro@codesourcery.com>
+
+       * 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.
+
 2013-06-15  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
        * sysdeps/unix/sysv/linux/ia64/nptl/libpthread.abilist: Update.
index bdb9e5ce48bcb70798c750883e5d04e8d19ad660..00542f59e2fd3738d80ff8defd9dc9168189b48e 100644 (file)
@@ -1,3 +1,10 @@
+2013-06-27  Maciej W. Rozycki  <macro@codesourcery.com>
+
+       * 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.
+
 2013-06-15  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
        * sysdeps/unix/sysv/linux/mips/mips32/nptl/libpthread.abilist:
index de635db40e955e417e5af135ab4b7c9325050daf..9853253dcfbbaacc1aff3e5112e47a0f0a6aef7c 100644 (file)
@@ -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 e0501be3b6fd3a7fa8e80563368e26d29a050f2e..9290ed9ed3270f54c7d28ad93bdfb90279fc9e17 100644 (file)
@@ -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