From 8699e7b1daa5d250b8bc69e1ecffae80170277e5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 21 Oct 2000 06:02:49 +0000 Subject: Update. * elf/dl-close.c: Decrement opencount for all dependencies which can be removed even if the object is not yet unloaded. * elf/dl-deps.c (_dl_map_object_deps): If dependency is already in the list decrement opencount of all dependencies. * elf/dl-load.c (_dl_map_object_from_fd): Increment object of object and all dependencies. (_dl_map_object): Likewise. * elf/dl-lookup.c (add_dependency): Likewise. * elf/loadtest.c: Add debug when with more output. --- elf/loadtest.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'elf/loadtest.c') diff --git a/elf/loadtest.c b/elf/loadtest.c index 80f9960..4a3c4c0 100644 --- a/elf/loadtest.c +++ b/elf/loadtest.c @@ -69,10 +69,18 @@ static const struct #include +#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); \ + fflush (stdout) + int -main (void) +main (int argc, char *argv[]) { + int debug = argc > 1 && argv[1][0] != '\0'; int count = TEST_ROUNDS; int result = 0; @@ -85,6 +93,7 @@ main (void) { int nr = random () % NTESTS; int index = tests[nr].index; + struct link_map *map; printf ("%4d: %4d: ", count + 1, nr); fflush (stdout); @@ -125,6 +134,9 @@ main (void) testobjs[index].handle = NULL; } + + if (debug) + OUT; } /* Unload all loaded modules. */ -- cgit v1.1