1999-01-21  Ulrich Drepper  <drepper@cygnus.com>

	* elf/dl-close.c: Rewrite the way adding to the global scope works
	to handle error cases better than the last change.
	The l_global flag is now only set when the object is actually
	counted in the global scope list.
	* elf/dl-deps.c: Likewise.
	* elf/dl-open.c: Likewise.
This commit is contained in:
Ulrich Drepper 1999-01-21 14:17:43 +00:00
parent 1d28e93cab
commit 50b65db1ee
5 changed files with 30 additions and 45 deletions

View File

@ -1,3 +1,12 @@
1999-01-21 Ulrich Drepper <drepper@cygnus.com>
* elf/dl-close.c: Rewrite the way adding to the global scope works
to handle error cases better than the last change.
The l_global flag is now only set when the object is actually
counted in the global scope list.
* elf/dl-deps.c: Likewise.
* elf/dl-open.c: Likewise.
1999-01-20 Philip Blundell <pb@nexus.co.uk>
* sysdeps/unix/sysv/linux/arm/sigaction.c: New file.

18
FAQ.in
View File

@ -849,16 +849,16 @@ Another problem is that older binaries that were linked statically against
glibc 2.0 will reference the older nss modules (libnss_files.so.1 instead of
libnss_files.so.2), so don't remove them. Also, the old glibc-2.0 compiled
static libraries (libfoo.a) which happen to depend on the older libio
behavior will be broken by the glibc 2.1 upgrade. The idea is to produce a
libcompat.a that people will be able to use to link in if they want to
compile a static library generated against glibc 2.0 into a program on a
glibc 2.1 system. You should just add -lcompat and you should be fine.
The glibc-compat add-on will provide the libnss_* files and other stuff so
that it is possible to use static library compiled against glibc 2.0 for
development on a glibc 2.1 based system. Please note that this is currently
just an experiment, although the nss modules part should work.
behavior will be broken by the glibc 2.1 upgrade. We plan to produce a
compatibility library that people will be able to link in if they want
to compile a static library generated against glibc 2.0 into a program
on a glibc 2.1 system. You just add -lcompat and you should be fine.
The glibc-compat add-on will provide the libcompat.a library, the older
nss modules, and a few other files. Together, they should make it
possible to do development with old static libraries on a glibc 2.1
system. This add-on is still in development. You can get it from <URL>
but please keep in mind that it is experimental.
? Source and binary incompatibilities, and what to do about them

View File

@ -106,36 +106,15 @@ _dl_close (struct link_map *map)
int cnt = _dl_main_searchlist->r_nlist;
do
if (--cnt < 0)
break;
--cnt;
while (_dl_main_searchlist->r_list[cnt] != imap);
if (cnt >= 0)
{
/* The object was already correctly registered. */
while (++cnt < _dl_main_searchlist->r_nlist)
_dl_main_searchlist->r_list[cnt - 1]
= _dl_main_searchlist->r_list[cnt];
/* The object was already correctly registered. */
while (++cnt < _dl_main_searchlist->r_nlist)
_dl_main_searchlist->r_list[cnt - 1]
= _dl_main_searchlist->r_list[cnt];
--_dl_main_searchlist->r_nlist;
}
else
{
/* This can happen if loading was interrupted by something
like a missing symbol in the newly loaded objects. In
this case the object is already marked as global but
`r_nlist' does not count it in. The pointer is in the
`r_list' array so we keep searching in the other
direction. */
cnt = _dl_main_searchlist->r_nlist;
while (_dl_main_searchlist->r_list[cnt] != imap)
{
++cnt;
/* Note that if _dl_global_scope_alloc is zero we
should never come here in the first place. */
assert (cnt < _dl_global_scope_alloc);
}
}
--_dl_main_searchlist->r_nlist;
}
/* We can unmap all the maps at once. We determined the

View File

@ -1,5 +1,5 @@
/* Load the dependencies of a mapped object.
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998, 1999 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
@ -93,6 +93,7 @@ _dl_map_object_deps (struct link_map *map,
struct list known[1 + npreloads + 1];
struct list *runp, *utail, *dtail;
unsigned int nlist, nduplist, i;
unsigned int to_add = 0;
inline void preload (struct link_map *map)
{
@ -416,7 +417,6 @@ _dl_map_object_deps (struct link_map *map,
if (global_scope)
{
unsigned int cnt;
unsigned int to_add = 0;
struct link_map **new_global;
/* Count the objects we have to put in the global scope. */
@ -479,16 +479,13 @@ _dl_map_object_deps (struct link_map *map,
for (cnt = 0; cnt < nlist; ++cnt)
if (map->l_searchlist.r_list[cnt]->l_global == 0)
{
map->l_searchlist.r_list[cnt]->l_global = 1;
_dl_main_searchlist->r_list[_dl_main_searchlist->r_nlist + to_add]
= map->l_searchlist.r_list[cnt];
++to_add;
}
/* XXX Do we have to add something to r_dupsearchlist??? --drepper */
return to_add;
}
return 0;
return to_add;
}

View File

@ -144,9 +144,9 @@ dl_open_worker (void *a)
(*(void (*) (int, char **, char **)) init) (__libc_argc, __libc_argv,
__environ);
if (new->l_global)
/* Now we can make the new map available in the global scope. */
_dl_main_searchlist->r_nlist += global_add;
/* Now we can make the new map available in the global scope. */
while (global_add-- > 0)
_dl_main_searchlist->r_list[_dl_main_searchlist->r_nlist++]->l_global = 1;
if (_dl_sysdep_start == NULL)
/* We must be the static _dl_open in libc.a. A static program that