* libio/bits/stdio2.h (__fread_chk, __fread_unlocked_chk): New
[glibc.git] / elf / tst-tlsmod4.c
blobdd954866186842402a9e95e4cabbf50bad8268b5
1 #include <stdio.h>
3 #include <tls.h>
5 #include "tls-macros.h"
8 COMMON_INT_DEF(baz);
11 int
12 in_dso (int n, int *caller_bazp)
14 int *bazp;
15 int result = 0;
17 puts ("foo"); /* Make sure PLT is used before macros. */
18 asm ("" ::: "memory");
20 bazp = TLS_GD (baz);
22 if (caller_bazp != NULL && bazp != caller_bazp)
24 printf ("callers address of baz differs: %p vs %p\n", caller_bazp, bazp);
25 result = 1;
27 else if (*bazp != n)
29 printf ("baz != %d\n", n);
30 result = 1;
33 *bazp = 16;
35 return result;