Skip to content

Commit

Permalink
Avoid implying code and literal to be adjacent.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuan-Lin Chen committed Apr 22, 2024
1 parent af3126c commit 5396750
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ is appeneded in .text section or put into .rodata section.
# Literal pool
.LCPI0:
.8byte symbol
...
.Ltmp0: auipc a0, %pcrel_hi(.LCPI0)
ld a0, %pcrel_lo(.Ltmp0)(a0)
----
Expand All @@ -161,6 +162,7 @@ function call can reach the whole 64-bit address space.
# Literal pool
.LCPI1:
.8byte function
...
.Ltmp1: auipc a0, %pcrel_hi(.LCPI1)
ld a0, %pcrel_lo(.Ltmp1)(a0)
jalr a0
Expand Down

0 comments on commit 5396750

Please sign in to comment.