[llvm] r354410 - [lld-link] preserve @llvm.used symbols in LTO

Bob Haarman via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 19 16:26:01 PST 2019


Author: inglorion
Date: Tue Feb 19 16:26:01 2019
New Revision: 354410

URL: http://llvm.org/viewvc/llvm-project?rev=354410&view=rev
Log:
[lld-link] preserve @llvm.used symbols in LTO

Summary:
We translate @llvm.used to COFF by generating /include directives
in the .drectve section. However, in LTO links, this happens after
directives have already been processed, so the new directives do
not take effect. This change marks @llvm.used symbols as GCRoots
so that they are preserved as intended.

Fixes PR40733.

Reviewers: rnk, pcc, ruiu

Reviewed By: ruiu

Subscribers: mehdi_amini, steven_wu, dexonsmith, dang, llvm-commits

Tags: #llvm

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

Modified:
    llvm/trunk/include/llvm/LTO/LTO.h

Modified: llvm/trunk/include/llvm/LTO/LTO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/LTO.h?rev=354410&r1=354409&r2=354410&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LTO/LTO.h (original)
+++ llvm/trunk/include/llvm/LTO/LTO.h Tue Feb 19 16:26:01 2019
@@ -139,6 +139,7 @@ public:
     using irsymtab::Symbol::getCOFFWeakExternalFallback;
     using irsymtab::Symbol::getSectionName;
     using irsymtab::Symbol::isExecutable;
+    using irsymtab::Symbol::isUsed;
   };
 
   /// A range over the symbols in this InputFile.




More information about the llvm-commits mailing list