diff options
Diffstat (limited to 'elf')
-rw-r--r-- | elf/circleload1.c | 2 | ||||
-rw-r--r-- | elf/dl-deps.c | 2 | ||||
-rw-r--r-- | elf/dl-load.c | 5 | ||||
-rw-r--r-- | elf/do-lookup.h | 4 | ||||
-rw-r--r-- | elf/loadtest.c | 8 | ||||
-rw-r--r-- | elf/neededtest.c | 2 | ||||
-rw-r--r-- | elf/neededtest2.c | 2 | ||||
-rw-r--r-- | elf/neededtest3.c | 2 | ||||
-rw-r--r-- | elf/neededtest4.c | 2 | ||||
-rw-r--r-- | elf/unload.c | 4 | ||||
-rw-r--r-- | elf/unload2.c | 4 |
11 files changed, 20 insertions, 17 deletions
diff --git a/elf/circleload1.c b/elf/circleload1.c index 7ac101a799..1fb885cf50 100644 --- a/elf/circleload1.c +++ b/elf/circleload1.c @@ -27,7 +27,7 @@ check_loaded_objects (const char **loaded) for (lm = _r_debug.r_map; lm; lm = lm->l_next) { if (lm->l_name && lm->l_name[0]) - printf(" %s, count = %d\n", lm->l_name, (int) lm->l_opencount); + printf(" %s, count = %d\n", lm->l_name, (int) lm->l_direct_opencount); if (lm->l_type == lt_loaded && lm->l_name) { int match = 0; diff --git a/elf/dl-deps.c b/elf/dl-deps.c index a1c16d7310..acc8fc3a07 100644 --- a/elf/dl-deps.c +++ b/elf/dl-deps.c @@ -566,8 +566,6 @@ Filters not supported with LD_TRACE_PRELINKING")); { /* A direct or transitive dependency is also on the list of relocation dependencies. Remove the latter. */ - --map->l_reldeps[i]->l_opencount; - for (j = i + 1; j < map->l_reldepsact; ++j) map->l_reldeps[j - 1] = map->l_reldeps[j]; diff --git a/elf/dl-load.c b/elf/dl-load.c index 17b90ae8b8..85e03720c6 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -841,7 +841,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp, /* Look again to see if the real name matched another already loaded. */ for (l = GL(dl_ns)[nsid]._ns_loaded; l; l = l->l_next) - if (l->l_ino == st.st_ino && l->l_dev == st.st_dev) + if (l->l_removed == 0 && l->l_ino == st.st_ino && l->l_dev == st.st_dev) { /* The object is already loaded. Just bump its reference count and return it. */ @@ -1826,7 +1826,8 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded, /* If the requested name matches the soname of a loaded object, use that object. Elide this check for names that have not yet been opened. */ - if (__builtin_expect (l->l_faked, 0) != 0) + if (__builtin_expect (l->l_faked, 0) != 0 + || __builtin_expect (l->l_removed, 0) != 0) continue; if (!_dl_name_match_p (name, l)) { diff --git a/elf/do-lookup.h b/elf/do-lookup.h index e57d9df26d..88de3fe26f 100644 --- a/elf/do-lookup.h +++ b/elf/do-lookup.h @@ -52,6 +52,10 @@ do_lookup_x (const char *undef_name, unsigned long int hash, if ((type_class & ELF_RTYPE_CLASS_COPY) && map->l_type == lt_executable) continue; + /* Do not look into objects which are going to be removed. */ + if (map->l_removed) + continue; + /* Print some debugging info if wanted. */ if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0)) _dl_debug_printf ("symbol=%s; lookup in file=%s\n", diff --git a/elf/loadtest.c b/elf/loadtest.c index 6b8f4bb7d0..ee106ea152 100644 --- a/elf/loadtest.c +++ b/elf/loadtest.c @@ -73,8 +73,8 @@ static const struct #define OUT \ for (map = _r_debug.r_map; map != NULL; map = map->l_next) \ if (map->l_type == lt_loaded) \ - printf ("name = \"%s\", opencount = %d\n", \ - map->l_name, (int) map->l_opencount); \ + printf ("name = \"%s\", direct_opencount = %d\n", \ + map->l_name, (int) map->l_direct_opencount); \ fflush (stdout) @@ -183,8 +183,8 @@ main (int argc, char *argv[]) for (map = _r_debug.r_map; map != NULL; map = map->l_next) if (map->l_type == lt_loaded) { - printf ("name = \"%s\", opencount = %d\n", - map->l_name, (int) map->l_opencount); + printf ("name = \"%s\", direct_opencount = %d\n", + map->l_name, (int) map->l_direct_opencount); result = 1; } diff --git a/elf/neededtest.c b/elf/neededtest.c index e6e99bfc6d..6c7a952066 100644 --- a/elf/neededtest.c +++ b/elf/neededtest.c @@ -27,7 +27,7 @@ check_loaded_objects (const char **loaded) for (lm = _r_debug.r_map; lm; lm = lm->l_next) { if (lm->l_name && lm->l_name[0]) - printf(" %s, count = %d\n", lm->l_name, (int) lm->l_opencount); + printf(" %s, count = %d\n", lm->l_name, (int) lm->l_direct_opencount); if (lm->l_type == lt_loaded && lm->l_name) { int match = 0; diff --git a/elf/neededtest2.c b/elf/neededtest2.c index cf111bc303..b682f15792 100644 --- a/elf/neededtest2.c +++ b/elf/neededtest2.c @@ -27,7 +27,7 @@ check_loaded_objects (const char **loaded) for (lm = _r_debug.r_map; lm; lm = lm->l_next) { if (lm->l_name && lm->l_name[0]) - printf(" %s, count = %d\n", lm->l_name, (int) lm->l_opencount); + printf(" %s, count = %d\n", lm->l_name, (int) lm->l_direct_opencount); if (lm->l_type == lt_loaded && lm->l_name) { int match = 0; diff --git a/elf/neededtest3.c b/elf/neededtest3.c index 38b3c6c6b7..ea1dcf4794 100644 --- a/elf/neededtest3.c +++ b/elf/neededtest3.c @@ -27,7 +27,7 @@ check_loaded_objects (const char **loaded) for (lm = _r_debug.r_map; lm; lm = lm->l_next) { if (lm->l_name && lm->l_name[0]) - printf(" %s, count = %d\n", lm->l_name, (int) lm->l_opencount); + printf(" %s, count = %d\n", lm->l_name, (int) lm->l_direct_opencount); if (lm->l_type == lt_loaded && lm->l_name) { int match = 0; diff --git a/elf/neededtest4.c b/elf/neededtest4.c index 04ab10e4c9..7514bed499 100644 --- a/elf/neededtest4.c +++ b/elf/neededtest4.c @@ -27,7 +27,7 @@ check_loaded_objects (const char **loaded) for (lm = _r_debug.r_map; lm; lm = lm->l_next) { if (lm->l_name && lm->l_name[0]) - printf(" %s, count = %d\n", lm->l_name, (int) lm->l_opencount); + printf(" %s, count = %d\n", lm->l_name, (int) lm->l_direct_opencount); if (lm->l_type == lt_loaded && lm->l_name) { int match = 0; diff --git a/elf/unload.c b/elf/unload.c index 4fd82b7e3a..ffb33482c0 100644 --- a/elf/unload.c +++ b/elf/unload.c @@ -12,8 +12,8 @@ #define OUT \ for (map = _r_debug.r_map; map != NULL; map = map->l_next) \ if (map->l_type == lt_loaded) \ - printf ("name = \"%s\", opencount = %d\n", \ - map->l_name, (int) map->l_opencount); \ + printf ("name = \"%s\", direct_opencount = %d\n", \ + map->l_name, (int) map->l_direct_opencount); \ fflush (stdout) typedef struct diff --git a/elf/unload2.c b/elf/unload2.c index 7a38053433..e14c6f06af 100644 --- a/elf/unload2.c +++ b/elf/unload2.c @@ -9,8 +9,8 @@ #define OUT \ for (map = _r_debug.r_map; map != NULL; map = map->l_next) \ if (map->l_type == lt_loaded) \ - printf ("name = \"%s\", opencount = %d\n", \ - map->l_name, (int) map->l_opencount); \ + printf ("name = \"%s\", direct_opencount = %d\n", \ + map->l_name, (int) map->l_direct_opencount); \ fflush (stdout) int |