1// BZ 12453
2#include <stdio.h>
3#include <dlfcn.h>
4
5
6static int
7do_test (void)
8{
9 void* dl = dlopen (file: "tst-tls19mod1.so", RTLD_LAZY | RTLD_GLOBAL);
10 if (dl == NULL)
11 {
12 printf (format: "Error loading tst-tls19mod1.so: %s\n", dlerror ());
13 return 1;
14 }
15
16 int (*fn) (void) = dlsym (handle: dl, name: "foo");
17 if (fn == NULL)
18 {
19 printf(format: "Error obtaining symbol foo\n");
20 return 1;
21 }
22
23 return fn ();
24}
25
26#include <support/test-driver.c>
27

source code of glibc/elf/tst-tls19.c