2002-02-14 10:34:55 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <tls.h>
|
|
|
|
|
|
|
|
#ifdef USE_TLS
|
|
|
|
# include "tls-macros.h"
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_INT_DEF(baz);
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
in_dso (int n, int *caller_bazp)
|
|
|
|
{
|
2002-08-12 06:25:47 +00:00
|
|
|
int *bazp;
|
2002-02-14 10:34:55 +00:00
|
|
|
int result = 0;
|
|
|
|
|
2002-08-12 06:25:47 +00:00
|
|
|
puts ("foo"); /* Make sure PLT is used before macros. */
|
2002-08-25 22:34:57 +00:00
|
|
|
asm ("" ::: "memory");
|
2002-08-12 06:25:47 +00:00
|
|
|
|
|
|
|
bazp = TLS_GD (baz);
|
|
|
|
|
2002-02-14 10:34:55 +00:00
|
|
|
if (caller_bazp != NULL && bazp != caller_bazp)
|
|
|
|
{
|
|
|
|
printf ("callers address of baz differs: %p vs %p\n", caller_bazp, bazp);
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
else if (*bazp != n)
|
|
|
|
{
|
|
|
|
printf ("baz != %d\n", n);
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
*bazp = 16;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
#endif
|