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. (#313)
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.
| 2025Q4 | 23\ :sup:`rd` | - In `Call and Jump relocations`_ added |
293
295
|| January 2026 | static linker requirements on veneers |
@@ -1516,6 +1518,7 @@ In addition to the terms defined in `Relocation types`_, the tables listing the
1516
1518
1517
1519
- ``TLSDESC(S+A)`` resolves to a contiguous pair of pointer-sized values, as created by ``GTLSDESC(S+A)``.
1518
1520
1521
+
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``.
1519
1522
1520
1523
General Dynamic thread-local storage model
1521
1524
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1527,15 +1530,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` |
1533
+
| 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`|
1535
+
| 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`|
1637
+
| 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 |
1639
+
| 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 |
1641
+
|\-| 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`|
1643
+
| 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`. |
1717
+
| 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`. |
1719
+
| 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`. |
1727
+
| 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