SPRAB89A September 2011 – March 2014
Thread-Local Storage (TLS) is a storage class that allows a program to define thread-specific variables with static storage durations. A TLS variable or thread-local variable is a global/static variable that is instanced once per thread. See Chapter 7 for details about thread-local storage.
The C6000 EABI supports TLS, but this is dependent on whether the runtime operating system's thread library implements the __c6xabi_get_tp() function and other aspects of TLS support.
Thread-local variables are represented in ELF object files and modules similarly to static data. The difference is that ELF requires that thread-local variables be allocated in sections with the SHF_TLS flag set in relocatable files. The ELF specification requires that the section names .tdata and .tbss be used for initialized and uninitialized thread-local storage, respectively. These sections have read-write permission.
In modules, ELF requires that the TLS segment be indicated by the PT_TLS segment type. This segment is read-only. The PT_TLS segment is the TLS Image.
Thread-local symbols have a symbol type of STT_TLS.