summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/ia64/dl-static.c18
-rw-r--r--sysdeps/unix/sysv/linux/ia64/ldsodefs.h1
2 files changed, 7 insertions, 12 deletions
diff --git a/sysdeps/unix/sysv/linux/ia64/dl-static.c b/sysdeps/unix/sysv/linux/ia64/dl-static.c
index 7d6eab8a7b..19cb97d675 100644
--- a/sysdeps/unix/sysv/linux/ia64/dl-static.c
+++ b/sysdeps/unix/sysv/linux/ia64/dl-static.c
@@ -40,7 +40,7 @@ _dl_var_init (void *array[])
 #else
 #include <bits/libc-lock.h>
 
-__libc_lock_define_initialized_recursive (, _dl_static_lock)
+__libc_lock_define_initialized_recursive (static, _dl_static_lock)
 
 static void *variables[] =
 {
@@ -54,22 +54,16 @@ _dl_static_init (struct link_map *map)
   const ElfW(Sym) *ref;
   lookup_t loadbase;
   void (*f) (void *[]);
-  static int done = 0;
 
   __libc_lock_lock (_dl_static_lock);
 
-  if (done)
-    {
-      __libc_lock_unlock (_dl_static_lock);
-      return;
-    }
-
-  done = 1;
-
   loadbase = _dl_lookup_symbol ("_dl_var_init", map, &ref,
 				map->l_local_scope, 0, 1);
-  f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
-  f (variables);
+  if (ref != NULL)
+    {
+      f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
+      f (variables);
+    }
 
   __libc_lock_unlock (_dl_static_lock);
 }
diff --git a/sysdeps/unix/sysv/linux/ia64/ldsodefs.h b/sysdeps/unix/sysv/linux/ia64/ldsodefs.h
index 2c74a07619..34fb9e886c 100644
--- a/sysdeps/unix/sysv/linux/ia64/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/ia64/ldsodefs.h
@@ -27,6 +27,7 @@
 /* We need special support to initialize DSO loaded for statically linked
    binaries.  */
 extern void _dl_static_init (struct link_map *map);
+#undef DL_STATIC_INIT
 #define DL_STATIC_INIT(map) _dl_static_init (map)
 
 #endif /* ldsodefs.h */