diff options
author | Vitaly Buka <vitalybuka@google.com> | 2018-12-04 23:17:32 +0000 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2018-12-04 23:17:32 +0000 |
commit | 10db3f47799c11298953ab54d34d9b2c8d68e7c3 (patch) | |
tree | e2f527ae50a2d57fedb167883df4a38536d1c5aa | |
parent | 5945222fc646ec621992ed59d32dda3973f7c367 (diff) | |
download | bcm5719-llvm-10db3f47799c11298953ab54d34d9b2c8d68e7c3.tar.gz bcm5719-llvm-10db3f47799c11298953ab54d34d9b2c8d68e7c3.zip |
[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
llvm-svn: 348315
-rw-r--r-- | compiler-rt/lib/asan/asan_flags.inc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/asan/asan_globals.cc | 4 | ||||
-rw-r--r-- | compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc | 4 | ||||
-rw-r--r-- | compiler-rt/test/asan/TestCases/Linux/local_alias.cc | 2 | ||||
-rw-r--r-- | compiler-rt/test/asan/TestCases/Linux/odr-violation.cc | 4 |
5 files changed, 5 insertions, 11 deletions
diff --git a/compiler-rt/lib/asan/asan_flags.inc b/compiler-rt/lib/asan/asan_flags.inc index 4af94c56fca..a9c97d53b31 100644 --- a/compiler-rt/lib/asan/asan_flags.inc +++ b/compiler-rt/lib/asan/asan_flags.inc @@ -152,8 +152,6 @@ ASAN_FLAG(const char *, suppressions, "", "Suppressions file name.") 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 " diff --git a/compiler-rt/lib/asan/asan_globals.cc b/compiler-rt/lib/asan/asan_globals.cc index 898f7f40d31..febbdb5af35 100644 --- a/compiler-rt/lib/asan/asan_globals.cc +++ b/compiler-rt/lib/asan/asan_globals.cc @@ -183,9 +183,7 @@ static void CheckODRViolationViaPoisoning(const Global *g) { // 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. diff --git a/compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc b/compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc index 56dd89b164c..e1e454be077 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc +++ b/compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc @@ -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> diff --git a/compiler-rt/test/asan/TestCases/Linux/local_alias.cc b/compiler-rt/test/asan/TestCases/Linux/local_alias.cc index 266d3fe6bc8..635e30b8794 100644 --- a/compiler-rt/test/asan/TestCases/Linux/local_alias.cc +++ b/compiler-rt/test/asan/TestCases/Linux/local_alias.cc @@ -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; diff --git a/compiler-rt/test/asan/TestCases/Linux/odr-violation.cc b/compiler-rt/test/asan/TestCases/Linux/odr-violation.cc index 70437a8321b..30b0f9d8a50 100644 --- a/compiler-rt/test/asan/TestCases/Linux/odr-violation.cc +++ b/compiler-rt/test/asan/TestCases/Linux/odr-violation.cc @@ -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 |