1

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

VINOTH ENERGETIC
  • 1,775
  • 4
  • 23
  • 38

1 Answers1

0

To my knowledge this is a known issue of Sun linker since 2006. Does it work for you if you copy the integer to a local (non-thread)?

lorro
  • 10,687
  • 23
  • 36