source: vendor/glibc-tests/glibc/elf/tst-tlsmod4.c

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: 574 bytes
Line 
1#include <stdio.h>
2
3#include <tls.h>
4
5#ifdef USE_TLS
6# include "tls-macros.h"
7
8
9COMMON_INT_DEF(baz);
10
11
12int
13in_dso (int n, int *caller_bazp)
14{
15 int *bazp;
16 int result = 0;
17
18 puts ("foo"); /* Make sure PLT is used before macros. */
19 asm ("" ::: "memory");
20
21 bazp = TLS_GD (baz);
22
23 if (caller_bazp != NULL && bazp != caller_bazp)
24 {
25 printf ("callers address of baz differs: %p vs %p\n", caller_bazp, bazp);
26 result = 1;
27 }
28 else if (*bazp != n)
29 {
30 printf ("baz != %d\n", n);
31 result = 1;
32 }
33
34 *bazp = 16;
35
36 return result;
37}
38#endif
Note: See TracBrowser for help on using the repository browser.