lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | #include <dlfcn.h> |
| 2 | #include <stdio.h> |
| 3 | #include <stdlib.h> |
| 4 | |
| 5 | #include <link.h> |
| 6 | |
| 7 | #define TEST_FUNCTION do_test () |
| 8 | static int |
| 9 | do_test (void) |
| 10 | { |
| 11 | static const char modname1[] = "tst-tlsmod5.so"; |
| 12 | static const char modname2[] = "tst-tlsmod6.so"; |
| 13 | int result = 0; |
| 14 | |
| 15 | void *h1 = dlopen (modname1, RTLD_LAZY); |
| 16 | if (h1 == NULL) |
| 17 | { |
| 18 | printf ("cannot open '%s': %s\n", modname1, dlerror ()); |
| 19 | result = 1; |
| 20 | } |
| 21 | void *h2 = dlopen (modname2, RTLD_LAZY); |
| 22 | if (h2 == NULL) |
| 23 | { |
| 24 | printf ("cannot open '%s': %s\n", modname2, dlerror ()); |
| 25 | result = 1; |
| 26 | } |
| 27 | |
| 28 | if (h1 != NULL) |
| 29 | dlclose (h1); |
| 30 | if (h2 != NULL) |
| 31 | dlclose (h2); |
| 32 | |
| 33 | return result; |
| 34 | } |
| 35 | |
| 36 | |
| 37 | #include "../test-skeleton.c" |