| 32 | } |
| 33 | |
| 34 | static void test_order2() { |
| 35 | void* handle = open_lib(); |
| 36 | |
| 37 | func_t three = dlsym(handle, "three"); |
| 38 | func_t two = dlsym(handle, "two"); |
| 39 | func_t one = dlsym(handle, "one"); |
| 40 | |
| 41 | printf("one: %p -> %d\n", one, one()); |
| 42 | printf("two: %p -> %d\n", two, two()); |
| 43 | printf("three: %p -> %d\n", three, three()); |
| 44 | assert(one() == 1); |
| 45 | assert(two() == 2); |
| 46 | assert(three() == 3); |
| 47 | |
| 48 | assert(one == g_one); |
| 49 | assert(two == g_two); |
| 50 | assert(three == g_three); |
| 51 | } |
| 52 | |
| 53 | static void* thread_main(void* arg) { |
| 54 | printf("in thread_main\n"); |