[PATCH] D127715: [JITLink][ELF] Log enum name of unsupported relocation type.
Sunho Kim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 15 07:26:51 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9fc0aa45e331: [JITLink][ELF] Log enum name of unsupported relocation type. (authored by sunho).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127715/new/
https://reviews.llvm.org/D127715
Files:
llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
Index: llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
+++ llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
@@ -97,17 +97,6 @@
}
} // namespace
-static const char *getELFX86_64RelocName(uint32_t Type) {
- switch (Type) {
-#define ELF_RELOC(Name, Number) \
- case Number: \
- return #Name;
-#include "llvm/BinaryFormat/ELFRelocs/x86_64.def"
-#undef ELF_RELOC
- }
- return "Unrecognized ELF/x86-64 relocation type";
-}
-
namespace llvm {
namespace jitlink {
@@ -146,9 +135,9 @@
case ELF::R_X86_64_TLSGD:
return ELF_x86_64_Edges::ELFX86RelocationKind::PCRel32TLV;
}
- return make_error<JITLinkError>("Unsupported x86-64 relocation type " +
- formatv("{0:d}: ", Type) +
- getELFX86_64RelocName(Type));
+ return make_error<JITLinkError>(
+ "Unsupported x86-64 relocation type " + formatv("{0:d}: ", Type) +
+ object::getELFRelocationTypeName(ELF::EM_X86_64, Type));
}
Error addRelocations() override {
Index: llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
+++ llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
@@ -471,8 +471,9 @@
return EdgeKind_riscv::R_RISCV_32_PCREL;
}
- return make_error<JITLinkError>("Unsupported riscv relocation:" +
- formatv("{0:d}", Type));
+ return make_error<JITLinkError>(
+ "Unsupported riscv relocation:" + formatv("{0:d}: ", Type) +
+ object::getELFRelocationTypeName(ELF::EM_RISCV, Type));
}
Error addRelocations() override {
Index: llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
+++ llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
@@ -107,8 +107,9 @@
return ELFLd64GOTLo12;
}
- return make_error<JITLinkError>("Unsupported aarch64 relocation:" +
- formatv("{0:d}", Type));
+ return make_error<JITLinkError>(
+ "Unsupported aarch64 relocation:" + formatv("{0:d}: ", Type) +
+ object::getELFRelocationTypeName(ELF::EM_AARCH64, Type));
}
Error addRelocations() override {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127715.437159.patch
Type: text/x-patch
Size: 2553 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220615/9cad972a/attachment.bin>
More information about the llvm-commits
mailing list