2002-02-14 08:57:19 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <tls.h>
|
|
|
|
|
|
|
|
#ifdef USE_TLS
|
2002-02-14 11:34:55 +01:00
|
|
|
# include "tls-macros.h"
|
|
|
|
|
2002-02-14 08:57:19 +01:00
|
|
|
extern int in_dso (int n, int *caller_foop);
|
|
|
|
|
|
|
|
COMMON_INT_DEF(comm_n);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
in_dso2 (void)
|
|
|
|
{
|
2002-08-12 08:25:47 +02:00
|
|
|
int *foop;
|
2002-02-14 08:57:19 +01:00
|
|
|
int result = 0;
|
|
|
|
static int n;
|
2002-08-12 08:25:47 +02:00
|
|
|
int *np;
|
|
|
|
|
|
|
|
puts ("foo"); /* Make sure PLT is used before macros. */
|
2002-08-26 00:34:57 +02:00
|
|
|
asm ("" ::: "memory");
|
2002-08-12 08:25:47 +02:00
|
|
|
|
|
|
|
foop = TLS_GD (foo);
|
|
|
|
np = TLS_GD (comm_n);
|
2002-02-14 08:57:19 +01:00
|
|
|
|
|
|
|
if (n != *np)
|
|
|
|
{
|
|
|
|
printf ("n = %d != comm_n = %d\n", n, *np);
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
result |= in_dso (*foop = 42 + n++, foop);
|
|
|
|
|
|
|
|
*foop = 16;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
#endif
|