diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2018-11-08 20:10:07 +0000 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2018-11-08 20:10:07 +0000 |
commit | e61652a38427b65206856f3ddc1cd55b42ad7dfd (patch) | |
tree | f029a7ae2b972732e7ba514f99255f8a9de70f0b /llvm/test/Transforms/FunctionImport | |
parent | d17315d89885236c1409bec0311a55f62a8ceda1 (diff) | |
download | bcm5719-llvm-e61652a38427b65206856f3ddc1cd55b42ad7dfd.tar.gz bcm5719-llvm-e61652a38427b65206856f3ddc1cd55b42ad7dfd.zip |
[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
Diffstat (limited to 'llvm/test/Transforms/FunctionImport')
-rw-r--r-- | llvm/test/Transforms/FunctionImport/funcimport_var.ll | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/Transforms/FunctionImport/funcimport_var.ll b/llvm/test/Transforms/FunctionImport/funcimport_var.ll index a93cabba69a..edd874e6297 100644 --- a/llvm/test/Transforms/FunctionImport/funcimport_var.ll +++ b/llvm/test/Transforms/FunctionImport/funcimport_var.ll @@ -4,7 +4,7 @@ ; RUN: opt -module-summary %p/Inputs/funcimport_var2.ll -o %t2.bc ; RUN: llvm-lto -thinlto -thinlto-action=thinlink -o %t3 %t.bc %t2.bc ; RUN: llvm-lto -thinlto -thinlto-action=import -thinlto-index=%t3 %t.bc %t2.bc -; RUN: llvm-lto -thinlto -thinlto-action=run %t.bc %t2.bc +; RUN: llvm-lto -thinlto -thinlto-action=run %t.bc %t2.bc -exported-symbol=_Z4LinkPKcS0_ ; RUN: llvm-nm %t.bc.thinlto.o | FileCheck %s ; RUN: llvm-lto2 run %t.bc %t2.bc -o %t.out \ ; RUN: -r %t.bc,_Z4LinkPKcS0_,plx \ |