const Variant = enum 29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64const Variant = enum {
/// The original Variant I:
///
/// ----------------------------------------
/// | DTV | Zig TCB | ABI TCB | TLS Blocks |
/// ----------------^-----------------------
/// `-- The TP register points here.
///
/// The layout in this variant necessitates separate alignment of both the TP and the TLS
/// blocks.
///
/// The first word in the ABI TCB points to the DTV. For some architectures, there may be a
/// second word with an unspecified meaning.
I_original,
/// The modified Variant I:
///
/// --------------------------------------------
/// | DTV | Zig TCB | ABI TCB | TLS Blocks |
/// ------------------------------^-------------
/// `-- The TP register points here (*inside* the TLS blocks).
///
/// The offset from the start of the TLS blocks to the TP register is `current_tp_offset`. It
/// may be zero, in which case the TP register points to the start of the TLS blocks.
///
/// The first (and only) word in the ABI TCB points to the DTV.
I_modified,
/// Variant II:
///
/// ----------------------------------------
/// | TLS Blocks | ABI TCB | Zig TCB | DTV |
/// -------------^--------------------------
/// `-- The TP register points here.
///
/// The first (and only) word in the ABI TCB points to the ABI TCB itself.
II,
}
Represents an ELF TLS variant.
In all variants, the TP and the TLS blocks must be aligned to the
p_alignvalue in thePT.TLSELF program header. Everything else has natural alignment.The location of the DTV does not actually matter. For simplicity, we put it in the TLS area, but there is no actual ABI requirement that it reside there.