diff options
author | Teresa Johnson <tejohnson@google.com> | 2021-02-15 09:19:50 -0800 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2021-02-17 15:28:49 -0800 |
commit | 50ac3b1d780fd385d50589641bfc91b95cd2d12f (patch) | |
tree | 69cece7e7881194ef932cea9d55525af874a4001 /llvm/tools/gold | |
parent | dab5d6c2ebcc9c9deec9febfe95d32442c2ae130 (diff) | |
download | llvm-50ac3b1d780fd385d50589641bfc91b95cd2d12f.zip llvm-50ac3b1d780fd385d50589641bfc91b95cd2d12f.tar.gz llvm-50ac3b1d780fd385d50589641bfc91b95cd2d12f.tar.bz2 |
[gold] Match lld WPD behavior for shared library symbols and add test
lld already marks shared library defs as ExportDynamic, which prevents
potentially unsafe devirtualization of symbols defined in shared
libraries. Match that behavior in the gold plugin, and add the same
test.
Depends on D96721.
Differential Revision: https://reviews.llvm.org/D96722
Diffstat (limited to 'llvm/tools/gold')
-rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index 38f9596..9870f3a 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -748,12 +748,15 @@ static void addModule(LTO &Lto, claimed_file &F, const void *View, case LDPR_RESOLVED_IR: case LDPR_RESOLVED_EXEC: - case LDPR_RESOLVED_DYN: case LDPR_PREEMPTED_IR: case LDPR_PREEMPTED_REG: case LDPR_UNDEF: break; + case LDPR_RESOLVED_DYN: + R.ExportDynamic = true; + break; + case LDPR_PREVAILING_DEF_IRONLY: R.Prevailing = !isUndefined(Sym); break; |