summaryrefslogtreecommitdiffstats
path: root/lld/ELF/SymbolTable.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-05-02 14:05:20 +0000
committerFangrui Song <maskray@google.com>2019-05-02 14:05:20 +0000
commit0178cff279ade2761f9b6e3504cbd34d3f73aae5 (patch)
tree9bd913b89ad6cf5ddcd3d5fe449d54946cc06898 /lld/ELF/SymbolTable.cpp
parent8d8c7e9e75ac3e9000e1ae530dd491b3f6b0fe35 (diff)
downloadbcm5719-llvm-0178cff279ade2761f9b6e3504cbd34d3f73aae5.tar.gz
bcm5719-llvm-0178cff279ade2761f9b6e3504cbd34d3f73aae5.zip
[ELF] --plugin-opt=thinlto-index-only: create empty index files even if all bitcode files are lazy
Summary: The gold plugin behavior (creating empty index files for lazy bitcode files) was added in D46034, but it missed the case when there is no non-lazy bitcode files, e.g. ld.lld -shared crti.o crtbeginS.o --start-lib bitcode.o --end-lib ... crti.o crtbeginS.o are not bitcode, but our distributed build system wants bitcode.o.thinlto.bc to confirm all expected outputs are created based on all of the modules provided to the linker. Differential Revision: https://reviews.llvm.org/D61420 llvm-svn: 359788
Diffstat (limited to 'lld/ELF/SymbolTable.cpp')
-rw-r--r--lld/ELF/SymbolTable.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index 2a511a26674..1b017b07f58 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -115,8 +115,11 @@ template <class ELFT> void SymbolTable::addFile(InputFile *File) {
// Because all bitcode files that the program consists of are passed
// to the compiler at once, it can do whole-program optimization.
template <class ELFT> void SymbolTable::addCombinedLTOObject() {
- if (BitcodeFiles.empty())
+ if (BitcodeFiles.empty()) {
+ if (Config->ThinLTOIndexOnly)
+ thinLTOCreateEmptyIndexFiles();
return;
+ }
// Compile bitcode files and replace bitcode symbols.
LTO.reset(new BitcodeCompiler);
OpenPOWER on IntegriCloud