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.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Object/RelocationResolver.cpp b/llvm/lib/Object/RelocationResolver.cpp
index 0a243f32e12..8738e2e9f3b 100644
--- a/llvm/lib/Object/RelocationResolver.cpp
+++ b/llvm/lib/Object/RelocationResolver.cpp
@@ -335,6 +335,8 @@ static bool supportsRISCV(uint64_t Type) {
case ELF::R_RISCV_NONE:
case ELF::R_RISCV_32:
case ELF::R_RISCV_64:
+ case ELF::R_RISCV_SET6:
+ case ELF::R_RISCV_SUB6:
case ELF::R_RISCV_ADD8:
case ELF::R_RISCV_SUB8:
case ELF::R_RISCV_ADD16:
@@ -358,6 +360,10 @@ static uint64_t resolveRISCV(RelocationRef R, uint64_t S, uint64_t A) {
return (S + RA) & 0xFFFFFFFF;
case ELF::R_RISCV_64:
return S + RA;
+ case ELF::R_RISCV_SET6:
+ return (A + (S + RA)) & 0xFF;
+ case ELF::R_RISCV_SUB6:
+ return (A - (S + RA)) & 0xFF;
case ELF::R_RISCV_ADD8:
return (A + (S + RA)) & 0xFF;
case ELF::R_RISCV_SUB8:
OpenPOWER on IntegriCloud