| 1 | /* Check unloading modules with data in static TLS block. */ |
|---|---|
| 2 | #include <dlfcn.h> |
| 3 | #include <stdio.h> |
| 4 | #include <stdlib.h> |
| 5 | #include <unistd.h> |
| 6 | |
| 7 | |
| 8 | static int |
| 9 | do_test (void) |
| 10 | { |
| 11 | for (int i = 0; i < 1000;) |
| 12 | { |
| 13 | printf (format: "round %d\n",++i); |
| 14 | |
| 15 | void *h = dlopen (file: "$ORIGIN/tst-tlsmod13a.so", RTLD_LAZY); |
| 16 | if (h == NULL) |
| 17 | { |
| 18 | printf (format: "cannot load: %s\n", dlerror ()); |
| 19 | exit (status: 1); |
| 20 | } |
| 21 | |
| 22 | dlclose (handle: h); |
| 23 | } |
| 24 | |
| 25 | return 0; |
| 26 | } |
| 27 | |
| 28 | #include <support/test-driver.c> |
| 29 |
