2002-02-14 10:34:55 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
2021-08-16 16:59:30 +00:00
|
|
|
__thread int baz;
|
2002-02-14 10:34:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2021-08-16 16:59:30 +00:00
|
|
|
bazp = &baz;
|
2002-08-12 06:25:47 +00:00
|
|
|
|
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;
|
|
|
|
}
|