Skip to content

Commit 0396206

Browse files
authored
Merge pull request #420 from MaskRay/tlsdesc
Fix TLSDESC description
2 parents 728191d + 2ef8ae1 commit 0396206

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

riscv-elf.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,8 @@ assembler functions. The emitted relocations are in the comments.
10411041
----
10421042
label:
10431043
auipc tX, %tlsdesc_hi(symbol) // R_RISCV_TLSDESC_HI20 (symbol)
1044-
lw tY, tX, %tlsdesc_load_lo(label) // R_RISCV_TLSDESC_LOAD_LO12_I (label)
1045-
addi a0, tX, %tlsdesc_add_lo(label) // R_RISCV_TLSDESC_ADD_LO12_I (label)
1044+
lw tY, tX, %tlsdesc_load_lo(label) // R_RISCV_TLSDESC_LOAD_LO12 (label)
1045+
addi a0, tX, %tlsdesc_add_lo(label) // R_RISCV_TLSDESC_ADD_LO12 (label)
10461046
jalr t0, tY, %tlsdesc_call(label) // R_RISCV_TLSDESC_CALL (label)
10471047
----
10481048

@@ -1827,7 +1827,7 @@ Relaxation result:
18271827

18281828
==== TLS Descriptors -> Initial Exec Relaxation
18291829

1830-
Target Relocation:: R_RISCV_TLSDESC_HI20, R_RISCV_TLSDESC_LOAD_LO12_I, R_RISCV_TLSDESC_ADD_LO12_I, R_RISCV_TLSDESC_CALL
1830+
Target Relocation:: R_RISCV_TLSDESC_HI20, R_RISCV_TLSDESC_LOAD_LO12, R_RISCV_TLSDESC_ADD_LO12, R_RISCV_TLSDESC_CALL
18311831

18321832
Description:: This relaxation can relax a sequence loading the address of a thread-local symbol reference into a GOT load instruction.
18331833

@@ -1836,8 +1836,8 @@ Condition::
18361836

18371837
Relaxation::
18381838

1839-
- Instruction associated with `R_RISCV_TLSDESC_HI20` or `R_RISCV_TLSDESC_LOAD_LO12_I` can be removed.
1840-
- Instruction associated with `R_RISCV_TLSDESC_ADD_LO12_I` can be replaced with load of the high half of the symbol's GOT address.
1839+
- Instruction associated with `R_RISCV_TLSDESC_HI20` or `R_RISCV_TLSDESC_LOAD_LO12` can be removed.
1840+
- Instruction associated with `R_RISCV_TLSDESC_ADD_LO12` can be replaced with load of the high half of the symbol's GOT address.
18411841
- Instruction associated with `R_RISCV_TLSDESC_CALL` can be replaced with load of the low half of the symbol's GOT address.
18421842
Example::
18431843
+
@@ -1848,8 +1848,8 @@ Relaxation candidate (`tX` and `tY` can be any combination of two general purpos
18481848
----
18491849
label:
18501850
auipc tX, <hi> // R_RISCV_TLSDESC_HI20 (symbol), R_RISCV_RELAX
1851-
lw tY, tX, <lo> // R_RISCV_TLSDESC_LOAD_LO12_I (label), R_RISCV_RELAX
1852-
addi a0, tX, <lo> // R_RISCV_TLSDESC_ADD_LO12_I (label), R_RISCV_RELAX
1851+
lw tY, tX, <lo> // R_RISCV_TLSDESC_LOAD_LO12 (label), R_RISCV_RELAX
1852+
addi a0, tX, <lo> // R_RISCV_TLSDESC_ADD_LO12 (label), R_RISCV_RELAX
18531853
jalr t0, tY // R_RISCV_TLSDESC_CALL (label), R_RISCV_RELAX
18541854
----
18551855

@@ -1864,7 +1864,7 @@ Relaxation result:
18641864

18651865
==== TLS Descriptors -> Local Exec Relaxation
18661866

1867-
Target Relocation:: R_RISCV_TLSDESC_HI20, R_RISCV_TLSDESC_LOAD_LO12_I, R_RISCV_TLSDESC_ADD_LO12_I, R_RISCV_TLSDESC_CALL
1867+
Target Relocation:: R_RISCV_TLSDESC_HI20, R_RISCV_TLSDESC_LOAD_LO12, R_RISCV_TLSDESC_ADD_LO12, R_RISCV_TLSDESC_CALL
18681868

18691869
Description:: This relaxation can relax a sequence loading the address of a thread-local symbol reference into a thread-pointer-relative instruction sequence.
18701870

@@ -1876,8 +1876,8 @@ Condition::
18761876

18771877
Relaxation::
18781878

1879-
- Instruction associated with `R_RISCV_TLSDESC_HI20` or `R_RISCV_TLSDESC_LOAD_LO12_I` can be removed.
1880-
- Instruction associated with `R_RISCV_TLSDESC_ADD_LO12_I` can be replaced with the high TP-relative offset of symbol (long form) or be removed (short form).
1879+
- Instruction associated with `R_RISCV_TLSDESC_HI20` or `R_RISCV_TLSDESC_LOAD_LO12` can be removed.
1880+
- Instruction associated with `R_RISCV_TLSDESC_ADD_LO12` can be replaced with the high TP-relative offset of symbol (long form) or be removed (short form).
18811881
- Instruction associated with `R_RISCV_TLSDESC_CALL` can be replaced with the low TP-relative offset of symbol.
18821882

18831883
Example::
@@ -1889,8 +1889,8 @@ Relaxation candidate (`tX` and `tY` can be any combination of two general purpos
18891889
----
18901890
label:
18911891
auipc tX, <hi> // R_RISCV_TLSDESC_HI20 (symbol), R_RISCV_RELAX
1892-
lw tY, tX, <lo> // R_RISCV_TLSDESC_LOAD_LO12_I (label), R_RISCV_RELAX
1893-
addi a0, tX, <lo> // R_RISCV_TLSDESC_ADD_LO12_I (label), R_RISCV_RELAX
1892+
lw tY, tX, <lo> // R_RISCV_TLSDESC_LOAD_LO12 (label), R_RISCV_RELAX
1893+
addi a0, tX, <lo> // R_RISCV_TLSDESC_ADD_LO12 (label), R_RISCV_RELAX
18941894
jalr t0, tY // R_RISCV_TLSDESC_CALL (label), R_RISCV_RELAX
18951895
----
18961896

0 commit comments

Comments
 (0)