Skip to content

Commit 3ee91c2

Browse files
committed
PIC medany: Fix parameters of load instruction
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 <[email protected]>
1 parent 6072b0d commit 3ee91c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

riscv-elf.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ This model is similar to the medium any code model, but uses the
122122
123123
# Calculate address of non-local symbol
124124
.Ltmp3: auipc a0, %got_pcrel_hi(symbol)
125-
l[w|d] a0, a0, %pcrel_lo(.Ltmp3)
125+
l[w|d] a0, %pcrel_lo(.Ltmp3)(a0)
126126
----
127127

128128
== Dynamic Linking

0 commit comments

Comments
 (0)