1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00
2004-09-23  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/generic/bits/dlfcn.h: Add RTLD_DEEPBIND.
	* elf/dl-object.c (_dl_new_object): Add new parameter mode.  If mode
	has RTLD_DEEPBIND set add local searchlist before global scope.
	* sysdeps/generic/ldsodefs.h (_dl_new_object): Adjust prototype.
	* elf/rtld.c: Adjust callers of _dl_new_object.
	* elf/dl-load.c: Likewise.
	(_dl_map_object_from_fd): If RTLD_DEEPBIND is used, don't do anything
	for DF_SYMBOLIC.
	* elf/dl-open.c (dl_open_writer): Pass RTLD_DEEPBIND flag on to
	_dl_map_object_deps.
	* elf/tst-deep1.c: New file.
	* elf/tst-deep1mod1.c: New file.
	* elf/tst-deep1mod2.c: New file.
	* elf/tst-deep1mod3.c: New file.
	* elf/Makefile: Add rules to build and run new tests.

	* elf/dl-deps.c: Pretty printing.
This commit is contained in:
Ulrich Drepper
2004-09-23 07:45:38 +00:00
parent bbb5e55c10
commit 1fc074913b
14 changed files with 142 additions and 20 deletions

View File

@@ -881,7 +881,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
#endif
/* Enter the new object in the list of loaded objects. */
l = _dl_new_object (realname, name, l_type, loader);
l = _dl_new_object (realname, name, l_type, loader, mode);
if (__builtin_expect (! l, 0))
{
errstring = N_("cannot create shared object descriptor");
@@ -1355,15 +1355,12 @@ cannot enable executable stack as shared object requires");
/* If this object has DT_SYMBOLIC set modify now its scope. We don't
have to do this for the main map. */
if (__builtin_expect (l->l_info[DT_SYMBOLIC] != NULL, 0)
if ((mode & RTLD_DEEPBIND) == 0
&& __builtin_expect (l->l_info[DT_SYMBOLIC] != NULL, 0)
&& &l->l_searchlist != l->l_scope[0])
{
/* Create an appropriate searchlist. It contains only this map.
XXX This is the definition of DT_SYMBOLIC in SysVr4. The old
GNU ld.so implementation had a different interpretation which
is more reasonable. We are prepared to add this possibility
back as part of a GNU extension of the ELF format. */
This is the definition of DT_SYMBOLIC in SysVr4. */
l->l_symbolic_searchlist.r_list =
(struct link_map **) malloc (sizeof (struct link_map *));
@@ -1968,7 +1965,8 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
/* Enter the new object in the list of loaded objects. */
if ((name_copy = local_strdup (name)) == NULL
|| (l = _dl_new_object (name_copy, name, type, loader)) == NULL)
|| (l = _dl_new_object (name_copy, name, type, loader,
mode)) == NULL)
_dl_signal_error (ENOMEM, name, NULL,
N_("cannot create shared object descriptor"));
/* Signal that this is a faked entry. */