[lld] r264089 - [lto] Provide a file name for the combined LTO object.
Sean Silva via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 22 13:25:32 PDT 2016
Author: silvas
Date: Tue Mar 22 15:25:32 2016
New Revision: 264089
URL: http://llvm.org/viewvc/llvm-project?rev=264089&view=rev
Log:
[lto] Provide a file name for the combined LTO object.
Otherwise, we get diagnostics like:
undefined symbol: foo in
Which isn't particularly useful.
Added:
lld/trunk/test/ELF/lto/combined-lto-object-name.ll
Modified:
lld/trunk/ELF/SymbolTable.cpp
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=264089&r1=264088&r2=264089&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Tue Mar 22 15:25:32 2016
@@ -168,7 +168,8 @@ std::unique_ptr<InputFile> SymbolTable<E
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);
Added: lld/trunk/test/ELF/lto/combined-lto-object-name.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/combined-lto-object-name.ll?rev=264089&view=auto
==============================================================================
--- lld/trunk/test/ELF/lto/combined-lto-object-name.ll (added)
+++ lld/trunk/test/ELF/lto/combined-lto-object-name.ll Tue Mar 22 15:25:32 2016
@@ -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
More information about the llvm-commits
mailing list