mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-11 07:40:05 +00:00
e6f526809d
of the TLS macros, otherwise the compiler might not have initialized the PIC register yet when we use the PLT via asm. * elf/tst-tlsmod3.c (in_dso2): Likewise. * elf/tst-tlsmod2.c (in_dso): Likewise.
38 lines
549 B
C
38 lines
549 B
C
#include <stdio.h>
|
|
|
|
#include <tls.h>
|
|
|
|
#ifdef USE_TLS
|
|
# include "tls-macros.h"
|
|
|
|
|
|
COMMON_INT_DEF(baz);
|
|
|
|
|
|
int
|
|
in_dso (int n, int *caller_bazp)
|
|
{
|
|
int *bazp;
|
|
int result = 0;
|
|
|
|
puts ("foo"); /* Make sure PLT is used before macros. */
|
|
|
|
bazp = TLS_GD (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;
|
|
}
|
|
#endif
|