From: Ulrich Drepper Date: Fri, 12 Dec 1997 02:29:49 +0000 (+0000) Subject: Don't count in multiply reference object in number of prelaoded X-Git-Tag: cvs/glibc-2_0_6pre4~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72a5ba9b39ff350edf63800022e0550c74944ea6;p=thirdparty%2Fglibc.git Don't count in multiply reference object in number of prelaoded objects. [PR libc/375]. --- diff --git a/elf/rtld.c b/elf/rtld.c index f9a2cd3d03c..2bda48bebb9 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -358,8 +358,10 @@ of this helper program; chances are you did not intend to run this program.\n", while ((p = strsep (&list, " ")) != NULL) if (! __libc_enable_secure || strchr (p, '/') == NULL) { - (void) _dl_map_object (NULL, p, lt_library, 0); - ++npreloads; + struct link_map *new_map = _dl_map_object (NULL, p, lt_library, 0); + if (new_map->l_opencount == 1) + /* It is no duplicate. */ + ++npreloads; } } @@ -413,15 +415,21 @@ of this helper program; chances are you did not intend to run this program.\n", runp = file; while ((p = strsep (&runp, ": \t\n")) != NULL) { - (void) _dl_map_object (NULL, p, lt_library, 0); - ++npreloads; + struct link_map *new_map = _dl_map_object (NULL, p, + lt_library, 0); + if (new_map->l_opencount == 1) + /* It is no duplicate. */ + ++npreloads; } } if (problem != NULL) { char *p = strndupa (problem, file_size - (problem - file)); - (void) _dl_map_object (NULL, p, lt_library, 0); + struct link_map *new_map = _dl_map_object (NULL, p, lt_library, 0); + if (new_map->l_opencount == 1) + /* It is no duplicate. */ + ++npreloads; } /* We don't need the file anymore. */