Last change
on this file was 2036, checked in by bird, 20 years ago |
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
553 bytes
|
Line | |
---|
1 | #include <stdio.h>
|
---|
2 |
|
---|
3 | #include <tls.h>
|
---|
4 |
|
---|
5 | #ifdef USE_TLS
|
---|
6 | # include "tls-macros.h"
|
---|
7 |
|
---|
8 | extern int in_dso (int n, int *caller_foop);
|
---|
9 |
|
---|
10 | COMMON_INT_DEF(comm_n);
|
---|
11 |
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
15 | int
|
---|
16 | in_dso2 (void)
|
---|
17 | {
|
---|
18 | int *foop;
|
---|
19 | int result = 0;
|
---|
20 | static int n;
|
---|
21 | int *np;
|
---|
22 |
|
---|
23 | puts ("foo"); /* Make sure PLT is used before macros. */
|
---|
24 | asm ("" ::: "memory");
|
---|
25 |
|
---|
26 | foop = TLS_GD (foo);
|
---|
27 | np = TLS_GD (comm_n);
|
---|
28 |
|
---|
29 | if (n != *np)
|
---|
30 | {
|
---|
31 | printf ("n = %d != comm_n = %d\n", n, *np);
|
---|
32 | result = 1;
|
---|
33 | }
|
---|
34 |
|
---|
35 | result |= in_dso (*foop = 42 + n++, foop);
|
---|
36 |
|
---|
37 | *foop = 16;
|
---|
38 |
|
---|
39 | return result;
|
---|
40 | }
|
---|
41 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.