summaryrefslogtreecommitdiff
path: root/elf/unload8mod3.c
blob: d49e22b24c50dba28f72efbbde20476208019fc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>

void
mod3_fini2 (void)
{
}

void
mod3_fini (void)
{
  mod3_fini2 ();
}

void
mod3 (void)
{
  void *h = dlopen ("$ORIGIN/unload8mod2.so", RTLD_LAZY);
  if (h == NULL)
    {
      puts ("dlopen unload8mod2.so failed");
      exit (1);
    }

  atexit (mod3_fini);
}