2002-02-14 07:57:19 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2002-02-14 10:34:55 +00:00
|
|
|
|
2002-02-14 07:57:19 +00:00
|
|
|
extern int in_dso (int n, int *caller_foop);
|
|
|
|
|
2021-08-16 16:59:30 +00:00
|
|
|
extern __thread int foo;
|
|
|
|
__thread int comm_n;
|
2002-02-14 07:57:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
in_dso2 (void)
|
|
|
|
{
|
2002-08-12 06:25:47 +00:00
|
|
|
int *foop;
|
2002-02-14 07:57:19 +00:00
|
|
|
int result = 0;
|
|
|
|
static int n;
|
2002-08-12 06:25:47 +00:00
|
|
|
int *np;
|
|
|
|
|
|
|
|
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
|
|
|
foop = &foo;
|
|
|
|
np = &comm_n;
|
2002-02-14 07:57:19 +00: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;
|
|
|
|
}
|