-
Notifications
You must be signed in to change notification settings - Fork 183
Description
We currently still say the following:
GP-Relative Relocations: If
symbolis within the range of a signed 12-bit
immediate offset from__global_pointer$, then the address can be loaded with a
single instruction which has one relocation, aR_RISCV_GPREL_Ior
R_RISCV_GPREL_S.The instruction is an I-Type instruction (add immediate or load) with an
R_RISCV_GPREL_Ior an S-type instruction (store) with anR_RISCV_GPREL_S
relocation. The following assembly show loading a gp-relative address:addi a0, gp, 0 # R_RISCV_GPREL_I (symbol)This relies on the value of
__global_pointer$being loaded intogp(aka
x3). This can be used by linker relaxation to delete theluiinstruction.
There was never any assembly syntax for that and the relocations have since been removed due to being internal binutils relocations. We should remove this section.