This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Another dlclose testcase


On Thu, Jan 09, 2003 at 11:53:13AM +0100, Jakub Jelinek wrote:
> --- libc/elf/reldep9.c.jj	2003-01-09 13:04:10.000000000 +0100
> +++ libc/elf/reldep9.c	2003-01-09 12:51:27.000000000 +0100
> @@ -0,0 +1,16 @@
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <dlfcn.h>
> +
> +int
> +main (void)
> +{
> +  void *handle = dlopen ("reldep9mod3.so", RTLD_LAZY);
> +  if (handle == NULL)
> +    {
> +      printf ("%s\n", dlerror ());
> +      exit (1);
> +    }
> +  dlclose (handle);
> +  exit (1);

Note that in the end this exit (1) should be probably replaced with abort(),
so that it not only checks for correctness, but ensures that dlclose
unloads what it can. In this case all the l_opencount bumping of all the
reldep9mod{1,2,3}.so libraries was done only a) because of the dlopen
b) because of relocation dependencies in between those libraries.
This means that all 3 ilbraries should be surely unloadable at dlclose time.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]