[lto] Provide a file name for the combined LTO object.

Otherwise, we get diagnostics like:

    undefined symbol: foo in

Which isn't particularly useful.

llvm-svn: 264089
This commit is contained in:
Sean Silva 2016-03-22 20:25:32 +00:00
parent 68bb2931cc
commit 3baa23b50c
2 changed files with 16 additions and 1 deletions

View File

@ -168,7 +168,8 @@ std::unique_ptr<InputFile> SymbolTable<ELFT>::codegen(Module &M) {
TargetMachine::CGFT_ObjectFile))
fatal("failed to setup codegen");
CodeGenPasses.run(M);
LtoBuffer = MemoryBuffer::getMemBuffer(OwningLTOData, "", false);
LtoBuffer = MemoryBuffer::getMemBuffer(
OwningLTOData, "LLD-INTERNAL-combined-lto-object", false);
if (Config->SaveTemps)
saveLtoObjectFile(LtoBuffer->getBuffer());
return createObjectFile(*LtoBuffer);

View File

@ -0,0 +1,14 @@
; REQUIRES: x86
; RUN: llvm-as %s -o %t.o
; RUN: not ld.lld -m elf_x86_64 %t.o -o %t2 2>&1 | FileCheck %s
target triple = "x86_64-unknown-linux-gnu"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
declare void @foo()
define void @_start() {
call void @foo()
ret void
}
; CHECK: undefined symbol: foo in LLD-INTERNAL-combined-lto-object