diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-05-30 12:31:25 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-05-30 12:31:25 -0400 |
commit | 6b1e7d1992cd89032df431c0e0d1418b97e57cd8 (patch) | |
tree | 708eff9b7d7318adf26082ca2df86c71899c1255 /elf/dl-fini.c | |
parent | 4997db742946d08be4378cf91221f558f928bc73 (diff) | |
download | glibc-6b1e7d1992cd89032df431c0e0d1418b97e57cd8.tar.gz glibc-6b1e7d1992cd89032df431c0e0d1418b97e57cd8.tar.xz glibc-6b1e7d1992cd89032df431c0e0d1418b97e57cd8.zip |
Handle DSOs without any dependency in ld.so
Diffstat (limited to 'elf/dl-fini.c')
-rw-r--r-- | elf/dl-fini.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/elf/dl-fini.c b/elf/dl-fini.c index ba6c62a55d..269bcece4c 100644 --- a/elf/dl-fini.c +++ b/elf/dl-fini.c @@ -33,9 +33,12 @@ internal_function _dl_sort_fini (struct link_map *l, struct link_map **maps, size_t nmaps, char *used, Lmid_t ns) { + /* A list of one element need not be sorted. */ + if (nmaps == 1) + return; + /* We can skip looking for the binary itself which is at the front of the search list for the main namespace. */ - assert (nmaps > 1); unsigned int i = ns == LM_ID_BASE; bool seen[nmaps]; memset (seen, false, nmaps * sizeof (seen[0])); @@ -195,9 +198,8 @@ _dl_fini (void) assert (ns == LM_ID_BASE || i == nloaded || i == nloaded - 1); nmaps = i; - if (nmaps > 1) - /* Now we have to do the sorting. */ - _dl_sort_fini (GL(dl_ns)[ns]._ns_loaded, maps, nmaps, NULL, ns); + /* Now we have to do the sorting. */ + _dl_sort_fini (GL(dl_ns)[ns]._ns_loaded, maps, nmaps, NULL, ns); /* We do not rely on the linked list of loaded object anymore from this point on. We have our own list here (maps). The various |