1 | #include <dlfcn.h> |
2 | #include <stdlib.h> |
3 | #include <stdio.h> |
4 | |
5 | static int |
6 | do_test (void) |
7 | { |
8 | void *h = dlopen (file: "tst-tlsmod15a.so" , RTLD_NOW); |
9 | if (h != NULL) |
10 | { |
11 | puts (s: "unexpectedly succeeded to open tst-tlsmod15a.so" ); |
12 | exit (status: 1); |
13 | } |
14 | |
15 | h = dlopen (file: "tst-tlsmod15b.so" , RTLD_NOW); |
16 | if (h == NULL) |
17 | { |
18 | puts (s: "failed to open tst-tlsmod15b.so" ); |
19 | exit (status: 1); |
20 | } |
21 | |
22 | int (*fp) (void) = (int (*) (void)) dlsym (handle: h, name: "in_dso" ); |
23 | if (fp == NULL) |
24 | { |
25 | puts (s: "cannot find in_dso" ); |
26 | exit (status: 1); |
27 | } |
28 | |
29 | return fp (); |
30 | } |
31 | |
32 | #include <support/test-driver.c> |
33 | |