[PATCH] D55254: [asan] Remove use_odr_indicator runtime flag

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 15:20:50 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT348315: [asan] Remove use_odr_indicator runtime flag (authored by vitalybuka, committed by ).
Herald added a subscriber: Sanitizers.

Changed prior to commit:
  https://reviews.llvm.org/D55254?vs=176555&id=176720#toc

Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55254/new/

https://reviews.llvm.org/D55254

Files:
  lib/asan/asan_flags.inc
  lib/asan/asan_globals.cc
  test/asan/TestCases/Darwin/odr-lto.cc
  test/asan/TestCases/Linux/local_alias.cc
  test/asan/TestCases/Linux/odr-violation.cc


Index: test/asan/TestCases/Linux/odr-violation.cc
===================================================================
--- test/asan/TestCases/Linux/odr-violation.cc
+++ 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
Index: test/asan/TestCases/Linux/local_alias.cc
===================================================================
--- test/asan/TestCases/Linux/local_alias.cc
+++ 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;
Index: test/asan/TestCases/Darwin/odr-lto.cc
===================================================================
--- test/asan/TestCases/Darwin/odr-lto.cc
+++ 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>
Index: lib/asan/asan_flags.inc
===================================================================
--- lib/asan/asan_flags.inc
+++ lib/asan/asan_flags.inc
@@ -152,8 +152,6 @@
 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 "
Index: lib/asan/asan_globals.cc
===================================================================
--- lib/asan/asan_globals.cc
+++ lib/asan/asan_globals.cc
@@ -183,9 +183,7 @@
 // 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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55254.176720.patch
Type: text/x-patch
Size: 3706 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181204/259b86f6/attachment.bin>


More information about the llvm-commits mailing list