aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2017-04-26 00:51:06 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2017-04-26 00:51:06 +0000
commitc7b90947bd0179d914fea56b52be545c8f60f20a (patch)
treefcfb7f9450a769051820e826d19e19c8995028e9 /clang/lib/CodeGen/BackendUtil.cpp
parent9547aabb26148f4eb5cfa1c5ccba0fe4ab7bf4fa (diff)
downloadllvm-c7b90947bd0179d914fea56b52be545c8f60f20a.zip
llvm-c7b90947bd0179d914fea56b52be545c8f60f20a.tar.gz
llvm-c7b90947bd0179d914fea56b52be545c8f60f20a.tar.bz2
[asan] Unconditionally enable GC of globals on COFF.
This change restores pre-r301225 behavior, where linker GC compatible global instrumentation was used on COFF targets disregarding -f(no-)data-sections and/or /Gw flags. This instrumentation puts each global in a COMDAT with an ASan descriptor for that global. It effectively enables -fdata-sections, but limits it to ASan-instrumented globals. llvm-svn: 301374
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 2f35423..85788b4 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -196,9 +196,8 @@ static void addSanitizerCoveragePass(const PassManagerBuilder &Builder,
static bool asanUseGlobalsGC(const Triple &T, const CodeGenOptions &CGOpts) {
switch (T.getObjectFormat()) {
case Triple::MachO:
- return true;
case Triple::COFF:
- return CGOpts.DataSections;
+ return true;
case Triple::ELF:
return CGOpts.DataSections && !CGOpts.DisableIntegratedAS;
default: