Index: lld/trunk/ELF/Target.cpp =================================================================== --- lld/trunk/ELF/Target.cpp +++ lld/trunk/ELF/Target.cpp @@ -393,7 +393,7 @@ 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 @@ 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 @@ 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; } } Index: lld/trunk/test/ELF/invalid/invalid-relocation-x64.test =================================================================== --- lld/trunk/test/ELF/invalid/invalid-relocation-x64.test +++ lld/trunk/test/ELF/invalid/invalid-relocation-x64.test @@ -26,5 +26,5 @@ 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)