lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | #include <dlfcn.h> |
| 2 | #include <stdio.h> |
| 3 | |
| 4 | static int |
| 5 | do_test (void) |
| 6 | { |
| 7 | void *h = dlopen ("tst-tlsmod15a.so", RTLD_NOW); |
| 8 | if (h != NULL) |
| 9 | { |
| 10 | puts ("unexpectedly succeeded to open tst-tlsmod15a.so"); |
| 11 | exit (1); |
| 12 | } |
| 13 | |
| 14 | h = dlopen ("tst-tlsmod15b.so", RTLD_NOW); |
| 15 | if (h == NULL) |
| 16 | { |
| 17 | puts ("failed to open tst-tlsmod15b.so"); |
| 18 | exit (1); |
| 19 | } |
| 20 | |
| 21 | int (*fp) (void) = (int (*) (void)) dlsym (h, "in_dso"); |
| 22 | if (fp == NULL) |
| 23 | { |
| 24 | puts ("cannot find in_dso"); |
| 25 | exit (1); |
| 26 | } |
| 27 | |
| 28 | return fp (); |
| 29 | } |
| 30 | |
| 31 | #define TEST_FUNCTION do_test () |
| 32 | #include "../test-skeleton.c" |