[PATCH] D55899: [asan] Undo special treatment of linkonce_odr and weak_odr

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 13:00:08 PST 2018


vitalybuka created this revision.
vitalybuka added a reviewer: pcc.
Herald added a subscriber: hiraditya.

On non-Windows these are already removed by ShouldInstrumentGlobal.
On Window we will wait until we get actual issues with that.


Repository:
  rL LLVM

https://reviews.llvm.org/D55899

Files:
  llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp


Index: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -2201,10 +2201,8 @@
           GlobalAlias::create(GlobalValue::PrivateLinkage, "", NewGlobal);
     }
 
-    // ODR check is not useful for the following, but we see false reports
-    // caused by linker optimizations.
-    if (NewGlobal->hasLocalLinkage() || NewGlobal->hasLinkOnceODRLinkage() ||
-        NewGlobal->hasWeakODRLinkage()) {
+    // ODR should not happen for local linkage.
+    if (NewGlobal->hasLocalLinkage()) {
       ODRIndicator = ConstantExpr::getIntToPtr(ConstantInt::get(IntptrTy, -1),
                                                IRB.getInt8PtrTy());
     } else if (UseOdrIndicator) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55899.178947.patch
Type: text/x-patch
Size: 874 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181219/07d78df5/attachment.bin>


More information about the llvm-commits mailing list