From 28e729734352e3f9ffd7f323973d9b1e817d9986 Mon Sep 17 00:00:00 2001 From: drepper Date: Sat, 21 Oct 2000 06:01:12 +0000 Subject: [PATCH] (add_dependency): Increment object of object and all dependencies. --- elf/dl-lookup.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index 581c6a6c2b..d9476817c3 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -129,6 +129,8 @@ add_dependency (struct link_map *undef_map, struct link_map *map) if (runp != NULL) { + unsigned int j; + /* The object is still available. Add the reference now. */ if (__builtin_expect (act >= undef_map->l_reldepsmax, 0)) { @@ -158,7 +160,11 @@ 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. */ + /* And increment the counter in the referenced object + and its dependencies. */ + if (map->l_initfini != NULL) + for (j = 1; map->l_initfini[j] != NULL; ++j) + ++map->l_initfini[j]->l_opencount; ++map->l_opencount; /* Display information if we are debugging. */ -- 2.11.0