File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
llvm/lib/ExecutionEngine/JITLink Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,17 @@ static Error optimizeELF_x86_64_GOTAndStubs(LinkGraph &G) {
221221 return Error::success ();
222222}
223223
224+ static const char *getELFX86_64RelocName (uint32_t Type) {
225+ switch (Type) {
226+ #define ELF_RELOC (Name, Number ) \
227+ case Number: \
228+ return #Name;
229+ #include " llvm/BinaryFormat/ELFRelocs/x86_64.def"
230+ #undef ELF_RELOC
231+ }
232+ return " Unrecognized ELF/x86-64 relocation type" ;
233+ }
234+
224235namespace llvm {
225236namespace jitlink {
226237
@@ -252,8 +263,9 @@ class ELFLinkGraphBuilder_x86_64 : public ELFLinkGraphBuilder<object::ELF64LE> {
252263 case ELF::R_X86_64_PLT32:
253264 return ELF_x86_64_Edges::ELFX86RelocationKind::Branch32;
254265 }
255- return make_error<JITLinkError>(" Unsupported x86-64 relocation:" +
256- formatv (" {0:d}" , Type));
266+ return make_error<JITLinkError>(" Unsupported x86-64 relocation type " +
267+ formatv (" {0:d}: " , Type) +
268+ getELFX86_64RelocName (Type));
257269 }
258270
259271 Error addRelocations () override {
You can’t perform that action at this time.
0 commit comments