Here is my sample program,
int main()
{
static __thread int a;
printf("\n %d",a);
return 0;
}
In this program, when printf statement is removed, it is linking fine. When printf statement is included, it gives the following linker error
ld: fatal: relocation error: R_SPARC_TLS_LE_HIX22: file /var/tmp//ccwb2Cxc.o: symbol <unknown>: bad symbol type SECT: symbol type must be TLS
PROCESSOR: SUN-SPARC OS: UNIX