[PATCH] D152604: [Driver] Default -fsanitize-address-globals-dead-stripping to true for ELF
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 12 17:58:58 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa8d3ae712290: [Driver] Default -fsanitize-address-globals-dead-stripping to true for ELF (authored by MaskRay).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152604/new/
https://reviews.llvm.org/D152604
Files:
clang/lib/Driver/SanitizerArgs.cpp
clang/test/Driver/fsanitize.c
Index: clang/test/Driver/fsanitize.c
===================================================================
--- clang/test/Driver/fsanitize.c
+++ clang/test/Driver/fsanitize.c
@@ -240,7 +240,7 @@
// CHECK-ASAN-WITHOUT-POISON-CUSTOM-ARRAY-NEW-COOKIE-NOT: -cc1{{.*}}address-poison-custom-array-cookie
// RUN: %clang --target=x86_64-linux-gnu -fsanitize=address -fsanitize-address-globals-dead-stripping %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS
-// RUN: %clang --target=x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ASAN-GLOBALS
+// RUN: %clang --target=x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS
// RUN: %clang --target=x86_64-linux-gnu -fsanitize=address -fsanitize-address-globals-dead-stripping -fno-sanitize-address-globals-dead-stripping %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ASAN-GLOBALS
// RUN: %clang_cl --target=x86_64-windows-msvc -fsanitize=address -fsanitize-address-globals-dead-stripping -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS
// RUN: %clang_cl --target=x86_64-windows-msvc -fsanitize=address -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS
Index: clang/lib/Driver/SanitizerArgs.cpp
===================================================================
--- clang/lib/Driver/SanitizerArgs.cpp
+++ clang/lib/Driver/SanitizerArgs.cpp
@@ -928,14 +928,9 @@
options::OPT_fno_sanitize_address_outline_instrumentation,
AsanOutlineInstrumentation);
- // As a workaround for a bug in gold 2.26 and earlier, dead stripping of
- // globals in ASan is disabled by default on most ELF targets.
- // See https://sourceware.org/bugzilla/show_bug.cgi?id=19002
AsanGlobalsDeadStripping = Args.hasFlag(
options::OPT_fsanitize_address_globals_dead_stripping,
- options::OPT_fno_sanitize_address_globals_dead_stripping,
- !TC.getTriple().isOSBinFormatELF() || TC.getTriple().isOSFuchsia() ||
- TC.getTriple().isPS());
+ options::OPT_fno_sanitize_address_globals_dead_stripping, true);
// Enable ODR indicators which allow better handling of mixed instrumented
// and uninstrumented globals. Disable them for Windows where weak odr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152604.530740.patch
Type: text/x-patch
Size: 2312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230613/98bfe84a/attachment-0001.bin>
More information about the cfe-commits
mailing list