aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf/pr21964-2c.c
blob: f879dd5ba468303c14a0c399b4e0e0f48fc54545 (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
28
29
30
31
32
#include <dlfcn.h>
#include <stdio.h>

extern int foo1 (void);

int main()
{
  void *dl;
  void *sym;
  int (*func) (void);

  if (foo1 () != 0)
    return 1;

  dl = dlopen("pr21964-2b.so", RTLD_LAZY);
  if (!dl)
    return 2;

  sym = dlsym(dl, "__start___verbose");
  if (!sym)
    return 3;

  func = dlsym(dl, "foo2");
  if (!func)
    return 4;
  if (func () == 0)
    printf ("PASS\n");

  dlclose(dl);

  return 0;
}