[ELF] --plugin-opt=thinlto-index-only: create empty index files even if all…

Authored by MaskRay on May 2 2019, 7:05 AM.


[ELF] --plugin-opt=thinlto-index-only: create empty index files even if all bitcode files are lazy

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