From af7fa557d33098397b4d2ac080d048cac8094bff Mon Sep 17 00:00:00 2001 From: Tatsuyuki Ishi Date: Wed, 13 Sep 2023 23:36:39 +0900 Subject: [PATCH] Fix TLSDESC -> Initial Exec example. We need a PC-relative load here, hence auipc not lui. --- riscv-elf.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/riscv-elf.adoc b/riscv-elf.adoc index 9d312fa0..16214b94 100644 --- a/riscv-elf.adoc +++ b/riscv-elf.adoc @@ -1684,8 +1684,8 @@ Condition:: Relaxation:: - Instruction associated with `R_RISCV_TLSDESC_HI20` or `R_RISCV_TLSDESC_LOAD_LO12_I` can be removed. -- Instruction associated with `R_RISCV_TLSDESC_ADD_LO12_I` can be replaced with load of the high PC-relative offset of the symbol's GOT entry. -- Instruction associated with `R_RISCV_TLSDESC_CALL` can be replaced with load of the low PC-relative offset of the symbol's GOT entry. +- Instruction associated with `R_RISCV_TLSDESC_ADD_LO12_I` can be replaced with load of the high half of the symbol's GOT address. +- Instruction associated with `R_RISCV_TLSDESC_CALL` can be replaced with load of the low half of the symbol's GOT address. Example:: + -- @@ -1704,7 +1704,7 @@ Relaxation result: [,asm] ---- - lui a0, + auipc a0, {ld,lw} a0, (a0) ---- --