2002-02-14 18:34:55 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
2021-08-17 00:59:30 +08:00
|
|
|
__thread int baz;
|
2002-02-14 18:34:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
in_dso (int n, int *caller_bazp)
|
|
|
|
{
|
2002-08-12 14:25:47 +08:00
|
|
|
int *bazp;
|
2002-02-14 18:34:55 +08:00
|
|
|
int result = 0;
|
|
|
|
|
2002-08-12 14:25:47 +08:00
|
|
|
puts ("foo"); /* Make sure PLT is used before macros. */
|
2002-08-26 06:34:57 +08:00
|
|
|
asm ("" ::: "memory");
|
2002-08-12 14:25:47 +08:00
|
|
|
|
2021-08-17 00:59:30 +08:00
|
|
|
bazp = &baz;
|
2002-08-12 14:25:47 +08:00
|
|
|
|
2002-02-14 18:34:55 +08: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;
|
|
|
|
}
|