The TLS Directory has the following format:
Offset | Size | Field | Description |
0 | 4 | Raw Data Start VA (Virtual Address) | Starting address of the TLS template. The template is a block of data used to initialize TLS data. The system copies all this data each time a thread is created, so it must not be corrupted. Note that this address is not an RVA; it is an address for which there should be a base relocation in the .reloc section. |
4 | 4 | Raw Data End VA | Address of the last byte of the TLS, except for the zero fill. As with the Raw Data Start VA, this is a virtual address, not an RVA. |
8 | 4 | Address of Index | Location to receive the TLS index, which the loader assigns. This location is in an ordinary data section, so it can be given a symbolic name accessible to the program. |
12 | 4 | Address of Callbacks | Pointer to an array of TLS callback functions. The array is null-terminated, so if there is no callback function supported, this field points to four bytes set to zero. The prototype for these functions is given below, in "TLS Callback Functions." |
16 | 4 | Size of Zero Fill | The size in bytes of the template, beyond the initialized data delimited by Raw Data Start VA and Raw Data End VA. The total template size should be the same as the total size of TLS data in the image file. The zero fill is the amount of data that comes after the initialized nonzero data. |
20 | 4 | Characteristics | Reserved for possible future use by TLS flags. |