From d49e48097bcad410e7e6d96ebf9d94d6d41dc9c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lui=CC=81s=20Marques?= Date: Sat, 12 Aug 2023 11:35:14 +0100 Subject: [PATCH] Add GP-relative relocations --- riscv-elf.adoc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/riscv-elf.adoc b/riscv-elf.adoc index 0839c108..f3a7872f 100644 --- a/riscv-elf.adoc +++ b/riscv-elf.adoc @@ -428,7 +428,13 @@ Description:: Additional information about the relocation <| S + A - P .2+| 46 .2+| RVC_LUI .2+| Static | _CI-Type_ .2+| High 6 bits of 18-bit absolute address <| S + A -.2+| 47-50 .2+| *Reserved* .2+| - | .2+| Reserved for future standard use +.2+| 47 .2+| GPREL_LO12_I .2+| Static | _I-type_ .2+| Low 12 bits of a 32-bit GP-relative address, `%gprel_lo(symbol)` + <| S + A - GP +.2+| 48 .2+| GPREL_LO12_S .2+| Static | _S-Type_ .2+| Low 12 bits of a 32-bit GP-relative address, `%gprel_lo(symbol)` + <| S + A - GP +.2+| 49 .2+| GPREL_HI20 .2+| Static | _U-Type_ .2+| High 20 bits of a 32-bit GP-relative address, `%gprel_hi(symbol)` + <| S + A - GP +.2+| 50 .2+| *Reserved* .2+| - | .2+| Reserved for future standard use <| .2+| 51 .2+| RELAX .2+| Static | .2+| Instruction can be relaxed, paired with a normal relocation at the same address <|