[ASan] Revert commit related to TTC-5 (PR sanitizer/81697). 30/173030/1
authorDenis Khalikov <d.khalikov@partner.samsung.com>
Mon, 19 Mar 2018 06:08:53 +0000 (09:08 +0300)
committerDenis Khalikov <d.khalikov@partner.samsung.com>
Mon, 19 Mar 2018 08:27:50 +0000 (11:27 +0300)
We might have a strange situation with ASan and TLS,
when TLS_index struct should be defined as
.word   .LANCHOR0(tlsldm),
but patch for TTC-5 assumes that is no ANCHOR sections
with ASan at all. So, in this specific case we pass TLS_index
struct with wrong alignment to __tls_get_addr () function
which cause a SEGV.

Next commit fix sanitizer/81697 with patch from upstream.

Change-Id: I9ee35ade027d246870bf57387f40217226efb7cc

gcc/testsuite/g++.dg/asan/global-alignment.C [deleted file]
gcc/varasm.c

diff --git a/gcc/testsuite/g++.dg/asan/global-alignment.C b/gcc/testsuite/g++.dg/asan/global-alignment.C
deleted file mode 100644 (file)
index c011c70..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/* { dg-options "-fmerge-all-constants" } */
-/* { dg-do compile } */
-/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
-
-#include <string>
-#include <map>
-
-const char kRecoveryInstallString[] = "NEW";
-const char kRecoveryUpdateString[] = "UPDATE";
-const char kRecoveryUninstallationString[] = "UNINSTALL";
-
-const std::map<std::string, int> kStringToRequestMap = {
-  {kRecoveryInstallString, 0},
-  {kRecoveryUpdateString, 0},
-  {kRecoveryUninstallationString, 0},
-};
-/* { dg-final { scan-assembler-times {\.section\s+\.rodata\n(?:(?!\.section).)*\.(string|ascii|asciz)\s+"NEW} 1 } } */
index 3220675..da88f5b 100644 (file)
@@ -344,8 +344,7 @@ get_section (const char *name, unsigned int flags, tree decl)
 static bool
 use_object_blocks_p (void)
 {
-  return (flag_section_anchors
-         && !(flag_sanitize & SANITIZE_ADDRESS));
+  return flag_section_anchors;
 }
 
 /* Return the object_block structure for section SECT.  Create a new