From 3ee91c2a0da9162cc8055f82a313d3779f7199a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCllner?= Date: Wed, 17 Jul 2024 12:20:03 +0200 Subject: [PATCH] PIC medany: Fix parameters of load instruction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The explanation of the medium position independent code model includes the instruction `l[w|d] a0, a0, %pcrel_lo(.Ltmp3)` to calculate the address of a non-local symbol. That's not the correct RISC-V syntax for a load instruction. Let's fix that. Signed-off-by: Christoph Müllner --- riscv-elf.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv-elf.adoc b/riscv-elf.adoc index f2c8da5f..292ab720 100644 --- a/riscv-elf.adoc +++ b/riscv-elf.adoc @@ -122,7 +122,7 @@ This model is similar to the medium any code model, but uses the # Calculate address of non-local symbol .Ltmp3: auipc a0, %got_pcrel_hi(symbol) - l[w|d] a0, a0, %pcrel_lo(.Ltmp3) + l[w|d] a0, %pcrel_lo(.Ltmp3)(a0) ---- == Dynamic Linking