diff options
Diffstat (limited to 'lld/ELF/LTO.cpp')
| -rw-r--r-- | lld/ELF/LTO.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index 63fb6e3a3a5..b1d5d60b878 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -78,6 +78,10 @@ void BitcodeCompiler::add(BitcodeFile &F) { ArrayRef<SymbolBody *> Bodies = F.getSymbols(); Module &M = Obj->getModule(); + + // If a symbol appears in @llvm.used, the linker is required + // to treat the symbol as there is a reference to the symbol + // that it cannot see. Therefore, we can't internalize. SmallPtrSet<GlobalValue *, 8> Used; collectUsedGlobalVariables(M, Used, /* CompilerUsed */ false); |

