llvm-project/llvm/lib/LTO
Pirama Arumuga Nainar e61652a384 [LTO] Drop non-prevailing definitions only if linkage is not local or appending
Summary:
This fixes PR 37422

In ELF, non-weak symbols can also be non-prevailing.  In this particular
PR, the __llvm_profile_* symbols are non-prevailing but weren't getting
dropped - causing multiply-defined errors with lld.

Also add a test, strong_non_prevailing.ll, to ensure that multiple
copies of a strong symbol are dropped.

To fix the test regressions exposed by this fix,
- do not mark prevailing copies for symbols with 'appending' linkage.
There's no one prevailing copy for such symbols.
- fix the prevailing version in dead-strip-fulllto.ll
- explicitly pass exported symbols to llvm-lto in fumcimport.ll and
funcimport_var.ll

Reviewers: tejohnson, pcc

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith,
dang, srhines, llvm-commits

Differential Revision: https://reviews.llvm.org/D54125

llvm-svn: 346436
2018-11-08 20:10:07 +00:00
..
CMakeLists.txt Support: Add a VCSRevision.h header file. 2017-04-13 01:26:12 +00:00
Caching.cpp [ThinLTO] Update ThinLTO cache file atimes when on Windows 2018-07-04 14:17:10 +00:00
LLVMBuild.txt NFC: Move ObjectMemoryBuffer to support 2018-04-15 05:17:14 +00:00
LTO.cpp [LTO] Drop non-prevailing definitions only if linkage is not local or appending 2018-11-08 20:10:07 +00:00
LTOBackend.cpp [LTO] Drop non-prevailing definitions only if linkage is not local or appending 2018-11-08 20:10:07 +00:00
LTOCodeGenerator.cpp [PassTiming] cleaning up legacy PassTimingInfo interface. NFCI. 2018-09-26 13:01:43 +00:00
LTOModule.cpp Move TargetLoweringObjectFile from CodeGen to Target to fix layering 2018-03-23 23:58:19 +00:00
ThinLTOCodeGenerator.cpp [LTO] Drop non-prevailing definitions only if linkage is not local or appending 2018-11-08 20:10:07 +00:00
UpdateCompilerUsed.cpp [LTO] Account for overriding lib calls via the alias attribute 2018-10-10 22:54:31 +00:00