diff options
Diffstat (limited to 'elf')
-rw-r--r-- | elf/dl-lookup.c | 11 | ||||
-rw-r--r-- | elf/reldep2.c | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index 26c839caa7..5fa50fc457 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -151,8 +151,15 @@ add_dependency (struct link_map *undef_map, struct link_map *map) if (__builtin_expect (act < undef_map->l_reldepsmax, 1)) undef_map->l_reldeps[undef_map->l_reldepsact++] = map; - /* And increment the counter in the referenced object. */ - ++map->l_opencount; + if (map->l_searchlist.r_list != NULL) + /* And increment the counter in the referenced object. */ + ++map->l_opencount; + else + /* We have to bump the counts for all dependencies since so far + this object was only a normal or transitive dependency. + Now it might be closed with _dl_close() directly. */ + for (list = map->l_initfini; *list != NULL; ++list) + ++(*list)->l_opencount; /* Display information if we are debugging. */ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) diff --git a/elf/reldep2.c b/elf/reldep2.c index aadb0cbfdb..ba5ab222f9 100644 --- a/elf/reldep2.c +++ b/elf/reldep2.c @@ -53,8 +53,8 @@ main (void) exit (1); } - /* Now close the first object. If must still be around since we have - a implicit dependency. */ + /* Now close the first object. It must still be around since we have + an implicit dependency. */ if (dlclose (h1) != 0) { printf ("closing h1 failed: %s\n", dlerror ()); |