ubuntu-buildroot/output/build/glibc-2.36-81-g4f4d7a13edfd.../elf/tst-tlsmod4.c

33 lines
497 B
C
Raw Normal View History

2024-04-01 15:19:46 +00:00
#include <stdio.h>
__thread int baz;
int
in_dso (int n, int *caller_bazp)
{
int *bazp;
int result = 0;
puts ("foo"); /* Make sure PLT is used before macros. */
asm ("" ::: "memory");
bazp = &baz;
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;
}