summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/RelocationResolver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/RelocationResolver.cpp')
-rw-r--r--llvm/lib/Object/RelocationResolver.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Object/RelocationResolver.cpp b/llvm/lib/Object/RelocationResolver.cpp
index 97c69677f58..5a1052ffcde 100644
--- a/llvm/lib/Object/RelocationResolver.cpp
+++ b/llvm/lib/Object/RelocationResolver.cpp
@@ -336,6 +336,7 @@ static bool supportsRISCV(uint64_t Type) {
switch (Type) {
case ELF::R_RISCV_NONE:
case ELF::R_RISCV_32:
+ case ELF::R_RISCV_32_PCREL:
case ELF::R_RISCV_64:
case ELF::R_RISCV_SET6:
case ELF::R_RISCV_SUB6:
@@ -360,6 +361,8 @@ static uint64_t resolveRISCV(RelocationRef R, uint64_t S, uint64_t A) {
return A;
case ELF::R_RISCV_32:
return (S + RA) & 0xFFFFFFFF;
+ case ELF::R_RISCV_32_PCREL:
+ return (S + RA - R.getOffset()) & 0xFFFFFFFF;
case ELF::R_RISCV_64:
return S + RA;
case ELF::R_RISCV_SET6:
OpenPOWER on IntegriCloud