Skip to content

Remove further reference to R_RISCV_GPREL_[IS] #205

@jrtc27

Description

@jrtc27

We currently still say the following:

GP-Relative Relocations: If symbol is 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, a R_RISCV_GPREL_I or
R_RISCV_GPREL_S.

The instruction is an I-Type instruction (add immediate or load) with an
R_RISCV_GPREL_I or an S-type instruction (store) with an R_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 into gp (aka
x3). This can be used by linker relaxation to delete the lui instruction.

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions