diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-12-12 02:29:49 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-12-12 02:29:49 +0000 |
commit | 72a5ba9b39ff350edf63800022e0550c74944ea6 (patch) | |
tree | 3ad6f83591a31463a1bb7c3139bc6ded937df409 /elf | |
parent | 25c1dd5cbb2e4d7211e8bb72a6761b20bbc1006c (diff) |
Don't count in multiply reference object in number of prelaoded
objects. [PR libc/375].
Diffstat (limited to 'elf')
-rw-r--r-- | elf/rtld.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/elf/rtld.c b/elf/rtld.c index f9a2cd3d03..2bda48bebb 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. */ |