Skip to content

Commit

Permalink
Define GOT-Relative data relocation
Browse files Browse the repository at this point in the history
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”.
  • Loading branch information
PiJoules committed Oct 3, 2023
1 parent df8b80b commit a5d0b02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,9 @@ Description:: Additional information about the relocation
<| V - S - A
.2+| 40 .2+| SUB64 .2+| Static | _word64_ .2+| 64-bit label subtraction
<| V - S - A
.2+| 41-42 .2+| *Reserved* .2+| - | .2+| Reserved for future standard use
.2+| 41 .2+| GOT32_PCREL .2+| Static | _word32_ .2+| 32-bit PC relative offset to the GOT entry for a symbol
<| G + GOT + A - P
.2+| 42 .2+| *Reserved* .2+| - | .2+| Reserved for future standard use
<|
.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.
<|
Expand Down

0 comments on commit a5d0b02

Please sign in to comment.