Update.
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:
parent
3bbddbe4a3
commit
7e36861e77
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
2001-01-11 Ulrich Drepper <drepper@redhat.com>
|
2001-01-11 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* stdlib/Makefile (routines): Add cxa_on_exit.
|
* stdlib/Makefile (routines): Add cxa_on_exit.
|
||||||
|
@ -76,10 +76,6 @@ do_dlopen (void *ptr)
|
|||||||
struct do_dlopen_args *args = (struct do_dlopen_args *) ptr;
|
struct do_dlopen_args *args = (struct do_dlopen_args *) ptr;
|
||||||
/* Open and relocate the shared object. */
|
/* Open and relocate the shared object. */
|
||||||
args->map = _dl_open (args->name, RTLD_LAZY, NULL);
|
args->map = _dl_open (args->name, RTLD_LAZY, NULL);
|
||||||
|
|
||||||
#ifndef SHARED
|
|
||||||
DL_STATIC_INIT (args->map);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -430,6 +430,10 @@ _dl_open (const char *file, int mode, const void *caller)
|
|||||||
_dl_signal_error (errcode, objname, local_errstring);
|
_dl_signal_error (errcode, objname, local_errstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef SHARED
|
||||||
|
DL_STATIC_INIT (args.map);
|
||||||
|
#endif
|
||||||
|
|
||||||
return args.map;
|
return args.map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
2001-01-11 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* pthread.c (pthread_initialize): Use __cxs_on_exit not __cxa_atexit.
|
||||||
|
|
||||||
|
2001-01-11 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* Makefile (tests): Add ex15.
|
||||||
|
* Examples/ex15.c: New test.
|
||||||
|
|
||||||
2001-01-08 Ulrich Drepper <drepper@redhat.com>
|
2001-01-08 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* pthread.c (pthread_exit_process): Free memory allocated for
|
* pthread.c (pthread_exit_process): Free memory allocated for
|
||||||
|
@ -40,7 +40,7 @@ _dl_var_init (void *array[])
|
|||||||
#else
|
#else
|
||||||
#include <bits/libc-lock.h>
|
#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[] =
|
static void *variables[] =
|
||||||
{
|
{
|
||||||
@ -54,22 +54,16 @@ _dl_static_init (struct link_map *map)
|
|||||||
const ElfW(Sym) *ref;
|
const ElfW(Sym) *ref;
|
||||||
lookup_t loadbase;
|
lookup_t loadbase;
|
||||||
void (*f) (void *[]);
|
void (*f) (void *[]);
|
||||||
static int done = 0;
|
|
||||||
|
|
||||||
__libc_lock_lock (_dl_static_lock);
|
__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,
|
loadbase = _dl_lookup_symbol ("_dl_var_init", map, &ref,
|
||||||
map->l_local_scope, 0, 1);
|
map->l_local_scope, 0, 1);
|
||||||
f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
|
if (ref != NULL)
|
||||||
f (variables);
|
{
|
||||||
|
f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
|
||||||
|
f (variables);
|
||||||
|
}
|
||||||
|
|
||||||
__libc_lock_unlock (_dl_static_lock);
|
__libc_lock_unlock (_dl_static_lock);
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
/* We need special support to initialize DSO loaded for statically linked
|
/* We need special support to initialize DSO loaded for statically linked
|
||||||
binaries. */
|
binaries. */
|
||||||
extern void _dl_static_init (struct link_map *map);
|
extern void _dl_static_init (struct link_map *map);
|
||||||
|
#undef DL_STATIC_INIT
|
||||||
#define DL_STATIC_INIT(map) _dl_static_init (map)
|
#define DL_STATIC_INIT(map) _dl_static_init (map)
|
||||||
|
|
||||||
#endif /* ldsodefs.h */
|
#endif /* ldsodefs.h */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user