core/glibc/glibc-2.13-nlist1failed.patch
2011-04-19 22:07:01 +02:00

29 lines
740 B
Diff

--- b/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -222,7 +222,8 @@
}
/* Sort the entries. */
- _dl_sort_fini (ns->_ns_loaded, maps, nloaded, used, nsid);
+ if (nloaded > 1)
+ _dl_sort_fini (ns->_ns_loaded, maps, nloaded, used, nsid);
/* Call all termination functions at once. */
#ifdef SHARED
--- b/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -619,11 +619,11 @@
/* We can skip looking for the binary itself which is at the front
of the search list. */
- assert (nlist > 1);
+ assert (nlist > 0);
i = 1;
bool seen[nlist];
memset (seen, false, nlist * sizeof (seen[0]));
- while (1)
+ while (nlist > 1)
{
/* Keep track of which object we looked at this round. */
seen[i] = true;