1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
2001-01-11  H.J. Lu  <hjl@gnu.org>

	* elf/dl-libc.c (do_dlopen): Move DL_STATIC_INIT to ...
	* elf/dl-open.c (_dl_open): Here.
	* sysdeps/unix/sysv/linux/ia64/dl-static.c (_dl_static_lock):
	Make it static.
	(_dl_static_init): Initialize the variables every time when possible.
	* sysdeps/unix/sysv/linux/ia64/ldsodefs.h (DL_STATIC_INIT):
	Undefine it first.
This commit is contained in:
Ulrich Drepper
2001-01-11 19:42:21 +00:00
parent 3bbddbe4a3
commit 7e36861e77
6 changed files with 30 additions and 16 deletions

View File

@ -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);
}