Skip to content

Commit 388954f

Browse files
authored
Merge pull request #185 from riscv/pcrel_lo12
Clarify that addend of R_RISCV_PCREL_LO12_[IS] must be 0
2 parents c67e860 + 007a368 commit 388954f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

riscv-elf.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ Enum | ELF Reloc Type | Description | Field | C
548548
21 | R_RISCV_TLS_GOT_HI20 | PC-relative TLS IE GOT offset | _U-Type_ | | Macro `la.tls.ie`
549549
22 | R_RISCV_TLS_GD_HI20 | PC-relative TLS GD reference | _U-Type_ | | Macro `la.tls.gd`
550550
23 | R_RISCV_PCREL_HI20 | PC-relative reference | _U-Type_ | S + A - P | `%pcrel_hi(symbol)`
551-
24 | R_RISCV_PCREL_LO12_I | PC-relative reference | _I-type_ | S + A - P | `%pcrel_lo(address of %pcrel_hi)`
552-
25 | R_RISCV_PCREL_LO12_S | PC-relative reference | _S-Type_ | S + A - P | `%pcrel_lo(address of %pcrel_hi)`
551+
24 | R_RISCV_PCREL_LO12_I | PC-relative reference | _I-type_ | S - P | `%pcrel_lo(address of %pcrel_hi)`, the addend must be 0
552+
25 | R_RISCV_PCREL_LO12_S | PC-relative reference | _S-Type_ | S - P | `%pcrel_lo(address of %pcrel_hi)`, the addend must be 0
553553
26 | R_RISCV_HI20 | Absolute address | _U-Type_ | S + A | `%hi(symbol)`
554554
27 | R_RISCV_LO12_I | Absolute address | _I-Type_ | S + A | `%lo(symbol)`
555555
28 | R_RISCV_LO12_S | Absolute address | _S-Type_ | S + A | `%lo(symbol)`

0 commit comments

Comments
 (0)