]>
Commit | Line | Data |
---|---|---|
ebda6173 UD |
1 | #include <stdio.h> |
2 | ||
11bf311e | 3 | #include "tls-macros.h" |
ebda6173 UD |
4 | |
5 | ||
6 | COMMON_INT_DEF(baz); | |
7 | ||
8 | ||
9 | int | |
10 | in_dso (int n, int *caller_bazp) | |
11 | { | |
e6f52680 | 12 | int *bazp; |
ebda6173 UD |
13 | int result = 0; |
14 | ||
e6f52680 | 15 | puts ("foo"); /* Make sure PLT is used before macros. */ |
046b4069 | 16 | asm ("" ::: "memory"); |
e6f52680 RM |
17 | |
18 | bazp = TLS_GD (baz); | |
19 | ||
ebda6173 UD |
20 | if (caller_bazp != NULL && bazp != caller_bazp) |
21 | { | |
22 | printf ("callers address of baz differs: %p vs %p\n", caller_bazp, bazp); | |
23 | result = 1; | |
24 | } | |
25 | else if (*bazp != n) | |
26 | { | |
27 | printf ("baz != %d\n", n); | |
28 | result = 1; | |
29 | } | |
30 | ||
31 | *bazp = 16; | |
32 | ||
33 | return result; | |
34 | } |