[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:
parent
68bb2931cc
commit
3baa23b50c
|
@ -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);
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue