Skip to content

Commit 2040f50

Browse files
lhamesLang Hames
authored andcommitted
[JITLink][i386] Improve unsupported relocation error message.
1 parent 59a73bd commit 2040f50

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/ExecutionEngine/JITLink/ELF_i386.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class ELFLinkGraphBuilder_i386 : public ELFLinkGraphBuilder<object::ELF32LE> {
114114
private:
115115
using ELFT = object::ELF32LE;
116116

117-
static Expected<i386::EdgeKind_i386> getRelocationKind(const uint32_t Type) {
117+
Expected<i386::EdgeKind_i386> getRelocationKind(const uint32_t Type) {
118118
using namespace i386;
119119
switch (Type) {
120120
case ELF::R_386_NONE:
@@ -137,8 +137,9 @@ class ELFLinkGraphBuilder_i386 : public ELFLinkGraphBuilder<object::ELF32LE> {
137137
return EdgeKind_i386::BranchPCRel32;
138138
}
139139

140-
return make_error<JITLinkError>("Unsupported i386 relocation:" +
141-
formatv("{0:d}", Type));
140+
return make_error<JITLinkError>(
141+
"In " + G->getName() + ": Unsupported i386 relocation type " +
142+
object::getELFRelocationTypeName(ELF::EM_386, Type));
142143
}
143144

144145
Error addRelocations() override {

0 commit comments

Comments
 (0)