Mention IFUNC enhancements to testsuite in NEWS.
[platform/upstream/glibc.git] / elf / tst-tlsmod4.c
1 #include <stdio.h>
2
3 #include <tls.h>
4
5 #include "tls-macros.h"
6
7
8 COMMON_INT_DEF(baz);
9
10
11 int
12 in_dso (int n, int *caller_bazp)
13 {
14   int *bazp;
15   int result = 0;
16
17   puts ("foo");                 /* Make sure PLT is used before macros.  */
18   asm ("" ::: "memory");
19
20   bazp = TLS_GD (baz);
21
22   if (caller_bazp != NULL && bazp != caller_bazp)
23     {
24       printf ("callers address of baz differs: %p vs %p\n", caller_bazp, bazp);
25       result = 1;
26     }
27   else if (*bazp != n)
28     {
29       printf ("baz != %d\n", n);
30       result = 1;
31     }
32
33   *bazp = 16;
34
35   return result;
36 }