[lld] r293640 - [ELF] - Report filename for unknown relocation error.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 31 07:37:52 PST 2017
Author: grimar
Date: Tue Jan 31 09:37:51 2017
New Revision: 293640
URL: http://llvm.org/viewvc/llvm-project?rev=293640&view=rev
Log:
[ELF] - Report filename for unknown relocation error.
Our reporting for that case was just like:
ld.lld: error: do not know how to handle relocation 'R_386_PC8' (23)
It did not give any information about error location.
Patch adds filename to error.
Differential revision: https://reviews.llvm.org/D29282
Modified:
lld/trunk/ELF/Target.cpp
lld/trunk/test/ELF/invalid/invalid-relocation-x64.test
Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=293640&r1=293639&r2=293640&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Tue Jan 31 09:37:51 2017
@@ -393,7 +393,7 @@ RelExpr X86TargetInfo::getRelExpr(uint32
case R_386_NONE:
return R_HINT;
default:
- error("unknown relocation type: " + toString(Type));
+ error(toString(S.File) + ": unknown relocation type: " + toString(Type));
return R_HINT;
}
}
@@ -674,7 +674,7 @@ RelExpr X86_64TargetInfo<ELFT>::getRelEx
case R_X86_64_NONE:
return R_HINT;
default:
- error("unknown relocation type: " + toString(Type));
+ error(toString(S.File) + ": unknown relocation type: " + toString(Type));
return R_HINT;
}
}
@@ -1627,7 +1627,7 @@ RelExpr AMDGPUTargetInfo::getRelExpr(uin
case R_AMDGPU_GOTPCREL32_HI:
return R_GOT_PC;
default:
- error("unknown relocation type: " + toString(Type));
+ error(toString(S.File) + ": unknown relocation type: " + toString(Type));
return R_HINT;
}
}
Modified: lld/trunk/test/ELF/invalid/invalid-relocation-x64.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/invalid/invalid-relocation-x64.test?rev=293640&r1=293639&r2=293640&view=diff
==============================================================================
--- lld/trunk/test/ELF/invalid/invalid-relocation-x64.test (original)
+++ lld/trunk/test/ELF/invalid/invalid-relocation-x64.test Tue Jan 31 09:37:51 2017
@@ -26,5 +26,5 @@ Sections:
Type: R_X86_64_NONE
# RUN: not ld.lld %p/Inputs/invalid-relocation-x64.elf -o %t2 2>&1 | FileCheck %s
-# CHECK: unknown relocation type: Unknown (152)
-# CHECK: unknown relocation type: Unknown (153)
+# CHECK: {{.*}}invalid-relocation-x64.elf: unknown relocation type: Unknown (152)
+# CHECK: {{.*}}invalid-relocation-x64.elf: unknown relocation type: Unknown (153)
More information about the llvm-commits
mailing list