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

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -