]> git.ipfire.org Git - thirdparty/glibc.git/blob - elf/tst-tlsmod3.c
install.texi: Build was tested with binutils 2.41 (just released)
[thirdparty/glibc.git] / elf / tst-tlsmod3.c
1 #include <stdio.h>
2
3
4 extern int in_dso (int n, int *caller_foop);
5
6 extern __thread int foo;
7 __thread int comm_n;
8
9
10
11
12 int
13 in_dso2 (void)
14 {
15 int *foop;
16 int result = 0;
17 static int n;
18 int *np;
19
20 puts ("foo"); /* Make sure PLT is used before macros. */
21 asm ("" ::: "memory");
22
23 foop = &foo;
24 np = &comm_n;
25
26 if (n != *np)
27 {
28 printf ("n = %d != comm_n = %d\n", n, *np);
29 result = 1;
30 }
31
32 result |= in_dso (*foop = 42 + n++, foop);
33
34 *foop = 16;
35
36 return result;
37 }