c++ - why __thread gives linker error when printf statement is used? -
here sample program,
int main() { static __thread int a; printf("\n %d",a); return 0; }
in program, when printf statement removed, linking fine. when printf statement included, gives 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 tls
processor: sun-sparc os: unix
to knowledge known issue of sun linker since 2006. work if copy integer local (non-thread)?
Comments
Post a Comment