]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don't count in multiply reference object in number of prelaoded
authorUlrich Drepper <drepper@redhat.com>
Fri, 12 Dec 1997 02:29:49 +0000 (02:29 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 12 Dec 1997 02:29:49 +0000 (02:29 +0000)
objects.  [PR libc/375].

elf/rtld.c

index f9a2cd3d03cd2a16dde0fef8e96f9bce98969a16..2bda48bebb93136fd32a8bacabf3266b76a27978 100644 (file)
@@ -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.  */