Skip to content

Commit

Permalink
PIC medany: Fix parameters of load instruction
Browse files Browse the repository at this point in the history
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 <christoph.muellner@vrull.eu>
  • Loading branch information
cmuellner committed Jul 17, 2024
1 parent 6072b0d commit 3ee91c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3ee91c2

Please sign in to comment.