-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define GOT-Relative data relocation #402
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A question that naturally raises would be whether or not we want a 64-bit variant of this relocation, but I guess we don't need it at this moment because even the usual GOT_HI20
and LO12_I
combination can't address the entire 64-bit address space.
What is the assembly syntax for this new relocation?
1fd079c
to
a5d0b02
Compare
I think the formatting should be fixed now |
s/PC relative/PC-relative/ for the sake of consistency. Other than that, LGTM |
LGTM, but just require a PoC implementation either LD.BFD or LLD as convention :) |
a5d0b02
to
7be7bc0
Compare
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”.
7be7bc0
to
1dff30a
Compare
We got LGTM from two linker experts, also PoC for lld llvm/llvm-project#72587 c.c. @Nelson1225 just remind you there are new relocation added. |
This is the followup implementation to riscv-non-isa/riscv-elf-psabi-doc#402 that supports this relocation in llvm and lld.
This is the followup implementation to riscv-non-isa/riscv-elf-psabi-doc#402 that supports this relocation in llvm and lld.
This is the followup implementation to riscv-non-isa/riscv-elf-psabi-doc#402 that supports this relocation in llvm and lld.
This introduces a new relocation
R_RISCV_GOT32_PCREL
that 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”.See #399 (comment) for a code example.