binutils/tests/Regression/bz872148-PIE-thread-produce-text-relocations-on-s390-x/reproducer6.c
2021-04-28 13:38:57 +02:00

21 lines
567 B
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
This reproducer is taken from https://sourceware.org/bugzilla/show_bug.cgi?id=6443
Author is Jakub Jelinek <jakub@redhat.com>
gcc -O2 -pie -fpie -o reproducer6 reproducer6.c
eu-readelf -d reproducer6 | grep TEXTREL
test $? -eq 0 && echo FAIL || echo PASS
*/
__thread int a;
__thread int b __attribute((tls_model ("local-exec")));
__thread int c __attribute((tls_model ("initial-exec")));
__thread int d __attribute((tls_model ("local-dynamic")));
__thread int e __attribute((tls_model ("global-dynamic")));
int
main (void)
{
return a + b + c + d + e;
}