summaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ELF.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/ELF.cpp')
-rw-r--r--llvm/lib/Object/ELF.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Object/ELF.cpp b/llvm/lib/Object/ELF.cpp
index 354c51d66419..35b5e0faf900 100644
--- a/llvm/lib/Object/ELF.cpp
+++ b/llvm/lib/Object/ELF.cpp
@@ -191,6 +191,19 @@ StringRef llvm::object::getELFRelocationTypeName(uint32_t Machine,
#undef ELF_RELOC
+StringRef llvm::object::getRISCVVendorRelocationTypeName(uint32_t Type,
+ StringRef Vendor) {
+#define ELF_RISCV_NONSTANDARD_RELOC(vendor, name, number) \
+ if (Vendor == #vendor && Type == number) \
+ return #name;
+
+#include "llvm/BinaryFormat/ELFRelocs/RISCV_nonstandard.def"
+
+#undef ELF_RISCV_NONSTANDARD_RELOC
+
+ return "Unknown";
+}
+
uint32_t llvm::object::getELFRelativeRelocationType(uint32_t Machine) {
switch (Machine) {
case ELF::EM_X86_64: