diff options
Diffstat (limited to 'include/llvm/Object/RelocVisitor.h')
-rw-r--r-- | include/llvm/Object/RelocVisitor.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/Object/RelocVisitor.h b/include/llvm/Object/RelocVisitor.h index 2e1d43e26a..225b83eff3 100644 --- a/include/llvm/Object/RelocVisitor.h +++ b/include/llvm/Object/RelocVisitor.h @@ -103,6 +103,16 @@ public: HasError = true; return RelocToApply(); } + } else if (FileFormat == "ELF64-mips") { + switch (RelocType) { + case llvm::ELF::R_MIPS_32: + return visitELF_MIPS_32(R, Value); + case llvm::ELF::R_MIPS_64: + return visitELF_MIPS_64(R, Value); + default: + HasError = true; + return RelocToApply(); + } } else if (FileFormat == "ELF64-aarch64") { switch (RelocType) { case llvm::ELF::R_AARCH64_ABS32: @@ -260,6 +270,13 @@ private: return RelocToApply(Res, 4); } + RelocToApply visitELF_MIPS_64(RelocationRef R, uint64_t Value) { + int64_t Addend; + getELFRelocationAddend(R, Addend); + uint64_t Res = (Value + Addend); + return RelocToApply(Res, 8); + } + // AArch64 ELF RelocToApply visitELF_AARCH64_ABS32(RelocationRef R, uint64_t Value) { int64_t Addend = getAddend64LE(R); |