You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[AAELF64] TLS GOT generating relocations must have 0 addend.
Bring TLS GOT generating relocations in line with non GOT generating
relocations in #272.
The ABI rule is that static linkers should generate a GOT entry for
each unique tuple of (S,A). However static linkers such as GNU ld
and lld only generate a unique entry per unique S, and handle A
inconsistently. With GNU ld ignoring A and lld adding it after.
The only consistent behaviour between implementations is when
A is 0.
@@ -1483,6 +1485,7 @@ In addition to the terms defined in `Relocation types`_, the tables listing the
1483
1485
1484
1486
- ``TLSDESC(S+A)`` resolves to a contiguous pair of pointer-sized values, as created by ``GTLSDESC(S+A)``.
1485
1487
1488
+
Relocations using the operations ``GTLSDESC(S)``, ``GTPREL(S)`` and ``GTLSIDX(S)`` relocations must have a zero addend. Previous versions of this document included the addend ``A`` in ``Operation(S + A)`` where Operation is one of ``GTLSDESC,``, ``GTPREL`` and ``GTLSIDX``. This results in a GOT entry, or pair of entries for ``S + A``. With a zero addend ``Operation(S + 0)`` is equivalent to ``Operation(S)`` and ``Operation(S) + 0``.
1486
1489
1487
1490
General Dynamic thread-local storage model
1488
1491
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1494,15 +1497,15 @@ General Dynamic thread-local storage model
| 512 | 80 | R\_<CLS>\_TLSGD\_ ADR\_PREL21 | G(GTLSIDX(S,A)) - P | Set an ADR immediate field to bits [20:0] of X; check –2\ :sup:`20` <= X < 2\ :sup:`20` |
1500
+
| 512 | 80 | R\_<CLS>\_TLSGD\_ ADR\_PREL21 | G(GTLSIDX(S)) - P| Set an ADR immediate field to bits [20:0] of X; check –2\ :sup:`20` <= X < 2\ :sup:`20` |
| 513 | 81 | R\_<CLS>\_TLSGD\_ ADR\_PAGE21 | Page(G(GTLSIDX(S,A)) - Page(P) | Set an ADRP immediate field to bits [32:12] of X; check –2\ :sup:`32` <= X < 2\ :sup:`32`|
1502
+
| 513 | 81 | R\_<CLS>\_TLSGD\_ ADR\_PAGE21 | Page(G(GTLSIDX(S)) - Page(P)| Set an ADRP immediate field to bits [32:12] of X; check –2\ :sup:`32` <= X < 2\ :sup:`32`|
| 541 | 103 | R\_<CLS>\_TLSIE\_ ADR\_GOTTPREL\_PAGE21 | Page(G(GTPREL(S+A))) - Page(P) | Set an ADRP immediate field to bits [32:12] of X; check –2\ :sup:`32` <= X < 2\ :sup:`32`|
1604
+
| 541 | 103 | R\_<CLS>\_TLSIE\_ ADR\_GOTTPREL\_PAGE21 | Page(G(GTPREL(S))) - Page(P)| Set an ADRP immediate field to bits [32:12] of X; check –2\ :sup:`32` <= X < 2\ :sup:`32`|
| 542 |\-| R\_<CLS>\_TLSIE\_ LD64\_GOTTPREL\_LO12\_NC | G(GTPREL(S+A))| Set an LD offset field to bits [11:3] of X. No overflow check; check that X&7=0 |
1606
+
| 542 |\-| R\_<CLS>\_TLSIE\_ LD64\_GOTTPREL\_LO12\_NC | G(GTPREL(S)) | Set an LD offset field to bits [11:3] of X. No overflow check; check that X&7=0 |
|\-| 104 | R\_<CLS>\_TLSIE\_ LD32\_GOTTPREL\_LO12\_NC | G(GTPREL(S+A))| Set an LD offset field to bits [11:2] of X. No overflow check; check that X&3=0 |
1608
+
|\-| 104 | R\_<CLS>\_TLSIE\_ LD32\_GOTTPREL\_LO12\_NC | G(GTPREL(S)) | Set an LD offset field to bits [11:2] of X. No overflow check; check that X&3=0 |
| 543 | 105 | R\_<CLS>\_TLSIE\_ LD\_GOTTPREL\_PREL19 | G(GTPREL(S+A)) – P | Set a load-literal immediate to bits [20:2] of X; check –2\ :sup:`20` <= X < 2\ :sup:`20`|
1610
+
| 543 | 105 | R\_<CLS>\_TLSIE\_ LD\_GOTTPREL\_PREL19 | G(GTPREL(S)) – P| Set a load-literal immediate to bits [20:2] of X; check –2\ :sup:`20` <= X < 2\ :sup:`20`|
| 561 | 123 | R\_<CLS>\_TLSDESC\_ ADR\_PREL21 | G(GTLSDESC(S+A)) - P | Set an ADR immediate field to bits [20:0]; check -2\ :sup:`20` <= X < 2\ :sup:`20`. |
1684
+
| 561 | 123 | R\_<CLS>\_TLSDESC\_ ADR\_PREL21 | G(GTLSDESC(S)) - P| Set an ADR immediate field to bits [20:0]; check -2\ :sup:`20` <= X < 2\ :sup:`20`. |
| 562 | 124 | R\_<CLS>\_TLSDESC\_ ADR\_PAGE21 | Page(G(GTLSDESC(S+A))) - Page(P) | Set an ADRP immediate field to bits [32:12] of X; check -2\ :sup:`32` <= X < 2\ :sup:`32`. |
1686
+
| 562 | 124 | R\_<CLS>\_TLSDESC\_ ADR\_PAGE21 | Page(G(GTLSDESC(S))) - Page(P)| Set an ADRP immediate field to bits [32:12] of X; check -2\ :sup:`32` <= X < 2\ :sup:`32`. |
| 565 |\-| R\_<CLS>\_TLSDESC\_ OFF\_G1 | G(GTLSDESC(S+A)) - GOT | Set a MOV[NZ] immediate field to bits [31:16] of X; check -2\ :sup:`32` <= X < 2\ :sup:`32`. |
1694
+
| 565 |\-| R\_<CLS>\_TLSDESC\_ OFF\_G1 | G(GTLSDESC(S)) - GOT| Set a MOV[NZ] immediate field to bits [31:16] of X; check -2\ :sup:`32` <= X < 2\ :sup:`32`. |
0 commit comments