Skip to content

Commit 7be7bc0

Browse files
committed
Define GOT-Relative data relocation
This introduces a new relocation `R_RISCV_GOT32_PCREL` follows the existing wording to “R_RISCV_32_PCREL”, but instead evaluates to the 32-bit offset between a GOT entry for a given symbol and the current location where the relocation is applied, so its equation would be “G + GOT - P + A”.
1 parent df8b80b commit 7be7bc0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

riscv-elf.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,9 @@ Description:: Additional information about the relocation
420420
<| V - S - A
421421
.2+| 40 .2+| SUB64 .2+| Static | _word64_ .2+| 64-bit label subtraction
422422
<| V - S - A
423-
.2+| 41-42 .2+| *Reserved* .2+| - | .2+| Reserved for future standard use
423+
.2+| 41 .2+| GOT32_PCREL .2+| Static | _word32_ .2+| 32-bit PC-relative offset to the GOT entry for a symbol
424+
<| G + GOT + A - P
425+
.2+| 42 .2+| *Reserved* .2+| - | .2+| Reserved for future standard use
424426
<|
425427
.2+| 43 .2+| ALIGN .2+| Static | .2+| Alignment statement. The addend indicates the number of bytes occupied by `nop` instructions at the relocation offset. The alignment boundary is specified by the addend rounded up to the next power of two.
426428
<|

0 commit comments

Comments
 (0)