Skip to content

Commit 1fd079c

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 1fd079c

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
@@ -467,8 +467,10 @@ Description:: Additional information about the relocation
467467
.2+| 64 .2+| TLSDESC_ADD_LO12 .2+| Static | _I-Type_ .2+| Low 12 bits of a 32-bit PC-relative offset into a TLS descriptor entry, `%tlsdesc_add_lo(address of %tlsdesc_hi)`, the addend must be 0
468468
<| S - P
469469
.2+| 65 .2+| TLSDESC_CALL .2+| Static | .2+| Annotate call to TLS descriptor resolver function, `%tlsdesc_call(address of %tlsdesc_hi)`, for relaxation purposes only
470+
.2+| 66 .2+| 32_PCREL .2+| Static | _word32_ .2+| 32-bit PC relative offset to the GOT entry for a symbol
471+
<| G + GOT - P + A
470472
<|
471-
.2+| 66-191 .2+| *Reserved* .2+| - | .2+| Reserved for future standard use
473+
.2+| 67-191 .2+| *Reserved* .2+| - | .2+| Reserved for future standard use
472474
<|
473475
.2+| 192-255 .2+| *Reserved* .2+| - | .2+| Reserved for nonstandard ABI extensions
474476
<|

0 commit comments

Comments
 (0)