diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-01-18 05:38:43 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-01-18 05:38:43 +0000 |
commit | f3275a04adc6f7c5f8ac63b215a77ec4925fdbbe (patch) | |
tree | 93fe8261e89135fe257fbed4f0f10a2b1670ec69 /lib/LTO/LTO.cpp | |
parent | 2871d3aefed0b0413008f47f087f4280767eb42c (diff) |
Don't drop dso_local in LTO.
LTO sets dso_local as an optimization, so don't clear it.
This avoid clearing it from undefined hidden symbols, which would then
fail the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/LTO/LTO.cpp')
-rw-r--r-- | lib/LTO/LTO.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp index 64e5186255b..a36d640ba9e 100644 --- a/lib/LTO/LTO.cpp +++ b/lib/LTO/LTO.cpp @@ -639,7 +639,8 @@ LTO::addRegularLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms, } // Set the 'local' flag based on the linker resolution for this symbol. - GV->setDSOLocal(Res.FinalDefinitionInLinkageUnit); + if (Res.FinalDefinitionInLinkageUnit) + GV->setDSOLocal(Res.FinalDefinitionInLinkageUnit); } // Common resolution: collect the maximum size/alignment over all commons. // We also record if we see an instance of a common as prevailing, so that |