diff options
author | Zack Weinberg <zackw@panix.com> | 2017-06-08 15:39:03 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2017-06-08 15:39:03 -0400 |
commit | 5046dbb4a7eba5eccfd258f92f4735c9ffc8d069 (patch) | |
tree | 4470480d904b65cf14ca524f96f79eca818c3eaf /elf/unload2.c | |
parent | 199fc19d3aaaf57944ef036e15904febe877fc93 (diff) | |
download | glibc-zack/build-layout-experiment.tar glibc-zack/build-layout-experiment.tar.gz glibc-zack/build-layout-experiment.tar.bz2 glibc-zack/build-layout-experiment.zip |
Prepare for radical source tree reorganization.zack/build-layout-experiment
All top-level files and directories are moved into a temporary storage
directory, REORG.TODO, except for files that will certainly still
exist in their current form at top level when we're done (COPYING,
COPYING.LIB, LICENSES, NEWS, README), all old ChangeLog files (which
are moved to the new directory OldChangeLogs, instead), and the
generated file INSTALL (which is just deleted; in the new order, there
will be no generated files checked into version control).
Diffstat (limited to 'elf/unload2.c')
-rw-r--r-- | elf/unload2.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/elf/unload2.c b/elf/unload2.c deleted file mode 100644 index eef2bfd426..0000000000 --- a/elf/unload2.c +++ /dev/null @@ -1,59 +0,0 @@ -#include <dlfcn.h> -#include <elf.h> -#include <errno.h> -#include <error.h> -#include <link.h> -#include <stdio.h> -#include <stdlib.h> - -#define MAPS ((struct link_map *) _r_debug.r_map) - -#define OUT \ - for (map = MAPS; map != NULL; map = map->l_next) \ - if (map->l_type == lt_loaded) \ - printf ("name = \"%s\", direct_opencount = %d\n", \ - map->l_name, (int) map->l_direct_opencount); \ - fflush (stdout) - -int -main (void) -{ - void *h[3]; - struct link_map *map; - void (*fp) (void); - - h[0] = dlopen ("unload2mod.so", RTLD_LAZY); - h[1] = dlopen ("unload2mod.so", RTLD_LAZY); - if (h[0] == NULL || h[1] == NULL) - error (EXIT_FAILURE, errno, "cannot load \"unload2mod.so\""); - h[2] = dlopen ("unload2dep.so", RTLD_LAZY); - if (h[2] == NULL) - error (EXIT_FAILURE, errno, "cannot load \"unload2dep.so\""); - - puts ("\nAfter loading everything:"); - OUT; - - dlclose (h[0]); - - puts ("\nAfter unloading \"unload2mod.so\" once:"); - OUT; - - dlclose (h[1]); - - puts ("\nAfter unloading \"unload2mod.so\" twice:"); - OUT; - - fp = dlsym (h[2], "foo"); - puts ("\nnow calling `foo'"); - fflush (stdout); - fp (); - puts ("managed to call `foo'"); - fflush (stdout); - - dlclose (h[2]); - - puts ("\nAfter unloading \"unload2dep.so\":"); - OUT; - - return 0; -} |