[compiler-rt] r348315 - [asan] Remove use_odr_indicator runtime flag

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 15:17:32 PST 2018


Author: vitalybuka
Date: Tue Dec  4 15:17:32 2018
New Revision: 348315

URL: http://llvm.org/viewvc/llvm-project?rev=348315&view=rev
Log:
[asan] Remove use_odr_indicator runtime flag

Summary:
Flag was added for testing 3 years ago. Probably it's time
to simplify code and usage by removing it.

Reviewers: eugenis, m.ostapenko

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

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

Modified:
    compiler-rt/trunk/lib/asan/asan_flags.inc
    compiler-rt/trunk/lib/asan/asan_globals.cc
    compiler-rt/trunk/test/asan/TestCases/Darwin/odr-lto.cc
    compiler-rt/trunk/test/asan/TestCases/Linux/local_alias.cc
    compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc

Modified: compiler-rt/trunk/lib/asan/asan_flags.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_flags.inc?rev=348315&r1=348314&r2=348315&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_flags.inc (original)
+++ compiler-rt/trunk/lib/asan/asan_flags.inc Tue Dec  4 15:17:32 2018
@@ -152,8 +152,6 @@ ASAN_FLAG(const char *, suppressions, ""
 ASAN_FLAG(bool, halt_on_error, true,
           "Crash the program after printing the first error report "
           "(WARNING: USE AT YOUR OWN RISK!)")
-ASAN_FLAG(bool, use_odr_indicator, false,
-          "Use special ODR indicator symbol for ODR violation detection")
 ASAN_FLAG(bool, allocator_frees_and_returns_null_on_realloc_zero, true,
           "realloc(p, 0) is equivalent to free(p) by default (Same as the "
           "POSIX standard). If set to false, realloc(p, 0) will return a "

Modified: compiler-rt/trunk/lib/asan/asan_globals.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_globals.cc?rev=348315&r1=348314&r2=348315&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_globals.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_globals.cc Tue Dec  4 15:17:32 2018
@@ -183,9 +183,7 @@ static void CheckODRViolationViaPoisonin
 // This routine chooses between two different methods of ODR violation
 // detection.
 static inline bool UseODRIndicator(const Global *g) {
-  // Use ODR indicator method iff use_odr_indicator flag is set and
-  // indicator symbol address is not 0.
-  return flags()->use_odr_indicator && g->odr_indicator > 0;
+  return g->odr_indicator > 0;
 }
 
 // Register a global variable.

Modified: compiler-rt/trunk/test/asan/TestCases/Darwin/odr-lto.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Darwin/odr-lto.cc?rev=348315&r1=348314&r2=348315&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Darwin/odr-lto.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Darwin/odr-lto.cc Tue Dec  4 15:17:32 2018
@@ -1,4 +1,4 @@
-// Check that -asan-use-private-alias and use_odr_indicator=1 silence the false
+// Check that -asan-use-private-alias silence the false
 // positive ODR violation on Darwin with LTO.
 
 // REQUIRES: lto
@@ -6,7 +6,7 @@
 // RUN: %clangxx_asan -DPART=0 -c %s -o %t-1.o -flto -mllvm -asan-use-private-alias
 // RUN: %clangxx_asan -DPART=1 -c %s -o %t-2.o -flto -mllvm -asan-use-private-alias
 // RUN: %clangxx_asan %t-1.o %t-2.o -o %t -flto
-// RUN: %env_asan_opts=use_odr_indicator=1 %run %t 2>&1 | FileCheck %s
+// RUN: %run %t 2>&1 | FileCheck %s
 
 #include <stdio.h>
 #include <stdlib.h>

Modified: compiler-rt/trunk/test/asan/TestCases/Linux/local_alias.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/local_alias.cc?rev=348315&r1=348314&r2=348315&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/local_alias.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/local_alias.cc Tue Dec  4 15:17:32 2018
@@ -11,7 +11,7 @@
 // RUN: %clangxx -DBUILD_UNINSTRUMENTED_DSO=1 -fPIC -shared %s -o %t-UNINSTRUMENTED-SO.so
 // RUN: %clangxx %s -c -mllvm -asan-use-private-alias -o %t.o
 // RUN: %clangxx_asan %t.o %t-UNINSTRUMENTED-SO.so %t-INSTRUMENTED-SO.so -o %t-EXE
-// RUN: %env_asan_opts=use_odr_indicator=true %run %t-EXE
+// RUN: %run %t-EXE
 
 #if defined (BUILD_INSTRUMENTED_DSO)
 long h = 15;

Modified: compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc?rev=348315&r1=348314&r2=348315&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc Tue Dec  4 15:17:32 2018
@@ -26,9 +26,7 @@
 // Use private aliases for global variables: use indicator symbol to detect ODR violation.
 // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %t-ODR-SO.so -DSZ=100
 // RUN: %clangxx_asan -mllvm -asan-use-private-alias %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE
-// RUN: %env_asan_opts=fast_unwind_on_malloc=0                              %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
-// RUN: %env_asan_opts=fast_unwind_on_malloc=0:use_odr_indicator=false      %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
-// RUN: %env_asan_opts=fast_unwind_on_malloc=0:use_odr_indicator=true   not %run %t-ODR-EXE 2>&1 | FileCheck %s
+// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s
 
 // GNU driver doesn't handle .so files properly.
 // REQUIRES: Clang




More information about the llvm-commits mailing list