1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
2005-01-09  Ulrich Drepper  <drepper@redhat.com>

	* elf/dl-debug.c (_dl_debug_initialize): Take extra parameter and
	use it to select the r_debug structure for that namespace.
	* elf/dl-close.c (_dl_close): Adjust call to _dl_debug_initialize.
	* elf/dl-load.c (_dl_map_object_from_fd): Likewise.
	* elf/dl-open.c (_dl_open): Likewise.
	* elf/rtld.c (dl_main): Likewise.
	* sysdeps/generic/ldsodefs.h (struct link_namespaces): Add _ns_debug
	member.
	(_dl_debug_initialize): Add new parameter in declaration.

	* elf/dl-close.c (_dl_close): Make sure auditing callbacks are not
	called for the auditing objects themselves.
	* elf/dl-load.c (_dl_map_object_from_fd): Likewise.
This commit is contained in:
Ulrich Drepper
2005-01-09 08:29:25 +00:00
parent 4e2d549137
commit 29f976542b
7 changed files with 58 additions and 30 deletions

View File

@ -1,5 +1,5 @@
/* Load a shared object at runtime, relocate it, and run its initializer.
Copyright (C) 1996-2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 1996-2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -174,8 +174,6 @@ dl_open_worker (void *a)
#endif
struct link_map *call_map = NULL;
assert (_dl_debug_initialize (0)->r_state == RT_CONSISTENT);
/* Check whether _dl_open() has been called from a valid DSO. */
if (__check_caller (args->caller_dl_open,
allow_libc|allow_libdl|allow_ldso) != 0)
@ -220,6 +218,8 @@ dl_open_worker (void *a)
}
}
assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT);
/* Maybe we have to expand a DST. */
if (__builtin_expect (dst != NULL, 0))
{
@ -298,7 +298,7 @@ dl_open_worker (void *a)
/* Increment just the reference counter of the object. */
++new->l_opencount;
assert (_dl_debug_initialize (0)->r_state == RT_CONSISTENT);
assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT);
return;
}
@ -338,7 +338,7 @@ dl_open_worker (void *a)
#endif
/* Notify the debugger all new objects are now ready to go. */
struct r_debug *r = _dl_debug_initialize (0);
struct r_debug *r = _dl_debug_initialize (0, args->nsid);
r->r_state = RT_CONSISTENT;
_dl_debug_state ();
@ -525,8 +525,6 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
/* Make sure we are alone. */
__rtld_lock_lock_recursive (GL(dl_load_lock));
assert (_dl_debug_initialize (0)->r_state == RT_CONSISTENT);
if (nsid == LM_ID_NEWLM)
{
/* Find a new namespace. */
@ -542,6 +540,8 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
_dl_signal_error (EINVAL, file, NULL, N_("\
no more namespaces available for dlmopen()"));
}
_dl_debug_initialize (0, nsid)->r_state = RT_CONSISTENT;
}
/* Never allow loading a DSO in a namespace which is empty. Such
direct placements is only causing problems. Also don't allow
@ -621,13 +621,13 @@ no more namespaces available for dlmopen()"));
if (errstring != INTUSE(_dl_out_of_memory))
free ((char *) errstring);
assert (_dl_debug_initialize (0)->r_state == RT_CONSISTENT);
assert (_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT);
/* Reraise the error. */
_dl_signal_error (errcode, objname, NULL, local_errstring);
}
assert (_dl_debug_initialize (0)->r_state == RT_CONSISTENT);
assert (_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT);
#ifndef SHARED
DL_STATIC_INIT (args.map);